Patch "afs: Fix afs_server_list to be cleaned up with RCU" has been added to the 5.10-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

    afs: Fix afs_server_list to be cleaned up with RCU

to the 5.10-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:
     afs-fix-afs_server_list-to-be-cleaned-up-with-rcu.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 76d46f55bc71e5fcf2d20d7761359aedad105c71
Author: David Howells <dhowells@xxxxxxxxxx>
Date:   Thu Nov 2 16:26:59 2023 +0000

    afs: Fix afs_server_list to be cleaned up with RCU
    
    [ Upstream commit e6bace7313d61e31f2b16fa3d774fd8cb3cb869e ]
    
    afs_server_list is accessed with the rcu_read_lock() held from
    volume->servers, so it needs to be cleaned up correctly.
    
    Fix this by using kfree_rcu() instead of kfree().
    
    Fixes: 8a070a964877 ("afs: Detect cell aliases 1 - Cells with root volumes")
    Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
    cc: Marc Dionne <marc.dionne@xxxxxxxxxxxx>
    cc: linux-afs@xxxxxxxxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/afs/internal.h b/fs/afs/internal.h
index 637cbe549397c..31c7a562147c2 100644
--- a/fs/afs/internal.h
+++ b/fs/afs/internal.h
@@ -546,6 +546,7 @@ struct afs_server_entry {
 };
 
 struct afs_server_list {
+	struct rcu_head		rcu;
 	afs_volid_t		vids[AFS_MAXTYPES]; /* Volume IDs */
 	refcount_t		usage;
 	unsigned char		nr_servers;
diff --git a/fs/afs/server_list.c b/fs/afs/server_list.c
index ed9056703505f..b59896b1de0af 100644
--- a/fs/afs/server_list.c
+++ b/fs/afs/server_list.c
@@ -17,7 +17,7 @@ void afs_put_serverlist(struct afs_net *net, struct afs_server_list *slist)
 		for (i = 0; i < slist->nr_servers; i++)
 			afs_unuse_server(net, slist->servers[i].server,
 					 afs_server_trace_put_slist);
-		kfree(slist);
+		kfree_rcu(slist, rcu);
 	}
 }
 



[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