Skip to content
Commit 033a666c authored by David Howells's avatar David Howells Committed by J. Bruce Fields
Browse files

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
745ca247

 "CRED: Pass credentials through
dentry_open()".

Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Tested-and-Verified-By: default avatarSteve Dickson <steved@redhat.com>
Cc: stable@kernel.org
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
parent 28d0325c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment