Re: [PATCH][next] ksmbd: Fix read on the uninitialized pointer sess

From: Namjae Jeon
Date: Tue Jul 06 2021 - 08:44:13 EST


Hi Colin,

2021-07-06 21:05 GMT+09:00, Colin King <colin.king@xxxxxxxxxxxxx>:
> From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
>
> There is a error handling case that passes control to label out_err
> without pointer sess being assigned a value. The unassigned pointer
> may be any garbage value and so the test of rc < 0 && sess maybe
> true leading to sess being passed to the call to ksmbd_session_destroy.
> Fix this by setting sess to NULL in this corner case.
>
> Addresses-Coverity: ("Uninitialized pointer read")
> Fixes: f5a544e3bab7 ("ksmbd: add support for SMB3 multichannel")
> Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>
I will apply this patch. Thanks for your patch!