]> git.baikalelectronics.ru Git - kernel.git/commit
NFSD: Don't hold unrefcounted creds over call to nfsd_setuser()
authorDavid Howells <dhowells@redhat.com>
Thu, 2 Jul 2009 13:35:32 +0000 (14:35 +0100)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Fri, 3 Jul 2009 14:21:10 +0000 (10:21 -0400)
commit740c2f57d11beb346e2a5f69a5ad71ea40ba67d9
tree95da0764ea928ce4f821023e23a25001297c7bf3
parent89feb12dd08b870baab8a22265bbff269a80bcf8
NFSD: Don't hold unrefcounted creds over call to nfsd_setuser()

nfsd_open() gets an unrefcounted pointer to the current process's effective
credentials at the top of the function, then calls nfsd_setuser() via
fh_verify() - which may replace and destroy the current process's effective
credentials - and then passes the unrefcounted pointer to dentry_open() - but
the credentials may have been destroyed by this point.

Instead, the value from current_cred() should be passed directly to
dentry_open() as one of its arguments, rather than being cached in a variable.

Possibly fh_verify() should return the creds to use.

This is a regression introduced by
a2ce32cb70eb60e0b76f9827547e5e772b1d1916 "CRED: Pass credentials through
dentry_open()".

Signed-off-by: David Howells <dhowells@redhat.com>
Tested-and-Verified-By: Steve Dickson <steved@redhat.com>
Cc: stable@kernel.org
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
fs/nfsd/vfs.c