Patch "NFS: Use parent's objective cred in nfs_access_login_time()" has been added to the 6.7-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    NFS: Use parent's objective cred in nfs_access_login_time()

to the 6.7-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     nfs-use-parent-s-objective-cred-in-nfs_access_login_.patch
and it can be found in the queue-6.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 53a1df19d770bae26e8bc9031864b2cf53f1e883
Author: Scott Mayhew <smayhew@xxxxxxxxxx>
Date:   Tue Dec 5 09:10:54 2023 -0500

    NFS: Use parent's objective cred in nfs_access_login_time()
    
    [ Upstream commit a10a9233073d984b239e22358ba21825e27e2e88 ]
    
    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: 0eb43812c027 ("NFS: Clear the file access cache upon login")
    Fixes: 5e9a7b9c2ea1 ("NFS: Fix up a sparse warning")
    
    Signed-off-by: Scott Mayhew <smayhew@xxxxxxxxxx>
    Signed-off-by: Anna Schumaker <Anna.Schumaker@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 13dffe4201e6..273c0b68abf4 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -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;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux