syzbot


general protection fault in btrfs_reada_add

Status: upstream: reported C repro on 2025/06/06 02:46
Bug presence: origin:lts-only
[Documentation on labels]
Reported-by: syzbot+fa450181c7b753202981@syzkaller.appspotmail.com
First crash: 152d, last: 5d13h
Fix commit to backport (bisect log) :
tree: upstream
commit f95d186255b319c48a365d47b69bd997fecb674e
Author: Qu Wenruo <wqu@suse.com>
Date: Tue Apr 29 05:47:50 2025 +0000

  btrfs: avoid NULL pointer dereference if no valid csum tree

  
Fix bisection: the issue occurs on the latest tested release (bisect log)
Crash: BUG: unable to handle kernel NULL pointer dereference in btrfs_reada_add (log)
Repro: C syz .config
  
Bug presence (2)
Date Name Commit Repro Result
2025/06/06 linux-5.15.y (ToT) 1c700860e8bc C [report] general protection fault in btrfs_reada_add
2025/06/06 upstream (ToT) e271ed52b344 C Didn't crash
Last patch testing requests (1)
Created Duration User Patch Repo Result
2025/10/10 06:19 1h01m retest repro linux-5.15.y report log
Fix bisection attempts (4)
Created Duration User Patch Repo Result
2025/10/10 14:55 7h38m fix candidate upstream OK (1) job log
2025/09/14 01:43 2h11m bisect fix linux-5.15.y OK (0) job log log
2025/08/05 22:25 3h29m bisect fix linux-5.15.y OK (0) job log log
2025/07/06 16:09 1h30m bisect fix linux-5.15.y OK (0) job log log

Sample crash report:
BTRFS info (device loop0): using spread ssd allocation scheme
BTRFS info (device loop0): ignoring data csums
BTRFS info (device loop0): using free space tree
BTRFS info (device loop0): has skinny extents
BTRFS info (device loop0): scrub: started on devid 1
general protection fault, probably for non-canonical address 0xdffffc000000003e: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x00000000000001f0-0x00000000000001f7]
CPU: 0 PID: 4334 Comm: syz.0.17 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
RIP: 0010:btrfs_reada_add+0x81/0x520 fs/btrfs/reada.c:974
Code: 67 fe 48 85 c0 0f 84 9b 02 00 00 49 89 c4 49 8d af f0 01 00 00 48 89 e9 48 c1 e9 03 48 b8 00 00 00 00 00 fc ff df 48 89 0c 24 <80> 3c 01 00 74 08 48 89 ef e8 f1 68 68 fe 4c 89 e3 48 89 6c 24 08
RSP: 0018:ffffc90002fff330 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: dffffc0000000000 RCX: 000000000000003e
RDX: dffffc0000000000 RSI: ffffffff8a0b1820 RDI: 0000000000000000
RBP: 00000000000001f0 R08: dffffc0000000000 R09: fffffbfff18e67a9
R10: fffffbfff18e67a9 R11: 1ffffffff18e67a8 R12: ffff888142d8f000
R13: ffffc90002fff730 R14: ffffc90002fff770 R15: 0000000000000000
FS:  000055556957c500(0000) GS:ffff8880b9000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b30763fff CR3: 000000007a01b000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 scrub_stripe+0xb25/0x37b0 fs/btrfs/scrub.c:3281
 scrub_chunk+0x2b7/0x3b0 fs/btrfs/scrub.c:3618
 scrub_enumerate_chunks+0xc8e/0x1910 fs/btrfs/scrub.c:3865
 btrfs_scrub_dev+0x7cf/0x1100 fs/btrfs/scrub.c:4225
 btrfs_ioctl_scrub+0x1b2/0x280 fs/btrfs/ioctl.c:3751
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f98f5bfdc29
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff73555e58 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f98f5e44fa0 RCX: 00007f98f5bfdc29
RDX: 0000200000000000 RSI: 00000000c400941b RDI: 0000000000000004
RBP: 00007f98f5c80e41 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f98f5e44fa0 R14: 00007f98f5e44fa0 R15: 0000000000000003
 </TASK>
Modules linked in:
---[ end trace 0d15ab3f25e34c87 ]---
RIP: 0010:btrfs_reada_add+0x81/0x520 fs/btrfs/reada.c:974
Code: 67 fe 48 85 c0 0f 84 9b 02 00 00 49 89 c4 49 8d af f0 01 00 00 48 89 e9 48 c1 e9 03 48 b8 00 00 00 00 00 fc ff df 48 89 0c 24 <80> 3c 01 00 74 08 48 89 ef e8 f1 68 68 fe 4c 89 e3 48 89 6c 24 08
RSP: 0018:ffffc90002fff330 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: dffffc0000000000 RCX: 000000000000003e
RDX: dffffc0000000000 RSI: ffffffff8a0b1820 RDI: 0000000000000000
RBP: 00000000000001f0 R08: dffffc0000000000 R09: fffffbfff18e67a9
R10: fffffbfff18e67a9 R11: 1ffffffff18e67a8 R12: ffff888142d8f000
R13: ffffc90002fff730 R14: ffffc90002fff770 R15: 0000000000000000
FS:  000055556957c500(0000) GS:ffff8880b9100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000558c84c96698 CR3: 000000007a01b000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 2 bytes skipped:
   0:	48 85 c0             	test   %rax,%rax
   3:	0f 84 9b 02 00 00    	je     0x2a4
   9:	49 89 c4             	mov    %rax,%r12
   c:	49 8d af f0 01 00 00 	lea    0x1f0(%r15),%rbp
  13:	48 89 e9             	mov    %rbp,%rcx
  16:	48 c1 e9 03          	shr    $0x3,%rcx
  1a:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  21:	fc ff df
  24:	48 89 0c 24          	mov    %rcx,(%rsp)
* 28:	80 3c 01 00          	cmpb   $0x0,(%rcx,%rax,1) <-- trapping instruction
  2c:	74 08                	je     0x36
  2e:	48 89 ef             	mov    %rbp,%rdi
  31:	e8 f1 68 68 fe       	call   0xfe686927
  36:	4c 89 e3             	mov    %r12,%rbx
  39:	48 89 6c 24 08       	mov    %rbp,0x8(%rsp)

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/20 18:10 linux-5.15.y 43bb85222e53 67c37560 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (clean fs)] ci2-linux-5-15-kasan general protection fault in btrfs_reada_add
2025/06/06 03:15 linux-5.15.y 1c700860e8bc 6b6b5f21 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (clean fs)] ci2-linux-5-15-kasan general protection fault in btrfs_reada_add
2025/10/31 04:32 linux-5.15.y cc5ec8769306 2c50b6a9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan general protection fault in btrfs_reada_add
2025/09/26 03:24 linux-5.15.y 43bb85222e53 0abd0691 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan general protection fault in btrfs_reada_add
2025/09/20 17:38 linux-5.15.y 43bb85222e53 67c37560 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan general protection fault in btrfs_reada_add
2025/06/06 02:50 linux-5.15.y 1c700860e8bc 6b6b5f21 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan general protection fault in btrfs_reada_add
2025/06/06 02:45 linux-5.15.y 1c700860e8bc 6b6b5f21 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan general protection fault in btrfs_reada_add
* Struck through repros no longer work on HEAD.