Re: [PATCH] vxfs fix

Linus Torvalds (torvalds@transmeta.com)
Wed, 1 Aug 2001 15:29:58 -0700 (PDT)


On Wed, 1 Aug 2001 Andries.Brouwer@cwi.nl wrote:
>
> When mount continues to try all types, it may try V7.
> That always succeeds, there is no test for magic or so,
> and after garbage has been mounted as a V7 filesystem,
> the kernel crashes or hangs or fails in other sad ways.

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/