syzbot


general protection fault in relocate_file_extent_cluster

Status: upstream: reported C repro on 2025/04/05 15:40
Subsystems: btrfs
[Documentation on labels]
Reported-by: syzbot+7481815bb47ef3e702e2@syzkaller.appspotmail.com
Fix commit: 50fecb8cf069 btrfs: fix invalid inode pointer after failure to create reloc inode
Patched on: [ci-qemu-gce-upstream-auto ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-snapshot-upstream-root ci-upstream-bpf-kasan-gce ci-upstream-gce-leak ci-upstream-kasan-badwrites-root ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce-386-root ci-upstream-kmsan-gce-root ci2-upstream-fs ci2-upstream-kcsan-gce], missing on: [ci-qemu-native-arm64-kvm ci-qemu2-arm32 ci-qemu2-riscv64 ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-linux-next-kasan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-usb]
First crash: 22d, last: 2d01h
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [btrfs?] general protection fault in relocate_file_extent_cluster 0 (1) 2025/04/05 15:40

Sample crash report:
R10: 0000000000000002 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 431bde82d7b634db R15: 00007fffbc57b3e0
 </TASK>
BTRFS info (device loop0): relocating block group 6881280 flags data|metadata
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000045: 0000 [#1] SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x0000000000000228-0x000000000000022f]
CPU: 0 UID: 0 PID: 5309 Comm: syz-executor272 Not tainted 6.15.0-rc2-syzkaller-00042-g1a1d569a75f3 #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
RIP: 0010:relocate_file_extent_cluster+0xe7/0x1750 fs/btrfs/relocation.c:2971
Code: 00 74 08 48 89 df e8 28 2e 24 fe 48 89 9c 24 30 01 00 00 4c 89 74 24 28 4d 8b 76 10 49 8d 9e 98 fe ff ff 48 89 d8 48 c1 e8 03 <42> 80 3c 20 00 74 08 48 89 df e8 fa 2d 24 fe 4c 8b 3b 48 8b 44 24
RSP: 0018:ffffc900019af5e0 EFLAGS: 00010203
RAX: 0000000000000045 RBX: 000000000000022c RCX: ffff88801e552440
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88803ad66000
RBP: ffffc900019af870 R08: ffffffff8408a8e1 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: dffffc0000000000
R13: ffffffff9368d020 R14: 0000000000000394 R15: ffff88803ad66000
FS:  0000555559da4380(0000) GS:ffff88808c593000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000559b8ec4dd10 CR3: 0000000043ae0000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 relocate_block_group+0xa1e/0xd50 fs/btrfs/relocation.c:3657
 btrfs_relocate_block_group+0x777/0xd80 fs/btrfs/relocation.c:4011
 btrfs_relocate_chunk+0x12c/0x3b0 fs/btrfs/volumes.c:3511
 __btrfs_balance+0x1a93/0x25e0 fs/btrfs/volumes.c:4292
 btrfs_balance+0xbde/0x10c0 fs/btrfs/volumes.c:4669
 btrfs_ioctl_balance+0x3f5/0x660 fs/btrfs/ioctl.c:3586
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:906 [inline]
 __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:892
 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:0x7f3b4b0cedd9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 01 1b 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fffbc57b378 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fffbc57b3a0 RCX: 00007f3b4b0cedd9
RDX: 0000200000000440 RSI: 00000000c4009420 RDI: 0000000000000003
RBP: 0000000000000002 R08: 00007fffbc57b116 R09: 00007fffbc57b3c0
R10: 0000000000000002 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 431bde82d7b634db R15: 00007fffbc57b3e0
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:relocate_file_extent_cluster+0xe7/0x1750 fs/btrfs/relocation.c:2971
Code: 00 74 08 48 89 df e8 28 2e 24 fe 48 89 9c 24 30 01 00 00 4c 89 74 24 28 4d 8b 76 10 49 8d 9e 98 fe ff ff 48 89 d8 48 c1 e8 03 <42> 80 3c 20 00 74 08 48 89 df e8 fa 2d 24 fe 4c 8b 3b 48 8b 44 24
RSP: 0018:ffffc900019af5e0 EFLAGS: 00010203
RAX: 0000000000000045 RBX: 000000000000022c RCX: ffff88801e552440
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88803ad66000
RBP: ffffc900019af870 R08: ffffffff8408a8e1 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: dffffc0000000000
R13: ffffffff9368d020 R14: 0000000000000394 R15: ffff88803ad66000
FS:  0000555559da4380(0000) GS:ffff88808c593000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000559b8ec4dd10 CR3: 0000000043ae0000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	00 74 08 48          	add    %dh,0x48(%rax,%rcx,1)
   4:	89 df                	mov    %ebx,%edi
   6:	e8 28 2e 24 fe       	call   0xfe242e33
   b:	48 89 9c 24 30 01 00 	mov    %rbx,0x130(%rsp)
  12:	00
  13:	4c 89 74 24 28       	mov    %r14,0x28(%rsp)
  18:	4d 8b 76 10          	mov    0x10(%r14),%r14
  1c:	49 8d 9e 98 fe ff ff 	lea    -0x168(%r14),%rbx
  23:	48 89 d8             	mov    %rbx,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 80 3c 20 00       	cmpb   $0x0,(%rax,%r12,1) <-- trapping instruction
  2f:	74 08                	je     0x39
  31:	48 89 df             	mov    %rbx,%rdi
  34:	e8 fa 2d 24 fe       	call   0xfe242e33
  39:	4c 8b 3b             	mov    (%rbx),%r15
  3c:	48                   	rex.W
  3d:	8b                   	.byte 0x8b
  3e:	44                   	rex.R
  3f:	24                   	.byte 0x24

Crashes (24):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/04/15 20:23 upstream 1a1d569a75f3 85125322 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro (clean fs)] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/15 11:46 upstream 834a4a689699 85125322 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro (clean fs)] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/09 05:10 upstream bec7dcbc242c b133e63a .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro (clean fs)] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/05 10:41 upstream a8662bcd2ff1 1c65791e .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro (clean fs)] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/22 06:05 upstream a33b5a08cbbd 2a20f901 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/21 08:13 upstream 9d7a0577c9db 2a20f901 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/18 12:44 upstream fc96b232f8e7 2a20f901 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/18 12:36 upstream fc96b232f8e7 2a20f901 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/17 11:16 upstream cfb2e2c57aef 552876f8 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/16 03:48 upstream 1a1d569a75f3 a95239b1 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/15 11:08 upstream 834a4a689699 85125322 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/14 15:26 upstream 8ffd015db85f 0bd6db41 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/14 15:26 upstream 8ffd015db85f 0bd6db41 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/13 07:14 upstream 7cdabafc0012 0bd6db41 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/13 05:30 upstream 7cdabafc0012 0bd6db41 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/12 16:44 upstream 3bde70a2c827 0bd6db41 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/12 16:43 upstream 3bde70a2c827 0bd6db41 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/11 01:39 upstream 0c7cae12f67c 94486846 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/10 22:06 upstream 2eb959eeecc6 1ef3ab4d .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/09 00:59 upstream bec7dcbc242c b133e63a .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/08 23:43 upstream bec7dcbc242c b133e63a .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/05 23:44 upstream 56f944529ec2 1c65791e .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/05 10:18 upstream a8662bcd2ff1 1c65791e .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
2025/04/01 15:36 upstream 08733088b566 b8645499 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in relocate_file_extent_cluster
* Struck through repros no longer work on HEAD.