mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [syzbot] [xfs?] WARNING in __xfs_healthmon_insert
@ 2026-09-04 14:03 syzbot
  2026-09-06  8:28 ` Forwarded: [PATCH] xfs: take hm->lock around __xfs_healthmon_insert() callers syzbot
  2026-09-06 11:48 ` Forwarded: [PATCH] xfs: take hm->lock in xfs_ioc_health_monitor() before insert syzbot
  0 siblings, 2 replies; 3+ messages in thread
From: syzbot @ 2026-09-04 14:03 UTC (permalink / raw)
  To: cem, linux-kernel, linux-xfs, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    9d80aa4617b3 Add linux-next specific files for 20260903
git tree:       linux-next
console+strace: https://syzkaller.appspot.com/x/log.txt?x=134908f9580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=bb4a32c282cc2ec7
dashboard link: https://syzkaller.appspot.com/bug?extid=ccdf3469f5f653bff7ac
compiler:       Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=17422b49580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=174908f9580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/417a63e8ac61/disk-9d80aa46.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/a1d004c189c1/vmlinux-9d80aa46.xz
kernel image: https://storage.googleapis.com/syzbot-assets/97413e5bd243/bzImage-9d80aa46.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/39404573136a/mount_0.gz
  fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=113e0215580000)

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+ccdf3469f5f653bff7ac@syzkaller.appspotmail.com

XFS (loop0): Quotacheck needed: Please wait.
XFS (loop0): Quotacheck: 
XFS (loop0): Quotacheck: Done.
------------[ cut here ]------------
debug_locks && !(lock_is_held(&(&hm->lock)->dep_map) != 0)
WARNING: fs/xfs/xfs_healthmon.c:275 at __xfs_healthmon_insert+0x32b/0x4e0 fs/xfs/xfs_healthmon.c:275, CPU#0: syz-executor227/5634
Modules linked in:
CPU: 0 UID: 0 PID: 5634 Comm: syz-executor227 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:__xfs_healthmon_insert+0x32b/0x4e0 fs/xfs/xfs_healthmon.c:275
Code: 00 00 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f 5d c3 cc cc cc cc cc e8 84 1f 29 fe 90 0f 0b 90 e9 51 ff ff ff e8 76 1f 29 fe 90 <0f> 0b 90 e9 a9 fd ff ff e8 68 1f 29 fe 48 8d 3d 41 df e3 0c 67 48
RSP: 0018:ffffc90003c0fbe0 EFLAGS: 00010293
RAX: ffffffff839eb57a RBX: dffffc0000000000 RCX: ffff88807f2c9f40
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90003c0fc90 R08: ffffffff907a6a7f R09: 1ffffffff20f4d4f
R10: dffffc0000000000 R11: fffffbfff20f4d50 R12: 0000000000000000
R13: 1ffff92000781f80 R14: ffff8880342dec00 R15: ffffc90003c0fc20
FS:  0000555577e8a400(0000) GS:ffff888124cc0000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000006a9ee0 CR3: 0000000075370000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 xfs_ioc_health_monitor+0x4ac/0x760 fs/xfs/xfs_healthmon.c:1222
 xfs_file_ioctl+0x9fb/0xf40 fs/xfs/xfs_ioctl.c:1534
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]
 __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:583
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fa707f17349
Code: c0 79 93 eb d5 48 8d 7c 1d 00 eb 99 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 d8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc0c2721a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ffc0c2722d8 RCX: 00007fa707f17349
RDX: 0000200000000080 RSI: 0000000040205844 RDI: 0000000000000004
RBP: 0000000000000001 R08: 0000000000000000 R09: 00007ffc0c2722d8
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc0c2722c8
R13: 0000000000000002 R14: 00007fa707fa9c80 R15: 0000000000000002
 </TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Forwarded: [PATCH] xfs: take hm->lock around __xfs_healthmon_insert() callers
  2026-09-04 14:03 [syzbot] [xfs?] WARNING in __xfs_healthmon_insert syzbot
@ 2026-09-06  8:28 ` syzbot
  2026-09-06 11:48 ` Forwarded: [PATCH] xfs: take hm->lock in xfs_ioc_health_monitor() before insert syzbot
  1 sibling, 0 replies; 3+ messages in thread
