Re: [PATCH v2] kunit: fix reference count leak in kfree_at_end

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/28/21 3:27 PM, Brendan Higgins wrote:
On Thu, Sep 9, 2021 at 12:26 AM Xiyu Yang <xiyuyang19@xxxxxxxxxxxx> 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@xxxxxxxxxxxx>
Signed-off-by: Xin Tan <tanxin.ctf@xxxxxxxxx>

Reviewed-by: Brendan Higgins <brendanhiggins@xxxxxxxxxx>

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



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux