]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
smb/server: fix potential null-ptr-deref of lease_ctx_info in smb2_open()
authorChenXiaoSong <chenxiaosong@kylinos.cn>
Thu, 22 Aug 2024 08:20:51 +0000 (08:20 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:44:21 +0000 (07:44 +0200)
commit878f32878351104448b86ef5b85d1f8ed6f599fb
tree9c90f8b294f6179dec7d4c9155aa238b9a1adb19
parent4a788ebbb10db9da453d52eaf44a41c13dc446df
smb/server: fix potential null-ptr-deref of lease_ctx_info in smb2_open()

commit 4e8771a3666c8f216eefd6bd2fd50121c6c437db upstream.

null-ptr-deref will occur when (req_op_level == SMB2_OPLOCK_LEVEL_LEASE)
and parse_lease_state() return NULL.

Fix this by check if 'lease_ctx_info' is NULL.

Additionally, remove the redundant parentheses in
parse_durable_handle_context().

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
[ Drop the parentheses clean-up since the parentheses was introduced by
  c8efcc786146 ("ksmbd: add support for durable handles v1/v2") in v6.9
  Minor context change fixed ]
Signed-off-by: Jianqi Ren <jianqi.ren.cn@windriver.com>
Signed-off-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ksmbd/oplock.c
fs/ksmbd/smb2pdu.c