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: 97d, last: 17h12m
Similar bugs (4)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 BUG: spinlock bad magic in release_metapage origin:upstream 19 C error 95 45d 647d 0/3 upstream: reported C repro on 2024/09/15 11:43
linux-6.6 BUG: spinlock bad magic in release_metapage origin:upstream 4 C error 11 18d 211d 0/2 upstream: reported C repro on 2025/11/25 20:12
linux-6.1 BUG: spinlock bad magic in release_metapage origin:upstream 4 C error 88 36d 629d 0/3 upstream: reported C repro on 2024/10/04 04:01
upstream BUG: spinlock bad magic in release_metapage prio:high jfs 15 C inconclusive 866 5d01h 652d 0/29 upstream: reported C repro on 2024/09/10 08:16

Sample crash report:
BUG: spinlock bad magic on CPU#1, kworker/u4:7/4347
general protection fault, probably for non-canonical address 0xdffffc00000000b7: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x00000000000005b8-0x00000000000005bf]
CPU: 1 PID: 4347 Comm: kworker/u4:7 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026
Workqueue: btrfs-endio btrfs_end_bio_work
RIP: 0010:task_pid_nr include/linux/sched.h:1573 [inline]
RIP: 0010:spin_dump+0xb1/0x1a0 kernel/locking/spinlock_debug.c:67
Code: e8 03 42 0f b6 04 20 84 c0 0f 85 a8 00 00 00 41 8b 17 49 8d 46 ff 48 83 f8 fd 77 27 4d 8d be b8 05 00 00 4c 89 f8 48 c1 e8 03 <42> 0f b6 04 20 84 c0 0f 85 be 00 00 00 49 81 c6 b0 08 00 00 45 8b
RSP: 0018:ffffc900047e7908 EFLAGS: 00010006
RAX: 00000000000000b7 RBX: ffffc90004967850 RCX: b2274a7c9abc3500
RDX: 00000000ffff8880 RSI: 0000000080000001 RDI: 0000000000000000
RBP: ffffc900047e79f0 R08: ffffc900047e7607 R09: 1ffff920008fcec0
R10: dffffc0000000000 R11: fffff520008fcec1 R12: dffffc0000000000
R13: 0000000000000003 R14: 0000000000000001 R15: 00000000000005b9
FS:  0000000000000000(0000) GS:ffff8880b8f00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fcfd7df7a10 CR3: 000000005cee5000 CR4: 00000000003506e0
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:10555
 process_one_work+0x8ab/0x1160 kernel/workqueue.c:2292
 worker_thread+0xaf5/0x12a0 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:1573 [inline]
RIP: 0010:spin_dump+0xb1/0x1a0 kernel/locking/spinlock_debug.c:67
Code: e8 03 42 0f b6 04 20 84 c0 0f 85 a8 00 00 00 41 8b 17 49 8d 46 ff 48 83 f8 fd 77 27 4d 8d be b8 05 00 00 4c 89 f8 48 c1 e8 03 <42> 0f b6 04 20 84 c0 0f 85 be 00 00 00 49 81 c6 b0 08 00 00 45 8b
RSP: 0018:ffffc900047e7908 EFLAGS: 00010006
RAX: 00000000000000b7 RBX: ffffc90004967850 RCX: b2274a7c9abc3500
RDX: 00000000ffff8880 RSI: 0000000080000001 RDI: 0000000000000000
RBP: ffffc900047e79f0 R08: ffffc900047e7607 R09: 1ffff920008fcec0
R10: dffffc0000000000 R11: fffff520008fcec1 R12: dffffc0000000000
R13: 0000000000000003 R14: 0000000000000001 R15: 00000000000005b9
FS:  0000000000000000(0000) GS:ffff8880b8f00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fcfd7df7a10 CR3: 000000005cee5000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	e8 03 42 0f b6       	call   0xb60f4208
   5:	04 20                	add    $0x20,%al
   7:	84 c0                	test   %al,%al
   9:	0f 85 a8 00 00 00    	jne    0xb7
   f:	41 8b 17             	mov    (%r15),%edx
  12:	49 8d 46 ff          	lea    -0x1(%r14),%rax
  16:	48 83 f8 fd          	cmp    $0xfffffffffffffffd,%rax
  1a:	77 27                	ja     0x43
  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 be 00 00 00    	jne    0xf5
  37:	49 81 c6 b0 08 00 00 	add    $0x8b0,%r14
  3e:	45                   	rex.RB
  3f:	8b                   	.byte 0x8b

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/06/24 14:48 linux-6.1.y fdb6fcb41cc7 302586aa .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 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
2026/05/16 19:09 linux-6.1.y c27210688955 a15a64a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 BUG: spinlock bad magic in btrfs_encoded_read_endio
2026/05/06 13:23 linux-6.1.y 4931e0e1673d 1dddfd3d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 BUG: spinlock bad magic in btrfs_encoded_read_endio
* Struck through repros no longer work on HEAD.