summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNamjae Jeon <linkinjeon@kernel.org>2023-05-03 02:51:51 +0300
committerSteve French <stfrench@microsoft.com>2023-05-04 07:03:02 +0300
commiteb307d09fe15844fdaebeb8cc8c9b9e925430aa5 (patch)
tree2d39595c973c37f921b91c933f7c84e194788d63
parent30210947a343b6b3ca13adc9bfc88e1543e16dd5 (diff)
downloadlinux-eb307d09fe15844fdaebeb8cc8c9b9e925430aa5.tar.xz
ksmbd: call rcu_barrier() in ksmbd_server_exit()
racy issue is triggered the bug by racing between closing a connection and rmmod. In ksmbd, rcu_barrier() is not called at module unload time, so nothing prevents ksmbd from getting unloaded while it still has RCU callbacks pending. It leads to trigger unintended execution of kernel code locally and use to defeat protections such as Kernel Lockdown Cc: stable@vger.kernel.org Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-20477 Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
-rw-r--r--fs/ksmbd/server.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ksmbd/server.c b/fs/ksmbd/server.c
index 2ebf6985a88d..f9b2e0f19b03 100644
--- a/fs/ksmbd/server.c
+++ b/fs/ksmbd/server.c
@@ -606,6 +606,7 @@ err_unregister:
static void __exit ksmbd_server_exit(void)
{
ksmbd_server_shutdown();
+ rcu_barrier();
ksmbd_release_inode_hash();
}