]> git.karo-electronics.de Git - karo-tx-linux.git/commit
nfsd4: recheck for secure ports in fh_verify
authorJ. Bruce Fields <bfields@citi.umich.edu>
Mon, 12 Nov 2007 21:05:03 +0000 (16:05 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 26 Nov 2007 17:42:29 +0000 (09:42 -0800)
commit4d20a9ee2a451eede499f375e88f0e3cd59e3646
tree9756a91750b6f542e51877db50941abdbee68ce5
parentb770c6cb7beb6368657c5519821097aba18f69c8
nfsd4: recheck for secure ports in fh_verify

patch 6fa02839bf9412e18e773d04e96182b4cd0b5d57 in mainline.

As with

7fc90ec93a5eb71f4b08... "call nfsd_setuser() on fh_compose()..."

this is a case where we need to redo a security check in fh_verify()
even though the filehandle already has an associated dentry--if the
filehandle was created by fh_compose() in an earlier operation of the
nfsv4 compound, then we may not have done these checks yet.

Without this fix it is possible, for example, to traverse from an export
without the secure ports requirement to one with it in a single
compound, and bypass the secure port check on the new export.

While we're here, fix up some minor style problems and change a printk()
to a dprintk(), to make it harder for random unprivileged users to spam
the logs.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Reviewed-By: NeilBrown <neilb@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/nfsd/nfsfh.c