From: Shuangpeng <shuangpeng.kernel@gmail.com>
To: justin.tee@broadcom.com, nareshgottumukkala83@gmail.com,
paul.ely@broadcom.com, hch@lst.de, sagi@grimberg.me,
kch@nvidia.com
Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [BUG] KASAN: slab-use-after-free in nvmet_fc_tgt_q_put
Date: Tue, 2 Jun 2026 23:23:13 -0400 [thread overview]
Message-ID: <F54D7903-EA2A-4DF8-92BD-839877786139@gmail.com> (raw)
Hi Kernel Maintainers,
I hit the following KASAN report while testing current upstream kernel:
KASAN: slab-use-after-free in nvmet_fc_tgt_q_put
on commit: e8c2f9fdadee7cbc75134dc463c1e0d856d6e5c7 (May 25 2026)
To help trigger the bug more reliably, we applied a minimal diagnostic patch
that only adds delays and print statements.
The reproducer and .config files are here.
https://gist.github.com/shuangpengbai/57055c1ccb14132218674ec5f3f31d34
I’m happy to test debug patches or provide additional information.
Reported-by: Shuangpeng Bai <shuangpeng.kernel@gmail.com>
[ 755.638997][ T62] BUG: KASAN: slab-use-after-free in nvmet_fc_tgt_q_put (drivers/nvme/target/fc.c:845 ./include/linux/kref.h:65 drivers/nvme/target/fc.c:855)
[ 755.639021][ T62] Read of size 8 at addr ffff8881789bd010 by task kworker/u9:1/62
[ 755.639025][ T62]
[ 755.639049][ T62] Tainted: [D]=DIE
[ 755.639051][ T62] Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 755.639055][ T62] Workqueue: nvmet-wq fcloop_fcp_recv_work
[ 755.639063][ T62] Call Trace:
[ 755.639066][ T62] <TASK>
[ 755.639075][ T62] dump_stack_lvl (lib/dump_stack.c:94 lib/dump_stack.c:120)
[ 755.639082][ T62] print_report (mm/kasan/report.c:378 mm/kasan/report.c:482)
[ 755.639145][ T62] kasan_report (mm/kasan/report.c:595)
[ 755.639167][ T62] nvmet_fc_tgt_q_put (drivers/nvme/target/fc.c:845 ./include/linux/kref.h:65 drivers/nvme/target/fc.c:855)
[ 755.639172][ T62] nvmet_fc_free_fcp_iod (drivers/nvme/target/fc.c:742)
[ 755.639183][ T62] __nvmet_req_complete (drivers/nvme/target/core.c:800)
[ 755.639228][ T62] nvmet_req_init (drivers/nvme/target/core.c:1228)
[ 755.639235][ T62] nvmet_fc_queue_fcp_req (drivers/nvme/target/fc.c:2574 drivers/nvme/target/fc.c:703)
[ 755.639309][ T62] nvmet_fc_rcv_fcp_req (drivers/nvme/target/fc.c:2706)
[ 755.639320][ T62] fcloop_fcp_recv_work (drivers/nvme/target/fcloop.c:695)
[ 755.639326][ T62] process_scheduled_works (kernel/workqueue.c:3314 kernel/workqueue.c:3397)
[ 755.639334][ T62] worker_thread (kernel/workqueue.c:3478)
[ 755.639346][ T62] kthread (kernel/kthread.c:436)
[ 755.639361][ T62] ret_from_fork (arch/x86/kernel/process.c:158)
[ 755.639382][ T62] ret_from_fork_asm (arch/x86/entry/entry_64.S:245)
[ 755.639388][ T62] </TASK>
[ 755.639391][ T62]
[ 755.695276][ T62] Freed by task 8206 on cpu 1 at 750.648915s:
[ 755.695819][ T62] kasan_save_track (mm/kasan/common.c:57 mm/kasan/common.c:78)
[ 755.696265][ T62] kasan_save_free_info (mm/kasan/generic.c:584)
[ 755.696716][ T62] __kasan_slab_free (mm/kasan/common.c:253 mm/kasan/common.c:285)
[ 755.697150][ T62] kfree (./include/linux/kasan.h:235 mm/slub.c:2689 mm/slub.c:6251 mm/slub.c:6566)
[ 755.697522][ T62] nvmet_fc_delete_assoc_work (drivers/nvme/target/fc.c:1071)
[ 755.698028][ T62] process_scheduled_works (kernel/workqueue.c:3314 kernel/workqueue.c:3397)
[ 755.698518][ T62] worker_thread (kernel/workqueue.c:3478)
[ 755.698929][ T62] kthread (kernel/kthread.c:436)
[ 755.699300][ T62] ret_from_fork (arch/x86/kernel/process.c:158)
[ 755.699713][ T62] ret_from_fork_asm (arch/x86/entry/entry_64.S:245)
[ 755.700142][ T62]
[ 755.700357][ T62] The buggy address belongs to the object at ffff8881789bd000
[ 755.700357][ T62] which belongs to the cache kmalloc-2k of size 2048
[ 755.701604][ T62] The buggy address is located 16 bytes inside of
Best,
Shuangpeng
next reply other threads:[~2026-06-03 3:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-03 3:23 Shuangpeng [this message]
2026-06-03 23:22 ` Justin Tee
2026-06-03 23:40 ` Shuangpeng
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=F54D7903-EA2A-4DF8-92BD-839877786139@gmail.com \
--to=shuangpeng.kernel@gmail.com \
--cc=hch@lst.de \
--cc=justin.tee@broadcom.com \
--cc=kch@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=nareshgottumukkala83@gmail.com \
--cc=paul.ely@broadcom.com \
--cc=sagi@grimberg.me \
/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®