]> git.baikalelectronics.ru Git - kernel.git/commit
knfsd: avoid Oops if buggy userspace performs confusing filehandle->dentry mapping
authorNeilBrown <neilb@suse.de>
Wed, 9 May 2007 09:34:57 +0000 (02:34 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 9 May 2007 19:30:54 +0000 (12:30 -0700)
commitebaa8e494cf32b38d64e80a690078a1b3fba8771
treeeafe41b86a825f7effc4ba596c56507451c60367
parentcd29fa76020eb6602eafcb54bb27554eff35a72a
knfsd: avoid Oops if buggy userspace performs confusing filehandle->dentry mapping

When a lookup request arrives, nfsd uses information provided by userspace
(mountd) to find the right filesystem.

It then assumes that the same filehandle type as the incoming filehandle can
be used to create an outgoing filehandle.

However if mountd is buggy, or maybe just being creative, the filesystem may
not support that filesystem type, and the kernel could oops, particularly if
'ex_uuid' is NULL but a FSID_UUID* filehandle type is used.

So add some proper checking that the fsid version/type from the incoming
filehandle is actually supportable, and ignore that information if it isn't
supportable.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/nfsd/nfsfh.c