mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ChenXiaoSong <chenxiaosong@chenxiaosong.com>
To: liuqiangneo@163.com, linkinjeon@kernel.org, smfrench@gmail.com,
	senozhatsky@chromium.org, tom@talpey.com
Cc: linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org,
	Qiang Liu <liuqiang@kylinos.cn>
Subject: Re: [PATCH 1/3] ksmbd: fix sd_ndr.data memory leak in ksmbd_vfs_set_sd_xattr
Date: Tue, 23 Jun 2026 10:28:02 +0800	[thread overview]
Message-ID: <ac33d658-0ef3-48f8-b934-dfe2623ed5a7@chenxiaosong.com> (raw)
In-Reply-To: <20260623021240.34722-2-liuqiangneo@163.com>

Looks good. Feel free to add:
Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>

On 6/23/26 10:12, liuqiangneo@163.com wrote:
> From: Qiang Liu <liuqiang@kylinos.cn>
> 
> Move kfree(sd_ndr.data) into the out cleanup path to avoid memory
> leak on error.
> 
> Signed-off-by: Qiang Liu <liuqiang@kylinos.cn>
> ---
>   fs/smb/server/vfs.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/smb/server/vfs.c b/fs/smb/server/vfs.c
> index 74b0307cb100..febe9f7b54c3 100644
> --- a/fs/smb/server/vfs.c
> +++ b/fs/smb/server/vfs.c
> @@ -1479,8 +1479,8 @@ int ksmbd_vfs_set_sd_xattr(struct ksmbd_conn *conn,
>   	if (rc < 0)
>   		pr_err("Failed to store XATTR ntacl :%d\n", rc);
>   
> -	kfree(sd_ndr.data);
>   out:
> +	kfree(sd_ndr.data);
>   	kfree(acl_ndr.data);
>   	kfree(smb_acl);
>   	kfree(def_smb_acl);

-- 
ChenXiaoSong <chenxiaosong@chenxiaosong.com>
Chinese Homepage: https://chenxiaosong.com
English Homepage: https://chenxiaosong.com/en


  reply	other threads:[~2026-06-23  2:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23  2:12 [PATCH 0/3] ksmbd: fix some memory leaks in ksmbd_vfs_* functions liuqiangneo
2026-06-23  2:12 ` [PATCH 1/3] ksmbd: fix sd_ndr.data memory leak in ksmbd_vfs_set_sd_xattr liuqiangneo
2026-06-23  2:28   ` ChenXiaoSong [this message]
2026-06-23  2:12 ` [PATCH 2/3] ksmbd: fix acl.sd_buf memory leak in ksmbd_vfs_get_sd_xattr liuqiangneo
2026-06-23  2:44   ` ChenXiaoSong
2026-06-23  2:12 ` [PATCH 3/3] ksmbd: fix n.data memory leak in ksmbd_vfs_set_dos_attrib_xattr liuqiangneo
2026-06-23  2:46   ` ChenXiaoSong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ac33d658-0ef3-48f8-b934-dfe2623ed5a7@chenxiaosong.com \
    --to=chenxiaosong@chenxiaosong.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuqiang@kylinos.cn \
    --cc=liuqiangneo@163.com \
    --cc=senozhatsky@chromium.org \
    --cc=smfrench@gmail.com \
    --cc=tom@talpey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®