Re: [PATCH 2/2] smb/server: fix memory leak in ksmbd_login_user()

Thomas Huth <[email protected]>
Newsgroups org.kernel.vger.linux-cifs,org.kernel.vger.stable
Message-ID <[email protected]>
On 31/07/2026 04.42, ZhangGuoDong wrote:
> From: ZhangGuoDong <[email protected]>
> 
> ksmbd_ipc_login_request_ext() returns an independently allocated
> response. ksmbd_alloc_user() copies the supplementary group IDs from
> the response, but ksmbd_login_user() does not release it.
> 
> Free the extended response after ksmbd_alloc_user() has finished with
> it.
> 
> Signed-off-by: ZhangGuoDong <[email protected]>
> Reviewed-by: ChenXiaoSong <[email protected]>
> ---
>   fs/smb/server/mgmt/user_config.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/fs/smb/server/mgmt/user_config.c b/fs/smb/server/mgmt/user_config.c
> index cf45841d9d1b..21b1d51d918b 100644
> --- a/fs/smb/server/mgmt/user_config.c
> +++ b/fs/smb/server/mgmt/user_config.c
> @@ -27,6 +27,7 @@ struct ksmbd_user *ksmbd_login_user(const char *account)
>   
>   	user = ksmbd_alloc_user(resp, resp_ext);
>   out:
> +	kvfree(resp_ext);
>   	kvfree(resp);
>   	return user;
>   }

Fixes: a77e0e02af1c2 ("ksmbd: add support for supplementary groups")
Cc: [email protected]
Reviewed-by: Thomas Huth <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.