diff options
author | Namjae Jeon <linkinjeon@kernel.org> | 2023-05-03 01:51:51 +0200 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2023-05-04 06:03:02 +0200 |
commit | eb307d09fe15844fdaebeb8cc8c9b9e925430aa5 (patch) | |
tree | 2d39595c973c37f921b91c933f7c84e194788d63 /fs | |
parent | ksmbd: fix racy issue under cocurrent smb2 tree disconnect (diff) | |
download | linux-eb307d09fe15844fdaebeb8cc8c9b9e925430aa5.tar.xz linux-eb307d09fe15844fdaebeb8cc8c9b9e925430aa5.zip |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ksmbd/server.c | 1 |
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(); } |