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)
commitb41eeef14d7c73af6d16c7d02b7a939082a137ff
treeeafe41b86a825f7effc4ba596c56507451c60367
parent072f62ed85a71bbb3429a52678500ec9f9441e0d
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