From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+c98b21427617af7f547a@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [nvme?] BUG: corrupted list in nvmet_fc_remove_port
Date: Sat, 17 Oct 2026 17:20:03 +0800 [thread overview]
Message-ID: <20261017092004.650-1-hdanton@sina.com> (raw)
In-Reply-To: <6acbc835.a150a118.27e199.003c.GAE@google.com>
> Date: Sun, 11 Oct 2026 10:32:37 -0700 [thread overview]
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: a5ebb76233b7 Merge tag 'edac_urgent_for_v7.3_rc7' of git:/..
> git tree: upstream
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=1494923e580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=df4bbab1c2172b9f
> dashboard link: https://syzkaller.appspot.com/bug?extid=c98b21427617af7f547a
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=126a0f15580000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=166a0f15580000
#syz test
--- x/drivers/nvme/target/fc.c
+++ y/drivers/nvme/target/fc.c
@@ -113,6 +113,7 @@ struct nvmet_fc_tgtport {
struct nvmet_fc_port_entry *pe;
struct kref ref;
u32 max_sg_cnt;
+ int assoc_freed;
};
struct nvmet_fc_port_entry {
@@ -1271,9 +1272,17 @@ nvmet_fc_portentry_bind(struct nvmet_fc_
static void
nvmet_fc_portentry_unbind(struct nvmet_fc_port_entry *pe)
{
+ struct nvmet_fc_port_entry *entry;
unsigned long flags;
spin_lock_irqsave(&nvmet_fc_tgtlock, flags);
+ list_for_each_entry(entry, &nvmet_fc_portentry_list, pe_list) {
+ if (entry == pe)
+ goto out;
+ }
+ spin_unlock_irqrestore(&nvmet_fc_tgtlock, flags);
+ return;
+out:
if (pe->tgtport) {
nvmet_fc_tgtport_put(pe->tgtport);
pe->tgtport->pe = NULL;
@@ -1474,14 +1483,20 @@ static void
__nvmet_fc_free_assocs(struct nvmet_fc_tgtport *tgtport)
{
struct nvmet_fc_tgt_assoc *assoc;
+ unsigned long flags;
+ if (tgtport->assoc_freed)
+ return;
+ tgtport->assoc_freed = 1;
rcu_read_lock();
+ spin_lock_irqsave(&tgtport->lock, flags);
list_for_each_entry_rcu(assoc, &tgtport->assoc_list, a_list) {
if (!nvmet_fc_tgt_a_get(assoc))
continue;
nvmet_fc_schedule_delete_assoc(assoc);
nvmet_fc_tgt_a_put(assoc);
}
+ spin_unlock_irqrestore(&tgtport->lock, flags);
rcu_read_unlock();
}
@@ -1643,8 +1658,10 @@ nvmet_fc_unregister_targetport(struct nv
nvmet_fc_portentry_unbind_tgt(tgtport);
+ spin_lock_irqsave(&nvmet_fc_tgtlock, flags);
/* terminate any outstanding associations */
__nvmet_fc_free_assocs(tgtport);
+ spin_unlock_irqrestore(&nvmet_fc_tgtlock, flags);
flush_workqueue(nvmet_wq);
@@ -2927,8 +2944,10 @@ nvmet_fc_remove_port(struct nvmet_port *
nvmet_fc_portentry_unbind(pe);
if (tgtport) {
+ spin_lock_irqsave(&nvmet_fc_tgtlock, flags);
/* terminate any outstanding associations */
__nvmet_fc_free_assocs(tgtport);
+ spin_unlock_irqrestore(&nvmet_fc_tgtlock, flags);
nvmet_fc_tgtport_put(tgtport);
}
--
next prev parent reply other threads:[~2026-10-17 9:20 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-11 17:32 syzbot
2026-10-12 5:11 ` Hillf Danton
2026-10-12 5:50 ` syzbot
2026-10-12 7:58 ` Hillf Danton
2026-10-12 8:25 ` syzbot
2026-10-12 10:33 ` Hillf Danton
2026-10-12 11:01 ` syzbot
2026-10-12 12:41 ` Hillf Danton
2026-10-12 13:11 ` syzbot
2026-10-17 2:09 ` Hillf Danton
2026-10-17 2:50 ` syzbot
2026-10-17 4:50 ` Nhật Anh Nguyễn Duy
2026-10-17 4:41 ` Hillf Danton
2026-10-17 5:12 ` syzbot
2026-10-17 5:42 ` Hillf Danton
2026-10-17 6:53 ` syzbot
2026-10-17 7:30 ` Hillf Danton
2026-10-17 7:55 ` syzbot
2026-10-17 9:20 ` Hillf Danton [this message]
2026-10-17 10:30 ` syzbot
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=20261017092004.650-1-hdanton@sina.com \
--to=hdanton@sina.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+c98b21427617af7f547a@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.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
all inboxes | Powered by JetHome®