Even on filesystems that have bad (limited or non-existent) magic numbers,
the read_super() function should really be able to do a fair amount of
sanity-checking. If nothing else, then things like verifying that the root
inode really is a directory with a proper size, for example.
I don't think V7 has a magic number at all. But checking that the size and
nr-of-inodes fields make sense, together with verifying that the root
inode really is a directory with (size % 512) == 0, and possibly verifying
things like "if the root directory is not large enough to have a
doubly/triply indirect block, then that doubly/triply indirect blocknumber
had better be zero" would catch 99.9% of everything.
Whether those kind of tests are really worth adding, considering the
rather limited number of people who actually enable the FS, I don't know.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/