This is a note to let you know that I've just added the patch titled ksmbd: call rcu_barrier() in ksmbd_server_exit() to the 6.3-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: ksmbd-call-rcu_barrier-in-ksmbd_server_exit.patch and it can be found in the queue-6.3 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From eb307d09fe15844fdaebeb8cc8c9b9e925430aa5 Mon Sep 17 00:00:00 2001 From: Namjae Jeon <linkinjeon@xxxxxxxxxx> Date: Wed, 3 May 2023 08:51:51 +0900 Subject: ksmbd: call rcu_barrier() in ksmbd_server_exit() From: Namjae Jeon <linkinjeon@xxxxxxxxxx> commit eb307d09fe15844fdaebeb8cc8c9b9e925430aa5 upstream. 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@xxxxxxxxxxxxxxx Reported-by: zdi-disclosures@xxxxxxxxxxxxxx # ZDI-CAN-20477 Signed-off-by: Namjae Jeon <linkinjeon@xxxxxxxxxx> Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/ksmbd/server.c | 1 + 1 file changed, 1 insertion(+) --- 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(); } Patches currently in stable-queue which might be from linkinjeon@xxxxxxxxxx are queue-6.3/ksmbd-block-asynchronous-requests-when-making-a-delay-on-session-setup.patch queue-6.3/ksmbd-not-allow-guest-user-on-multichannel.patch queue-6.3/ksmbd-fix-racy-issue-from-smb2-close-and-logoff-with-multichannel.patch queue-6.3/ksmbd-fix-memleak-in-session-setup.patch queue-6.3/ksmbd-fix-null-pointer-dereference-in-smb2_get_info_filesystem.patch queue-6.3/ksmbd-fix-racy-issue-from-session-setup-and-logoff.patch queue-6.3/ksmbd-fix-racy-issue-under-cocurrent-smb2-tree-disconnect.patch queue-6.3/ksmbd-fix-deadlock-in-ksmbd_find_crypto_ctx.patch queue-6.3/ksmbd-destroy-expired-sessions.patch queue-6.3/ksmbd-call-rcu_barrier-in-ksmbd_server_exit.patch