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

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_krb5_authenticate() 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/auth.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/fs/smb/server/auth.c b/fs/smb/server/auth.c
> index 4e7b6f0e6b8c..e886ea5681ca 100644
> --- a/fs/smb/server/auth.c
> +++ b/fs/smb/server/auth.c
> @@ -464,6 +464,7 @@ int ksmbd_krb5_authenticate(struct ksmbd_session *sess, char *in_blob,
>   	*out_len = resp->spnego_blob_len;
>   	retval = 0;
>   out:
> +	kvfree(resp_ext);
>   	kvfree(resp);
>   	return retval;
>   }

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.