syzbot


BUG: spinlock bad magic in btrfs_encoded_read_endio

Status: upstream: reported on 2026/03/20 05:11
Reported-by: syzbot+7f7402e6db0d5687291e@syzkaller.appspotmail.com
First crash: 9d21h, last: 9d09h

Sample crash report:
BUG: spinlock bad magic on CPU#0, kworker/u4:3/46
general protection fault, probably for non-canonical address 0xdffffc00000040b6: 0000 [#1] PREEMPT SMP KASAN
KASAN: probably user-memory-access in range [0x00000000000205b0-0x00000000000205b7]
CPU: 0 PID: 46 Comm: kworker/u4:3 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026
Workqueue: btrfs-endio btrfs_end_bio_work
RIP: 0010:task_pid_nr include/linux/sched.h:1566 [inline]
RIP: 0010:spin_dump+0xc0/0x1a0 kernel/locking/spinlock_debug.c:63
Code: 41 8b 17 49 8d 46 01 48 83 f8 02 73 0f 41 b8 ff ff ff ff 49 c7 c6 a0 68 8c 8a eb 25 4d 8d be b8 05 00 00 4c 89 f8 48 c1 e8 03 <42> 0f b6 04 20 84 c0 0f 85 af 00 00 00 49 81 c6 b0 08 00 00 45 8b
RSP: 0018:ffffc90000b77908 EFLAGS: 00010003
RAX: 00000000000040b6 RBX: ffffc9001d2677b0 RCX: dde2cd8e92219200
RDX: 000000001ffff920 RSI: 0000000080000001 RDI: 0000000000000000
RBP: ffffc90000b779f0 R08: ffffc90000b77607 R09: 1ffff9200016eec0
R10: dffffc0000000000 R11: fffff5200016eec1 R12: dffffc0000000000
R13: 0000000000000003 R14: 000000000001ffff R15: 00000000000205b7
FS:  0000000000000000(0000) GS:ffff8880b8e00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1f816f6286 CR3: 0000000079a8e000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 spin_bug kernel/locking/spinlock_debug.c:77 [inline]
 debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline]
 do_raw_spin_lock+0x1de/0x2f0 kernel/locking/spinlock_debug.c:114
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
 _raw_spin_lock_irqsave+0xbc/0x100 kernel/locking/spinlock.c:162
 __wake_up_common_lock kernel/sched/wait.c:137 [inline]
 __wake_up+0x107/0x1a0 kernel/sched/wait.c:160
 btrfs_encoded_read_endio+0x500/0x640 fs/btrfs/inode.c:10530
 process_one_work+0x8a2/0x1160 kernel/workqueue.c:2292
 worker_thread+0xaa2/0x1270 kernel/workqueue.c:2439
 kthread+0x29d/0x330 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:task_pid_nr include/linux/sched.h:1566 [inline]
RIP: 0010:spin_dump+0xc0/0x1a0 kernel/locking/spinlock_debug.c:63
Code: 41 8b 17 49 8d 46 01 48 83 f8 02 73 0f 41 b8 ff ff ff ff 49 c7 c6 a0 68 8c 8a eb 25 4d 8d be b8 05 00 00 4c 89 f8 48 c1 e8 03 <42> 0f b6 04 20 84 c0 0f 85 af 00 00 00 49 81 c6 b0 08 00 00 45 8b
RSP: 0018:ffffc90000b77908 EFLAGS: 00010003
RAX: 00000000000040b6 RBX: ffffc9001d2677b0 RCX: dde2cd8e92219200
RDX: 000000001ffff920 RSI: 0000000080000001 RDI: 0000000000000000
RBP: ffffc90000b779f0 R08: ffffc90000b77607 R09: 1ffff9200016eec0
R10: dffffc0000000000 R11: fffff5200016eec1 R12: dffffc0000000000
R13: 0000000000000003 R14: 000000000001ffff R15: 00000000000205b7
FS:  0000000000000000(0000) GS:ffff8880b8e00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1f816f6286 CR3: 0000000079a8e000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	41 8b 17             	mov    (%r15),%edx
   3:	49 8d 46 01          	lea    0x1(%r14),%rax
   7:	48 83 f8 02          	cmp    $0x2,%rax
   b:	73 0f                	jae    0x1c
   d:	41 b8 ff ff ff ff    	mov    $0xffffffff,%r8d
  13:	49 c7 c6 a0 68 8c 8a 	mov    $0xffffffff8a8c68a0,%r14
  1a:	eb 25                	jmp    0x41
  1c:	4d 8d be b8 05 00 00 	lea    0x5b8(%r14),%r15
  23:	4c 89 f8             	mov    %r15,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 0f b6 04 20       	movzbl (%rax,%r12,1),%eax <-- trapping instruction
  2f:	84 c0                	test   %al,%al
  31:	0f 85 af 00 00 00    	jne    0xe6
  37:	49 81 c6 b0 08 00 00 	add    $0x8b0,%r14
  3e:	45                   	rex.RB
  3f:	8b                   	.byte 0x8b

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/03/20 17:50 linux-6.1.y f2ddafa93a25 ac6f1dff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan BUG: spinlock bad magic in btrfs_encoded_read_endio
2026/03/20 05:10 linux-6.1.y f2ddafa93a25 2f245add .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan BUG: spinlock bad magic in btrfs_encoded_read_endio
* Struck through repros no longer work on HEAD.