* [syzbot] [bcachefs?] WARNING in bch2_dev_free
@ 2025-04-08 11:53 syzbot
2025-04-09 16:09 ` Charalampos Mitrodimas
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: syzbot @ 2025-04-08 11:53 UTC (permalink / raw)
To: kent.overstreet, linux-bcachefs, linux-kernel, syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: a4cda136f021 Add linux-next specific files for 20250404
git tree: linux-next
console+strace: https://syzkaller.appspot.com/x/log.txt?x=12c3db4c580000
kernel config: https://syzkaller.appspot.com/x/.config?x=8a257c454bb1afb7
dashboard link: https://syzkaller.appspot.com/bug?extid=aec9606169fbc3a12ca6
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17ca0c04580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11c3db4c580000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/59048bc9c206/disk-a4cda136.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/ad2ba7306f20/vmlinux-a4cda136.xz
kernel image: https://storage.googleapis.com/syzbot-assets/b3bef7acbf10/bzImage-a4cda136.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/110624be1513/mount_0.gz
The issue was bisected to:
commit dcffc3b1ae3251d796a25c673f614e3099ca83d3
Author: Kent Overstreet <kent.overstreet@linux.dev>
Date: Sun Mar 30 03:11:08 2025 +0000
bcachefs: Split up bch_dev.io_ref
bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=13948c04580000
final oops: https://syzkaller.appspot.com/x/report.txt?x=10548c04580000
console output: https://syzkaller.appspot.com/x/log.txt?x=17948c04580000
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+aec9606169fbc3a12ca6@syzkaller.appspotmail.com
Fixes: dcffc3b1ae32 ("bcachefs: Split up bch_dev.io_ref")
bcachefs (loop0): shutting down
------------[ cut here ]------------
WARNING: CPU: 0 PID: 5844 at fs/bcachefs/super.c:1229 bch2_dev_free+0x228/0x290 fs/bcachefs/super.c:1229
Modules linked in:
CPU: 0 UID: 0 PID: 5844 Comm: syz-executor121 Not tainted 6.14.0-next-20250404-syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
RIP: 0010:bch2_dev_free+0x228/0x290 fs/bcachefs/super.c:1229
Code: ff e8 4c cf 74 00 4c 89 ef e8 44 cf 74 00 48 89 df 48 83 c4 10 5b 41 5c 41 5d 41 5e 41 5f 5d e9 ee 53 96 07 e8 59 e9 32 fd 90 <0f> 0b 90 e9 09 fe ff ff e8 4b e9 32 fd 90 0f 0b 90 e9 15 fe ff ff
RSP: 0018:ffffc9000406fb88 EFLAGS: 00010293
RAX: ffffffff849073d7 RBX: ffff888035282000 RCX: ffff888034af9e00
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffff8880352820c0 R08: ffffffff850552f7 R09: 0000000000000000
R10: ffff888035282208 R11: ffffed1006a5044a R12: ffff888075e003f0
R13: ffff8880352820b0 R14: ffff888075e00000 R15: ffff888075e007b2
FS: 000055558bb20380(0000) GS:ffff888124f8f000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000000045bdd0 CR3: 00000000122a0000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
bch2_fs_free+0x2b0/0x400 fs/bcachefs/super.c:688
deactivate_locked_super+0xc4/0x130 fs/super.c:473
cleanup_mnt+0x422/0x4c0 fs/namespace.c:1435
task_work_run+0x251/0x310 kernel/task_work.c:227
ptrace_notify+0x2dc/0x390 kernel/signal.c:2520
ptrace_report_syscall include/linux/ptrace.h:415 [inline]
ptrace_report_syscall_exit include/linux/ptrace.h:477 [inline]
syscall_exit_work+0xc7/0x1d0 kernel/entry/common.c:173
syscall_exit_to_user_mode_prepare kernel/entry/common.c:200 [inline]
__syscall_exit_to_user_mode_work kernel/entry/common.c:205 [inline]
syscall_exit_to_user_mode+0x24a/0x340 kernel/entry/common.c:218
do_syscall_64+0x100/0x230 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f49b0cec447
Code: 07 00 48 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffd94723978 EFLAGS: 00000206 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f49b0cec447
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffd94723a30
RBP: 00007ffd94723a30 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000206 R12: 00007ffd94724aa0
R13: 000055558bb216c0 R14: 0000000000000001 R15: 431bde82d7b634db
</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.
For information about bisection process see: https://goo.gl/tpsmEJ#bisection
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] 8+ messages in thread* Re: [syzbot] [bcachefs?] WARNING in bch2_dev_free
2025-04-08 11:53 [syzbot] [bcachefs?] WARNING in bch2_dev_free syzbot
@ 2025-04-09 16:09 ` Charalampos Mitrodimas
2025-04-09 17:02 ` syzbot
2025-04-09 21:51 ` Kent Overstreet
2025-04-12 18:04 ` [syzbot] #syz test syzbot
` (2 subsequent siblings)
3 siblings, 2 replies; 8+ messages in thread
From: Charalampos Mitrodimas @ 2025-04-09 16:09 UTC (permalink / raw)
To: syzbot; +Cc: kent.overstreet, linux-bcachefs, linux-kernel, syzkaller-bugs
syzbot <syzbot+aec9606169fbc3a12ca6@syzkaller.appspotmail.com> writes:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: a4cda136f021 Add linux-next specific files for 20250404
> git tree: linux-next
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=12c3db4c580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=8a257c454bb1afb7
> dashboard link: https://syzkaller.appspot.com/bug?extid=aec9606169fbc3a12ca6
> compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17ca0c04580000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11c3db4c580000
>
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/59048bc9c206/disk-a4cda136.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/ad2ba7306f20/vmlinux-a4cda136.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/b3bef7acbf10/bzImage-a4cda136.xz
> mounted in repro: https://storage.googleapis.com/syzbot-assets/110624be1513/mount_0.gz
>
> The issue was bisected to:
>
> commit dcffc3b1ae3251d796a25c673f614e3099ca83d3
> Author: Kent Overstreet <kent.overstreet@linux.dev>
> Date: Sun Mar 30 03:11:08 2025 +0000
>
> bcachefs: Split up bch_dev.io_ref
>
> bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=13948c04580000
> final oops: https://syzkaller.appspot.com/x/report.txt?x=10548c04580000
> console output: https://syzkaller.appspot.com/x/log.txt?x=17948c04580000
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+aec9606169fbc3a12ca6@syzkaller.appspotmail.com
> Fixes: dcffc3b1ae32 ("bcachefs: Split up bch_dev.io_ref")
>
> bcachefs (loop0): shutting down
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 5844 at fs/bcachefs/super.c:1229 bch2_dev_free+0x228/0x290 fs/bcachefs/super.c:1229
> Modules linked in:
> CPU: 0 UID: 0 PID: 5844 Comm: syz-executor121 Not tainted 6.14.0-next-20250404-syzkaller #0 PREEMPT(full)
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
> RIP: 0010:bch2_dev_free+0x228/0x290 fs/bcachefs/super.c:1229
> Code: ff e8 4c cf 74 00 4c 89 ef e8 44 cf 74 00 48 89 df 48 83 c4 10 5b 41 5c 41 5d 41 5e 41 5f 5d e9 ee 53 96 07 e8 59 e9 32 fd 90 <0f> 0b 90 e9 09 fe ff ff e8 4b e9 32 fd 90 0f 0b 90 e9 15 fe ff ff
> RSP: 0018:ffffc9000406fb88 EFLAGS: 00010293
> RAX: ffffffff849073d7 RBX: ffff888035282000 RCX: ffff888034af9e00
> RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
> RBP: ffff8880352820c0 R08: ffffffff850552f7 R09: 0000000000000000
> R10: ffff888035282208 R11: ffffed1006a5044a R12: ffff888075e003f0
> R13: ffff8880352820b0 R14: ffff888075e00000 R15: ffff888075e007b2
> FS: 000055558bb20380(0000) GS:ffff888124f8f000(0000) knlGS:0000000000000000
> CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 000000000045bdd0 CR3: 00000000122a0000 CR4: 00000000003526f0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> Call Trace:
> <TASK>
> bch2_fs_free+0x2b0/0x400 fs/bcachefs/super.c:688
> deactivate_locked_super+0xc4/0x130 fs/super.c:473
> cleanup_mnt+0x422/0x4c0 fs/namespace.c:1435
> task_work_run+0x251/0x310 kernel/task_work.c:227
> ptrace_notify+0x2dc/0x390 kernel/signal.c:2520
> ptrace_report_syscall include/linux/ptrace.h:415 [inline]
> ptrace_report_syscall_exit include/linux/ptrace.h:477 [inline]
> syscall_exit_work+0xc7/0x1d0 kernel/entry/common.c:173
> syscall_exit_to_user_mode_prepare kernel/entry/common.c:200 [inline]
> __syscall_exit_to_user_mode_work kernel/entry/common.c:205 [inline]
> syscall_exit_to_user_mode+0x24a/0x340 kernel/entry/common.c:218
> do_syscall_64+0x100/0x230 arch/x86/entry/syscall_64.c:100
> entry_SYSCALL_64_after_hwframe+0x77/0x7f
> RIP: 0033:0x7f49b0cec447
> Code: 07 00 48 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8
> RSP: 002b:00007ffd94723978 EFLAGS: 00000206 ORIG_RAX: 00000000000000a6
> RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f49b0cec447
> RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffd94723a30
> RBP: 00007ffd94723a30 R08: 0000000000000000 R09: 0000000000000000
> R10: 00000000ffffffff R11: 0000000000000206 R12: 00007ffd94724aa0
> R13: 000055558bb216c0 R14: 0000000000000001 R15: 431bde82d7b634db
> </TASK>
>
>
> ---
#syz test
From: Charalampos Mitrodimas <charmitro@posteo.net>
Subject: [PATCH] bcachefs: Fix WARN_ON in bch2_dev_free
After splitting bch_dev.io_ref into separate READ and WRITE refs, we
need to ensure both refs are properly stopped before freeing a device.
Add bch2_dev_io_ref_stop(ca, WRITE) to bch2_fs_free() to prevent the
WARNING in bch2_dev_free().
Reported-by: syzbot+aec9606169fbc3a12ca6@syzkaller.appspotmail.com
Fixes: dcffc3b1ae32 ("bcachefs: Split up bch_dev.io_ref")
Signed-off-by: Charalampos Mitrodimas <charmitro@posteo.net>
---
fs/bcachefs/super.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c
index a58edde43bee..089b69b685d9 100644
--- a/fs/bcachefs/super.c
+++ b/fs/bcachefs/super.c
@@ -684,6 +684,7 @@ void bch2_fs_free(struct bch_fs *c)
if (ca) {
EBUG_ON(atomic_long_read(&ca->ref) != 1);
bch2_dev_io_ref_stop(ca, READ);
+ bch2_dev_io_ref_stop(ca, WRITE);
bch2_free_super(&ca->disk_sb);
bch2_dev_free(ca);
}
--
2.39.5
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [syzbot] [bcachefs?] WARNING in bch2_dev_free
2025-04-09 16:09 ` Charalampos Mitrodimas
@ 2025-04-09 17:02 ` syzbot
2025-04-09 21:51 ` Kent Overstreet
1 sibling, 0 replies; 8+ messages in thread
From: syzbot @ 2025-04-09 17:02 UTC (permalink / raw)
To: charmitro, kent.overstreet, linux-bcachefs, linux-kernel,
syzkaller-bugs
Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
unregister_netdevice: waiting for DEV to become free
unregister_netdevice: waiting for batadv0 to become free. Usage count = 3
Tested on:
commit: a2458824 Merge tag 'linux_kselftest-kunit-6.15-rc2' of..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=153ffb4c580000
kernel config: https://syzkaller.appspot.com/x/.config?x=fb8650d88e9fb80f
dashboard link: https://syzkaller.appspot.com/bug?extid=aec9606169fbc3a12ca6
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=17b7fb4c580000
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [syzbot] [bcachefs?] WARNING in bch2_dev_free
2025-04-09 16:09 ` Charalampos Mitrodimas
2025-04-09 17:02 ` syzbot
@ 2025-04-09 21:51 ` Kent Overstreet
1 sibling, 0 replies; 8+ messages in thread
From: Kent Overstreet @ 2025-04-09 21:51 UTC (permalink / raw)
To: Charalampos Mitrodimas
Cc: syzbot, linux-bcachefs, linux-kernel, syzkaller-bugs
On Wed, Apr 09, 2025 at 04:09:41PM +0000, Charalampos Mitrodimas wrote:
> syzbot <syzbot+aec9606169fbc3a12ca6@syzkaller.appspotmail.com> writes:
>
> > Hello,
> >
> > syzbot found the following issue on:
> >
> > HEAD commit: a4cda136f021 Add linux-next specific files for 20250404
> > git tree: linux-next
> > console+strace: https://syzkaller.appspot.com/x/log.txt?x=12c3db4c580000
> > kernel config: https://syzkaller.appspot.com/x/.config?x=8a257c454bb1afb7
> > dashboard link: https://syzkaller.appspot.com/bug?extid=aec9606169fbc3a12ca6
> > compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
> > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17ca0c04580000
> > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11c3db4c580000
> >
> > Downloadable assets:
> > disk image: https://storage.googleapis.com/syzbot-assets/59048bc9c206/disk-a4cda136.raw.xz
> > vmlinux: https://storage.googleapis.com/syzbot-assets/ad2ba7306f20/vmlinux-a4cda136.xz
> > kernel image: https://storage.googleapis.com/syzbot-assets/b3bef7acbf10/bzImage-a4cda136.xz
> > mounted in repro: https://storage.googleapis.com/syzbot-assets/110624be1513/mount_0.gz
> >
> > The issue was bisected to:
> >
> > commit dcffc3b1ae3251d796a25c673f614e3099ca83d3
> > Author: Kent Overstreet <kent.overstreet@linux.dev>
> > Date: Sun Mar 30 03:11:08 2025 +0000
> >
> > bcachefs: Split up bch_dev.io_ref
> >
> > bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=13948c04580000
> > final oops: https://syzkaller.appspot.com/x/report.txt?x=10548c04580000
> > console output: https://syzkaller.appspot.com/x/log.txt?x=17948c04580000
> >
> > IMPORTANT: if you fix the issue, please add the following tag to the commit:
> > Reported-by: syzbot+aec9606169fbc3a12ca6@syzkaller.appspotmail.com
> > Fixes: dcffc3b1ae32 ("bcachefs: Split up bch_dev.io_ref")
> >
> > bcachefs (loop0): shutting down
> > ------------[ cut here ]------------
> > WARNING: CPU: 0 PID: 5844 at fs/bcachefs/super.c:1229 bch2_dev_free+0x228/0x290 fs/bcachefs/super.c:1229
> > Modules linked in:
> > CPU: 0 UID: 0 PID: 5844 Comm: syz-executor121 Not tainted 6.14.0-next-20250404-syzkaller #0 PREEMPT(full)
> > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
> > RIP: 0010:bch2_dev_free+0x228/0x290 fs/bcachefs/super.c:1229
> > Code: ff e8 4c cf 74 00 4c 89 ef e8 44 cf 74 00 48 89 df 48 83 c4 10 5b 41 5c 41 5d 41 5e 41 5f 5d e9 ee 53 96 07 e8 59 e9 32 fd 90 <0f> 0b 90 e9 09 fe ff ff e8 4b e9 32 fd 90 0f 0b 90 e9 15 fe ff ff
> > RSP: 0018:ffffc9000406fb88 EFLAGS: 00010293
> > RAX: ffffffff849073d7 RBX: ffff888035282000 RCX: ffff888034af9e00
> > RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
> > RBP: ffff8880352820c0 R08: ffffffff850552f7 R09: 0000000000000000
> > R10: ffff888035282208 R11: ffffed1006a5044a R12: ffff888075e003f0
> > R13: ffff8880352820b0 R14: ffff888075e00000 R15: ffff888075e007b2
> > FS: 000055558bb20380(0000) GS:ffff888124f8f000(0000) knlGS:0000000000000000
> > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > CR2: 000000000045bdd0 CR3: 00000000122a0000 CR4: 00000000003526f0
> > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> > Call Trace:
> > <TASK>
> > bch2_fs_free+0x2b0/0x400 fs/bcachefs/super.c:688
> > deactivate_locked_super+0xc4/0x130 fs/super.c:473
> > cleanup_mnt+0x422/0x4c0 fs/namespace.c:1435
> > task_work_run+0x251/0x310 kernel/task_work.c:227
> > ptrace_notify+0x2dc/0x390 kernel/signal.c:2520
> > ptrace_report_syscall include/linux/ptrace.h:415 [inline]
> > ptrace_report_syscall_exit include/linux/ptrace.h:477 [inline]
> > syscall_exit_work+0xc7/0x1d0 kernel/entry/common.c:173
> > syscall_exit_to_user_mode_prepare kernel/entry/common.c:200 [inline]
> > __syscall_exit_to_user_mode_work kernel/entry/common.c:205 [inline]
> > syscall_exit_to_user_mode+0x24a/0x340 kernel/entry/common.c:218
> > do_syscall_64+0x100/0x230 arch/x86/entry/syscall_64.c:100
> > entry_SYSCALL_64_after_hwframe+0x77/0x7f
> > RIP: 0033:0x7f49b0cec447
> > Code: 07 00 48 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8
> > RSP: 002b:00007ffd94723978 EFLAGS: 00000206 ORIG_RAX: 00000000000000a6
> > RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f49b0cec447
> > RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffd94723a30
> > RBP: 00007ffd94723a30 R08: 0000000000000000 R09: 0000000000000000
> > R10: 00000000ffffffff R11: 0000000000000206 R12: 00007ffd94724aa0
> > R13: 000055558bb216c0 R14: 0000000000000001 R15: 431bde82d7b634db
> > </TASK>
> >
> >
> > ---
>
> #syz test
>
> From: Charalampos Mitrodimas <charmitro@posteo.net>
> Subject: [PATCH] bcachefs: Fix WARN_ON in bch2_dev_free
>
> After splitting bch_dev.io_ref into separate READ and WRITE refs, we
> need to ensure both refs are properly stopped before freeing a device.
> Add bch2_dev_io_ref_stop(ca, WRITE) to bch2_fs_free() to prevent the
> WARNING in bch2_dev_free().
>
> Reported-by: syzbot+aec9606169fbc3a12ca6@syzkaller.appspotmail.com
> Fixes: dcffc3b1ae32 ("bcachefs: Split up bch_dev.io_ref")
> Signed-off-by: Charalampos Mitrodimas <charmitro@posteo.net>
> ---
> fs/bcachefs/super.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c
> index a58edde43bee..089b69b685d9 100644
> --- a/fs/bcachefs/super.c
> +++ b/fs/bcachefs/super.c
> @@ -684,6 +684,7 @@ void bch2_fs_free(struct bch_fs *c)
> if (ca) {
> EBUG_ON(atomic_long_read(&ca->ref) != 1);
> bch2_dev_io_ref_stop(ca, READ);
> + bch2_dev_io_ref_stop(ca, WRITE);
> bch2_free_super(&ca->disk_sb);
> bch2_dev_free(ca);
> }
> --
> 2.39.5
>
This would seem to indicate shutting down without going read-only, there
might be a deeper bug here
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [syzbot] #syz test
2025-04-08 11:53 [syzbot] [bcachefs?] WARNING in bch2_dev_free syzbot
2025-04-09 16:09 ` Charalampos Mitrodimas
@ 2025-04-12 18:04 ` syzbot
2025-04-12 18:11 ` [syzbot] #syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 5fc31936081919a8572a3d644f3fbb258038f337 syzbot
2025-04-18 0:37 ` [syzbot] syzbot
3 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-04-12 18:04 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: #syz test
Author: gshahrouzi@gmail.com
Try to remove device but fails
Reinitialize reference counting for write operations for device
Shut down the filesystem
Make the filesystem read only
Read-write bit is not set so it skips trying to make the filesystem read-only, implying that the filesystem is already in read-only mode.
Encounter error because write operations are still assigned to a device
When the filesystem is starting up, it tries setting it to set the filesystem to read-only but it’s already set.
When failing to remove a device, it tries giving back write permissions to a device when the filesystem is read-only (not sure if this is nonsensical or not).
Since a device has write permissions, it tries to remove them but fails because the filesystem is in read-only mode.
So the fix here is to prevent it from giving the device write permissions if the filesystem is in read-only mode.
Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.com>
---
fs/bcachefs/super.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c
index b79e80a435e09..788e870bfef6a 100644
--- a/fs/bcachefs/super.c
+++ b/fs/bcachefs/super.c
@@ -1757,7 +1757,8 @@ int bch2_dev_remove(struct bch_fs *c, struct bch_dev *ca, int flags)
up_write(&c->state_lock);
return 0;
err:
- if (ca->mi.state == BCH_MEMBER_STATE_rw &&
+ if (test_bit(BCH_FS_rw, &c->flags) &&
+ ca->mi.state == BCH_MEMBER_STATE_rw &&
!percpu_ref_is_zero(&ca->io_ref[READ]))
__bch2_dev_read_write(c, ca);
up_write(&c->state_lock);
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [syzbot] #syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 5fc31936081919a8572a3d644f3fbb258038f337
2025-04-08 11:53 [syzbot] [bcachefs?] WARNING in bch2_dev_free syzbot
2025-04-09 16:09 ` Charalampos Mitrodimas
2025-04-12 18:04 ` [syzbot] #syz test syzbot
@ 2025-04-12 18:11 ` syzbot
2025-04-18 0:37 ` [syzbot] syzbot
3 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-04-12 18:11 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: #syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 5fc31936081919a8572a3d644f3fbb258038f337
Author: gshahrouzi@gmail.com
Another test with earlier branch because of unassociated error popping up:
unregister_netdevice: waiting for batadv0 to become free. Usage count = 3.
Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.com>
---
fs/bcachefs/super.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c
index b79e80a435e09..788e870bfef6a 100644
--- a/fs/bcachefs/super.c
+++ b/fs/bcachefs/super.c
@@ -1757,7 +1757,8 @@ int bch2_dev_remove(struct bch_fs *c, struct bch_dev *ca, int flags)
up_write(&c->state_lock);
return 0;
err:
- if (ca->mi.state == BCH_MEMBER_STATE_rw &&
+ if (test_bit(BCH_FS_rw, &c->flags) &&
+ ca->mi.state == BCH_MEMBER_STATE_rw &&
!percpu_ref_is_zero(&ca->io_ref[READ]))
__bch2_dev_read_write(c, ca);
up_write(&c->state_lock);
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [syzbot]
2025-04-08 11:53 [syzbot] [bcachefs?] WARNING in bch2_dev_free syzbot
` (2 preceding siblings ...)
2025-04-12 18:11 ` [syzbot] #syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 5fc31936081919a8572a3d644f3fbb258038f337 syzbot
@ 2025-04-18 0:37 ` syzbot
3 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-04-18 0:37 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:
Author: kent.overstreet@linux.dev
#syz fix: bcachefs: Prevent granting write refs when filesystem is read-only
^ permalink raw reply [flat|nested] 8+ messages in thread
* [syzbot] [perf?] WARNING in __free_event
@ 2025-04-04 7:02 syzbot
2025-04-05 22:58 ` [syzbot] #syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 5fc31936081919a8572a3d644f3fbb258038f337 syzbot
0 siblings, 1 reply; 8+ messages in thread
From: syzbot @ 2025-04-04 7:02 UTC (permalink / raw)
To: acme, adrian.hunter, alexander.shishkin, edumazet, irogers, jolsa,
kan.liang, linux-kernel, linux-perf-users, mark.rutland, mingo,
namhyung, netdev, peterz, sven, sw, syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: 0a87d6bb6fd2 Merge tag 'powerpc-6.15-2' of git://git.kerne..
git tree: bpf-next
console+strace: https://syzkaller.appspot.com/x/log.txt?x=1780f7b0580000
kernel config: https://syzkaller.appspot.com/x/.config?x=6631c78ce6cb228d
dashboard link: https://syzkaller.appspot.com/bug?extid=ff3aa851d46ab82953a3
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=15440be4580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12295404580000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/e5cffcf83e28/disk-0a87d6bb.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/905e70de24af/vmlinux-0a87d6bb.xz
kernel image: https://storage.googleapis.com/syzbot-assets/5c28ed628313/bzImage-0a87d6bb.xz
The issue was bisected to:
commit 00b35530811f2aa3d7ceec2dbada80861c7632a8
Author: Eric Dumazet <edumazet@google.com>
Date: Thu Feb 6 14:04:22 2025 +0000
batman-adv: adopt netdev_hold() / netdev_put()
bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=10a7e94c580000
final oops: https://syzkaller.appspot.com/x/report.txt?x=12a7e94c580000
console output: https://syzkaller.appspot.com/x/log.txt?x=14a7e94c580000
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+ff3aa851d46ab82953a3@syzkaller.appspotmail.com
Fixes: 00b35530811f ("batman-adv: adopt netdev_hold() / netdev_put()")
------------[ cut here ]------------
WARNING: CPU: 1 PID: 6031 at kernel/events/core.c:5572 __free_event+0x50f/0x620 kernel/events/core.c:5572
Modules linked in:
CPU: 1 UID: 0 PID: 6031 Comm: syz-executor189 Not tainted 6.14.0-syzkaller-g0a87d6bb6fd2 #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
RIP: 0010:__free_event+0x50f/0x620 kernel/events/core.c:5572
Code: ff 48 c7 c7 a0 0c df 8e e8 6e a5 a6 ff 43 0f b6 44 25 00 84 c0 0f 85 f5 00 00 00 41 80 26 ef e9 ea fc ff ff e8 d2 46 cb ff 90 <0f> 0b 90 42 80 3c 3b 00 0f 85 2d fe ff ff e9 30 fe ff ff e8 b9 46
RSP: 0018:ffffc9000461f858 EFLAGS: 00010293
RAX: ffffffff81f8104e RBX: 1ffff110089a873c RCX: ffff88802f5dda00
RDX: 0000000000000000 RSI: 0000000000000003 RDI: 0000000000000001
RBP: 0000000000000003 R08: ffffffff81f80e1b R09: 1ffff1100fc94b45
R10: dffffc0000000000 R11: ffffed100fc94b46 R12: ffff888044d439d8
R13: ffff888044d439e0 R14: 1ffff110089a873b R15: dffffc0000000000
FS: 00007f1a7f6516c0(0000) GS:ffff888125099000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1a7f743320 CR3: 000000003461c000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
inherit_event+0x190/0x9d0 kernel/events/core.c:14036
inherit_group kernel/events/core.c:14110 [inline]
inherit_task_group+0x18d/0x4f0 kernel/events/core.c:14177
perf_event_init_context kernel/events/core.c:14226 [inline]
perf_event_init_task+0x244/0x650 kernel/events/core.c:14295
copy_process+0x151e/0x3d10 kernel/fork.c:2403
kernel_clone+0x242/0x930 kernel/fork.c:2844
__do_sys_clone kernel/fork.c:2987 [inline]
__se_sys_clone kernel/fork.c:2971 [inline]
__x64_sys_clone+0x268/0x2e0 kernel/fork.c:2971
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f1a7f6b98d9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 18 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f1a7f651218 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
RAX: ffffffffffffffda RBX: 00007f1a7f743338 RCX: 00007f1a7f6b98d9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000ab009400
RBP: 00007f1a7f743330 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f1a7f710a94
R13: affffff7ffffffff R14: 0000200000000180 R15: 00000000ab009400
</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.
For information about bisection process see: https://goo.gl/tpsmEJ#bisection
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] 8+ messages in thread* Re: [syzbot] #syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 5fc31936081919a8572a3d644f3fbb258038f337
2025-04-04 7:02 [syzbot] [perf?] WARNING in __free_event syzbot
@ 2025-04-05 22:58 ` syzbot
0 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-04-05 22:58 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: #syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 5fc31936081919a8572a3d644f3fbb258038f337
Author: gshahrouzi@gmail.com
Move the get_ctx(child_ctx) call and the child_event->ctx assignment to
occur immediately after the child event is allocated. Ensure that
child_event->ctx is non-NULL before any subsequent error path within
inherit_event calls free_event(), satisfying the assumptions of the
cleanup code.
Reported-by: syzbot+ff3aa851d46ab82953a3@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=ff3aa851d46ab82953a3
Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.com>
---
kernel/events/core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 0bb21659e252..153ba622cfa0 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -14016,6 +14016,9 @@ inherit_event(struct perf_event *parent_event,
if (IS_ERR(child_event))
return child_event;
+ get_ctx(child_ctx);
+ child_event->ctx = child_ctx;
+
pmu_ctx = find_get_pmu_context(child_event->pmu, child_ctx, child_event);
if (IS_ERR(pmu_ctx)) {
free_event(child_event);
@@ -14037,8 +14040,6 @@ inherit_event(struct perf_event *parent_event,
return NULL;
}
- get_ctx(child_ctx);
-
/*
* Make the child state follow the state of the parent event,
* not its attr.disabled bit. We hold the parent's mutex,
@@ -14059,7 +14060,6 @@ inherit_event(struct perf_event *parent_event,
local64_set(&hwc->period_left, sample_period);
}
- child_event->ctx = child_ctx;
child_event->overflow_handler = parent_event->overflow_handler;
child_event->overflow_handler_context
= parent_event->overflow_handler_context;
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-04-18 0:37 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-08 11:53 [syzbot] [bcachefs?] WARNING in bch2_dev_free syzbot
2025-04-09 16:09 ` Charalampos Mitrodimas
2025-04-09 17:02 ` syzbot
2025-04-09 21:51 ` Kent Overstreet
2025-04-12 18:04 ` [syzbot] #syz test syzbot
2025-04-12 18:11 ` [syzbot] #syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 5fc31936081919a8572a3d644f3fbb258038f337 syzbot
2025-04-18 0:37 ` [syzbot] syzbot
-- strict thread matches above, loose matches on Subject: below --
2025-04-04 7:02 [syzbot] [perf?] WARNING in __free_event syzbot
2025-04-05 22:58 ` [syzbot] #syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 5fc31936081919a8572a3d644f3fbb258038f337 syzbot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox