Commit eb307d09 authored by Namjae Jeon's avatar Namjae Jeon Committed by Steve French

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: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 30210947
...@@ -606,6 +606,7 @@ static int __init ksmbd_server_init(void) ...@@ -606,6 +606,7 @@ static int __init ksmbd_server_init(void)
static void __exit ksmbd_server_exit(void) static void __exit ksmbd_server_exit(void)
{ {
ksmbd_server_shutdown(); ksmbd_server_shutdown();
rcu_barrier();
ksmbd_release_inode_hash(); ksmbd_release_inode_hash();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment