From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "lizhijian@fujitsu.com" <lizhijian@fujitsu.com>,
"nvdimm@lists.linux.dev" <nvdimm@lists.linux.dev>
Cc: "Williams, Dan J" <dan.j.williams@intel.com>,
"Jiang, Dave" <dave.jiang@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Weiny, Ira" <ira.weiny@intel.com>
Subject: Re: [PATCH 1/2] nvdimm/btt: Fix memleaks in discover_arenas()
Date: Tue, 20 May 2025 20:47:01 +0000 [thread overview]
Message-ID: <52333be1169e543561c0a55d614f3097373a652b.camel@intel.com> (raw)
In-Reply-To: <20250516051318.509064-1-lizhijian@fujitsu.com>
On Fri, 2025-05-16 at 13:13 +0800, Li Zhijian wrote:
> kmemleak reported a memleak after the ndctl_test
> unreferenced object 0xffff88800e6cf2c0 (size 32):
> comm "modprobe", pid 969, jiffies 4294698691
> hex dump (first 32 bytes):
> 03 00 00 00 a0 0a 00 00 00 b0 b4 00 00 c9 ff ff ................
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
> backtrace (crc 807f3e24):
> __kmalloc_cache_noprof+0x331/0x410
> nvdimm_namespace_attach_btt+0xa9b/0xcc0 [nd_btt]
> platform_probe+0x45/0xa0
> ...
> load_module+0x21f9/0x22f0
>
> faddr2line tells that (based on v6.15-rc4):
> $ ./scripts/faddr2line drivers/nvdimm/nd_btt.o
> nvdimm_namespace_attach_btt+0xa9
> nvdimm_namespace_attach_btt+0xa9b/0xcc0:
> log_set_indices at linux/drivers/nvdimm/btt.c:719
> (inlined by) discover_arenas at linux/drivers/nvdimm/btt.c:888
> (inlined by) btt_init at linux/drivers/nvdimm/btt.c:1583
> (inlined by) nvdimm_namespace_attach_btt at
> linux/drivers/nvdimm/btt.c:1680
>
> It's believed that this was a false positive because the leaking size
> didn't match any instance in an arena.
>
> However during looking into this issue, it's noticed that it does not
> release an initializing arena instance and instances in btt-
> >arena_list
> in some error paths.
>
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
> ---
> drivers/nvdimm/btt.c | 26 +++++++++++++++++---------
> 1 file changed, 17 insertions(+), 9 deletions(-)
Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>
prev parent reply other threads:[~2025-05-20 20:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-16 5:13 Li Zhijian
2025-05-16 5:13 ` [PATCH 2/2] nvdimm/btt: Fix memleaks in btt_init() Li Zhijian
2025-05-20 20:46 ` Verma, Vishal L
2025-05-20 20:47 ` Verma, Vishal L [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=52333be1169e543561c0a55d614f3097373a652b.camel@intel.com \
--to=vishal.l.verma@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=ira.weiny@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizhijian@fujitsu.com \
--cc=nvdimm@lists.linux.dev \
/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®