From: syzbot @ 2026-09-06  8:28 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: [PATCH] xfs: take hm->lock around __xfs_healthmon_insert() callers
Author: kartikey406@gmail.com

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master


__xfs_healthmon_insert() asserts that hm->lock is held, but both of
its callers invoked it without the lock held:

 - xfs_ioc_health_monitor() inserted the initial RUNNING event right
   after allocating hm, before ever taking the lock.
 - xfs_healthmon_unmount() inserted the UNMOUNT event on an already
   published, shared hm without locking it, racing against
   concurrent event producers on the same monitor.

Take hm->lock around both calls.

Reported-by: syzbot+ccdf3469f5f653bff7ac@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=ccdf3469f5f653bff7ac
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
---
 fs/xfs/xfs_healthmon.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/xfs/xfs_healthmon.c b/fs/xfs/xfs_healthmon.c
index 4521ffdab9f1..762f4ce820c8 100644
--- a/fs/xfs/xfs_healthmon.c
+++ b/fs/xfs/xfs_healthmon.c
@@ -415,8 +415,10 @@ xfs_healthmon_unmount(
 	 * There's nothing actionable for userspace after an unmount.  Once
 	 * we've inserted the unmount event, hm no longer owns that event.
 	 */
+	mutex_lock(&hm->lock);
 	__xfs_healthmon_insert(hm, hm->unmount_event);
 	hm->unmount_event = NULL;
+	mutex_unlock(&hm->lock);
 
 	xfs_healthmon_detach(hm);
 	xfs_healthmon_put(hm);
@@ -1213,7 +1215,9 @@ xfs_ioc_health_monitor(
 	}
 	running_event->type = XFS_HEALTHMON_RUNNING;
 	running_event->domain = XFS_HEALTHMON_MOUNT;
+	mutex_lock(&hm->lock);
 	__xfs_healthmon_insert(hm, running_event);
+	mutex_unlock(&hm->lock);
 
 	/*
 	 * Preallocate the unmount event so that we can't fail to notify the
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Forwarded: [PATCH] xfs: take hm->lock in xfs_ioc_health_monitor() before insert
  2026-09-04 14:03 [syzbot] [xfs?] WARNING in __xfs_healthmon_insert syzbot
  2026-09-06  8:28 ` Forwarded: [PATCH] xfs: take hm->lock around __xfs_healthmon_insert() callers syzbot
@ 2026-09-06 11:48 ` syzbot
  1 sibling, 0 replies; 3+ messages in thread
From: syzbot @ 2026-09-06 11:48 UTC (permalink / raw)
  To: linux-kernel, syzkaller-bugs

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: [PATCH] xfs: take hm->lock in xfs_ioc_health_monitor() before insert
Author: kartikey406@gmail.com

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master

__xfs_healthmon_insert() asserts that hm->lock is held
(lockdep_assert_held), but xfs_ioc_health_monitor() called it right
after allocating hm, before ever taking the lock, triggering a
lockdep warning.

Take hm->lock around the call.

Reported-by: syzbot+ccdf3469f5f653bff7ac@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=ccdf3469f5f653bff7ac
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
---
 fs/xfs/xfs_healthmon.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/xfs/xfs_healthmon.c b/fs/xfs/xfs_healthmon.c
index 3ae5f4496ad1..2f762f90d329 100644
--- a/fs/xfs/xfs_healthmon.c
+++ b/fs/xfs/xfs_healthmon.c
@@ -1219,7 +1219,9 @@ xfs_ioc_health_monitor(
 	}
 	running_event->type = XFS_HEALTHMON_RUNNING;
 	running_event->domain = XFS_HEALTHMON_MOUNT;
+	mutex_lock(&hm->lock);
 	__xfs_healthmon_insert(hm, running_event);
+	mutex_unlock(&hm->lock);
 
 	/*
 	 * Preallocate the unmount event so that we can't fail to notify the
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-06 11:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-04 14:03 [syzbot] [xfs?] WARNING in __xfs_healthmon_insert syzbot
2026-09-06  8:28 ` Forwarded: [PATCH] xfs: take hm->lock around __xfs_healthmon_insert() callers syzbot
2026-09-06 11:48 ` Forwarded: [PATCH] xfs: take hm->lock in xfs_ioc_health_monitor() before insert syzbot

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®