Re: [PATCH v2 02/12] smb/server: fix potential null-ptr-deref of lease_ctx_info in smb2_open()

From: Namjae Jeon
Date: Thu Aug 22 2024 - 07:49:13 EST


On Thu, Aug 22, 2024 at 5:22 PM <chenxiaosong@xxxxxxxxxxxxxxxx> wrote:
>
> From: ChenXiaoSong <chenxiaosong@xxxxxxxxxx>
>
> 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@xxxxxxxxxx>
Applied it to #ksmbd-for-next-next.
Thanks.