Re: [PATCH] ksmbd: fix use-after-free and NULL deref in smb_grant_oplock()
From: ChenXiaoSong
Date: Tue Mar 17 2026 - 02:34:59 EST
Hi Werner,
Thanks for your patch. It seems the changes below are not included. Do you have any follow-up patches that haven't been submitted yet?
Thanks,
ChenXiaoSong <chenxiaosong@xxxxxxxxxxxxxxxx>
在 2026/3/17 10:18, Werner Kasselman 写道:
- Preallocate lease_table via alloc_lease_table() before opinfo_add()
so add_lease_global_list() becomes infallible after publication.
- Keep the original m_op_list publication order (opinfo_add before
lease list) so concurrent opens via same_client_has_lease() and
opinfo_get_list() still see the in-flight grant.
- Use opinfo_put() instead of __free_opinfo() on err_out so that
the RCU-deferred free path is used.
This also requires splitting add_lease_global_list() to take a
preallocated lease_table and changing its return type from int to void,
since it can no longer fail.