From: Shuah Khan <skhan@linuxfoundation.org>
To: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Cc: linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com,
linux-kernel@vger.kernel.org, yuanxzhang@fudan.edu.cn,
Xin Tan <tanxin.ctf@gmail.com>,
Brendan Higgins <brendanhiggins@google.com>,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH v2] kunit: fix reference count leak in kfree_at_end
Date: Fri, 1 Oct 2021 13:59:17 -0600 [thread overview]
Message-ID: <aad94cba-5d07-b816-d307-382894f0a012@linuxfoundation.org> (raw)
In-Reply-To: <CAFd5g45mgi-bnTEiHshpyxnah74toncgCgmcQcHq=kP3L3r+Vw@mail.gmail.com>
On 9/28/21 3:27 PM, Brendan Higgins wrote:
> On Thu, Sep 9, 2021 at 12:26 AM Xiyu Yang <xiyuyang19@fudan.edu.cn> wrote:
>>
>> The reference counting issue happens in the normal path of
>> kfree_at_end(). When kunit_alloc_and_get_resource() is invoked, the
>> function forgets to handle the returned resource object, whose refcount
>> increased inside, causing a refcount leak.
>>
>> Fix this issue by calling kunit_alloc_resource() instead of
>> kunit_alloc_and_get_resource().
>>
>> Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
>> Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
>
> Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
>
> Thanks!
>
Thank you for the fix.
Applied now after fixing a checkpatch alignment check to
git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/
kunit-fixes branch.
Please remember to run checkpatch.pl before sending patches.
thanks,
-- Shuah
prev parent reply other threads:[~2021-10-01 19:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-09 7:24 Xiyu Yang
2021-09-09 16:59 ` Daniel Latypov
2021-09-09 17:15 ` Daniel Latypov
2021-09-28 21:27 ` Brendan Higgins
2021-10-01 19:59 ` Shuah Khan [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=aad94cba-5d07-b816-d307-382894f0a012@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=brendanhiggins@google.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=tanxin.ctf@gmail.com \
--cc=xiyuyang19@fudan.edu.cn \
--cc=yuanxzhang@fudan.edu.cn \
/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®