[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <48975544-9b5f-eb2a-e2a2-f0ffa537aa1c@huawei.com>
Date: Tue, 7 Mar 2023 16:52:42 +0800
From: ChenXiaoSong <chenxiaosong2@...wei.com>
To: <linkinjeon@...nel.org>, <sfrench@...ba.org>,
<stfrench@...rosoft.com>
CC: <linux-cifs@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ksmbd: fix possible refcount leak in smb2_open()
Hi Namjae and Steve:
Do you have any suggestions for this patch?
在 2023/3/2 21:58, ChenXiaoSong 写道:
> Reference count of acls will leak when memory allocation fails. Fix this
> by adding the missing posix_acl_release().
>
> Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
> Signed-off-by: ChenXiaoSong <chenxiaosong2@...wei.com>
> ---
> fs/ksmbd/smb2pdu.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c
> index 0685c1c77b9f..f04d810a2588 100644
> --- a/fs/ksmbd/smb2pdu.c
> +++ b/fs/ksmbd/smb2pdu.c
> @@ -2977,8 +2977,11 @@ int smb2_open(struct ksmbd_work *work)
> sizeof(struct smb_acl) +
> sizeof(struct smb_ace) * ace_num * 2,
> GFP_KERNEL);
> - if (!pntsd)
> + if (!pntsd) {
> + posix_acl_release(fattr.cf_acls);
> + posix_acl_release(fattr.cf_dacls);
> goto err_out;
> + }
>
> rc = build_sec_desc(idmap,
> pntsd, NULL, 0,
>
Powered by blists - more mailing lists