From: Jens Axboe <axboe@kernel.dk>
To: Nilay Shroff <nilay@linux.ibm.com>, linux-block@vger.kernel.org
Cc: gjoyce@ibm.com
Subject: Re: [PATCH] null_blk: fix kmemleak by releasing references to fault configfs items
Date: Mon, 12 Jan 2026 13:21:06 -0700 [thread overview]
Message-ID: <b8a5b940-3be3-4f4d-bf3d-36fdf6896e5a@kernel.dk> (raw)
In-Reply-To: <20260112174003.1724320-1-nilay@linux.ibm.com>
On 1/12/26 10:39 AM, Nilay Shroff wrote:
> When CONFIG_BLK_DEV_NULL_BLK_FAULT_INJECTION is enabled, the null-blk
> driver sets up fault injection support by creating the timeout_inject,
> requeue_inject, and init_hctx_fault_inject configfs items as children
> of the top-level nullb configfs group.
>
> However, when the nullb device is removed, the references taken to
> these fault-config configfs items are not released. As a result,
> kmemleak reports a memory leak, for example:
>
> unreferenced object 0xc00000021ff25c40 (size 32):
> comm "mkdir", pid 10665, jiffies 4322121578
> hex dump (first 32 bytes):
> 69 6e 69 74 5f 68 63 74 78 5f 66 61 75 6c 74 5f init_hctx_fault_
> 69 6e 6a 65 63 74 00 88 00 00 00 00 00 00 00 00 inject..........
> backtrace (crc 1a018c86):
> __kmalloc_node_track_caller_noprof+0x494/0xbd8
> kvasprintf+0x74/0xf4
> config_item_set_name+0xf0/0x104
> config_group_init_type_name+0x48/0xfc
> fault_config_init+0x48/0xf0
> 0xc0080000180559e4
> configfs_mkdir+0x304/0x814
> vfs_mkdir+0x49c/0x604
> do_mkdirat+0x314/0x3d0
> sys_mkdir+0xa0/0xd8
> system_call_exception+0x1b0/0x4f0
> system_call_vectored_common+0x15c/0x2ec
>
> Fix this by explicitly releasing the references to the fault-config
> configfs items when dropping the reference to the top-level nullb
> configfs group.
Seems like this should have a fixes and stable tag, too?
--
Jens Axboe
next prev parent reply other threads:[~2026-01-12 20:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-12 17:39 [PATCH] null_blk: fix kmemleak by releasing references to fault configfs items Nilay Shroff
2026-01-12 20:21 ` Jens Axboe [this message]
2026-01-13 5:27 ` Nilay Shroff
2026-01-12 23:50 ` Chaitanya Kulkarni
-- strict thread matches above, loose matches on Subject: below --
2026-01-13 5:28 Nilay Shroff
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=b8a5b940-3be3-4f4d-bf3d-36fdf6896e5a@kernel.dk \
--to=axboe@kernel.dk \
--cc=gjoyce@ibm.com \
--cc=linux-block@vger.kernel.org \
--cc=nilay@linux.ibm.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