mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 14:19:16 +00:00
NFS: Use parent's objective cred in nfs_access_login_time()
The subjective cred (task->cred) can potentially be overridden and subsquently freed in non-RCU context, which could lead to a panic if we try to use it in cred_fscmp(). Use __task_cred(), which returns the objective cred (task->real_cred) instead. Fixes:0eb43812c0
("NFS: Clear the file access cache upon login") Fixes:5e9a7b9c2e
("NFS: Fix up a sparse warning") Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
b4d4fd60f8
commit
a10a923307
1 changed files with 1 additions and 1 deletions
|
@ -2963,7 +2963,7 @@ static u64 nfs_access_login_time(const struct task_struct *task,
|
|||
rcu_read_lock();
|
||||
for (;;) {
|
||||
parent = rcu_dereference(task->real_parent);
|
||||
pcred = rcu_dereference(parent->cred);
|
||||
pcred = __task_cred(parent);
|
||||
if (parent == task || cred_fscmp(pcred, cred) != 0)
|
||||
break;
|
||||
task = parent;
|
||||
|
|
Loading…
Reference in a new issue