The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+9921e319bd6168140b40@syzkaller.appspotmail.com>
Cc: Yu Kuai <yukuai1@huaweicloud.com>,
	Paul Menzel <pmenzel@molgen.mpg.de>, Xiao Ni <xni@redhat.com>,
	linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [fuse?] WARNING: refcount bug in process_scheduled_works
Date: Wed, 30 Jul 2025 16:36:40 +0800	[thread overview]
Message-ID: <20250730083641.3512-1-hdanton@sina.com> (raw)
In-Reply-To: <68894408.a00a0220.26d0e1.0012.GAE@google.com>

> Date: Tue, 29 Jul 2025 14:58:32 -0700	[thread overview]
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    ced1b9e0392d Merge tag 'ata-6.17-rc1' of git://git.kernel...
> git tree:       upstream
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=15c89782580000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=d51af648924b64c9
> dashboard link: https://syzkaller.appspot.com/bug?extid=9921e319bd6168140b40
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=177f7034580000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=165e44a2580000

Test Yu Kuai's fix (https://lore.kernel.org/lkml/20250730073321.2583158-1-yukuai1@huaweicloud.com/)

#syz test

--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -636,6 +636,12 @@ static void __mddev_put(struct mddev *mddev)
 	    mddev->ctime || mddev->hold_active)
 		return;
 
+	/*
+	 * If array is freed by stopping array, MD_DELETED is set by
+	 * do_md_stop(), MD_DELETED is still set here in cause mddev is freed
+	 * directly by closing a mddev that is created by create_on_open.
+	 */
+	set_bit(MD_DELETED, &mddev->flags);
 	/*
 	 * Call queue_work inside the spinlock so that flush_workqueue() after
 	 * mddev_find will succeed in waiting for the work to be done.
-- 

  parent reply	other threads:[~2025-07-30  8:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-29 21:58 [syzbot] [fuse?] WARNING: refcount bug in process_scheduled_works syzbot
2025-07-30  2:03 ` Hillf Danton
2025-07-30  5:16   ` syzbot
2025-07-30  8:24 ` Hillf Danton
2025-07-30 10:06   ` syzbot
2025-07-30  8:36 ` Hillf Danton [this message]
2025-07-30 10:26   ` 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=20250730083641.3512-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmenzel@molgen.mpg.de \
    --cc=syzbot+9921e319bd6168140b40@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=xni@redhat.com \
    --cc=yukuai1@huaweicloud.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