diff options
author | David Howells | 2023-11-02 16:26:59 +0000 |
---|---|---|
committer | Greg Kroah-Hartman | 2023-12-03 07:32:06 +0100 |
commit | 790ea5bc4022a138fccb2436ddabac2eb1dd71ae (patch) | |
tree | 02190b57ef624d0cf5933ebd7f551f477a113636 /fs/afs | |
parent | 6ac30d748bb080752d4078d482534b68d62f685f (diff) |
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@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/afs')
-rw-r--r-- | fs/afs/internal.h | 1 | ||||
-rw-r--r-- | fs/afs/server_list.c | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/fs/afs/internal.h b/fs/afs/internal.h index 9ba7b68375c9..c2d70fc1698c 100644 --- a/fs/afs/internal.h +++ b/fs/afs/internal.h @@ -552,6 +552,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 ed9056703505..b59896b1de0a 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); } } |