From: Zizhi Wo <wozizhi@huawei.com>
To: Namjae Jeon <linkinjeon@kernel.org>
Cc: <sfrench@samba.org>, <senozhatsky@chromium.org>,
<lsahlber@redhat.com>, <hyc.lee@gmail.com>,
<linux-cifs@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<yangerkun@huawei.com>
Subject: Re: [PATCH -next] ksmbd: fix memory leak in smb2_lock()
Date: Mon, 4 Dec 2023 09:14:55 +0800 [thread overview]
Message-ID: <86261c8b-686e-4542-af44-51ec4cd39730@huawei.com> (raw)
In-Reply-To: <CAKYAXd-6AfN8PUZWafHHg8xeH+7T5CLFtjs+4Snb=smiDHJgqQ@mail.gmail.com>
在 2023/12/2 11:54, Namjae Jeon 写道:
> 2023-12-01 23:50 GMT+09:00, Zizhi Wo <wozizhi@huawei.com>:
>> In smb2_lock(), if setup_async_work() executes successfully,
>> work->cancel_argv will bind the argv that generated by kmalloc(). And
>> release_async_work() is called in ksmbd_conn_try_dequeue_request() or
>> smb2_lock() to release argv.
>> However, when setup_async_work function fails, work->cancel_argv has not
>> been bound to the argv, resulting in the previously allocated argv not
>> being released. Call kfree() to fix it.
>>
>> when setup_async_work fails, the code will go to the
>> "out" branch, resulting in the previously allocated "argv" not being
>> released. Call kfree() to fix it.
>>
>> Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
>> Signed-off-by: Zizhi Wo <wozizhi@huawei.com>
> Acked-by: Namjae Jeon <linkinjeon@kernel.org>
>
> Applied it to #ksmbd-for-next-next .
> Thanks.
Thanks, but I found a redundant paragraph in my commit message, and I
will send version V2 to fix it.
prev parent reply other threads:[~2023-12-04 1:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-01 14:50 [PATCH -next] ksmbd: fix memory leak in smb2_lock() Zizhi Wo
2023-12-02 3:54 ` Namjae Jeon
2023-12-04 1:14 ` Zizhi Wo [this message]
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=86261c8b-686e-4542-af44-51ec4cd39730@huawei.com \
--to=wozizhi@huawei.com \
--cc=hyc.lee@gmail.com \
--cc=linkinjeon@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lsahlber@redhat.com \
--cc=senozhatsky@chromium.org \
--cc=sfrench@samba.org \
--cc=yangerkun@huawei.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