]> www.infradead.org Git - users/willy/xarray.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)
committerSteve French <stfrench@microsoft.com>
Thu, 22 Aug 2024 14:52:00 +0000 (09:52 -0500)
commit4e8771a3666c8f216eefd6bd2fd50121c6c437db
tree2109f0f7167fdb75f395bb79dfb2bf347df9d918
parent2186a116538a715b20e15f84fdd3545e5fe0a39b
smb/server: fix potential null-ptr-deref of lease_ctx_info in smb2_open()

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>
fs/smb/server/oplock.c
fs/smb/server/smb2pdu.c