syzbot


general protection fault in __copy_super

Status: upstream: reported C repro on 2024/09/21 10:53
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+18a5c5e8a9c856944876@syzkaller.appspotmail.com
First crash: 11d, last: 4d19h
Cause bisection: introduced by (bisect log) :
commit 03ef80b469d5d83530ce1ce15be78a40e5300f9b
Author: Kent Overstreet <kent.overstreet@linux.dev>
Date: Sat Sep 23 22:41:51 2023 +0000

  bcachefs: Ignore unknown mount options

Crash: BUG: unable to handle kernel NULL pointer dereference in bch2_sb_field_get (log)
Repro: C syz .config
  
Discussions (2)
Title Replies (including bot) Last reply
[syzbot] [bcachefs?] general protection fault in __copy_super 0 (3) 2024/09/24 06:55
[PATCH] bcachefs: assign return error when iterating through layout 2 (2) 2024/09/23 22:49
Last patch testing requests (1)
Created Duration User Patch Repo Result
2024/09/23 21:06 20m djahchankoike@gmail.com patch upstream OK log

Sample crash report:
loop0: detected capacity change from 0 to 32768
bcachefs (/dev/loop0): error reading default superblock: checksum error, type crc32c_nonzero: got 151109cf should be 29d2fb78
bcachefs (/dev/loop0): error reading superblock: checksum error, type crc32c_nonzero: got 151109cf should be 29d2fb78
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000002: 0000 [#1] PREEMPT SMP KASAN PTI
KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017]
CPU: 1 UID: 0 PID: 5217 Comm: syz-executor255 Not tainted 6.11.0-syzkaller-08836-gf8eb5bd9a818 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
RIP: 0010:__copy_super+0x59/0xe70 fs/bcachefs/super-io.c:552
Code: 44 24 10 80 3c 18 00 74 12 4c 89 f7 e8 30 81 b4 fd 48 ba 00 00 00 00 00 fc ff df 4d 8b 3e 49 8d 5c 24 10 48 89 d8 48 c1 e8 03 <0f> b6 04 10 84 c0 0f 85 2e 0c 00 00 0f b7 2b 49 8d 5f 10 48 89 d8
RSP: 0018:ffffc9000361f2f0 EFLAGS: 00010202
RAX: 0000000000000002 RBX: 0000000000000010 RCX: ffff88801e7b1e00
RDX: dffffc0000000000 RSI: 0000000000000000 RDI: ffff88807b6807d8
RBP: 0000000000000000 R08: ffffffff8446c205 R09: 00000000ffffffff
R10: dffffc0000000000 R11: fffffbfff2844b12 R12: 0000000000000000
R13: ffff88807b680000 R14: ffff88807b6807d8 R15: ffff88802e68b000
FS:  000055558f7c9380(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fff0adf7000 CR3: 000000007a08e000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 bch2_sb_to_fs+0xab/0x150 fs/bcachefs/super-io.c:610
 bch2_fs_alloc+0xd5c/0x20b0 fs/bcachefs/super.c:828
 bch2_fs_open+0x8cc/0xdf0 fs/bcachefs/super.c:2115
 bch2_fs_get_tree+0x731/0x1700 fs/bcachefs/fs.c:1943
 vfs_get_tree+0x90/0x2b0 fs/super.c:1800
 do_new_mount+0x2be/0xb40 fs/namespace.c:3507
 do_mount fs/namespace.c:3847 [inline]
 __do_sys_mount fs/namespace.c:4055 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:4032
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f65327a206a
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 5e 04 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 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:00007fff0adf6798 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fff0adf67b0 RCX: 00007f65327a206a
RDX: 0000000020000240 RSI: 0000000020005dc0 RDI: 00007fff0adf67b0
RBP: 0000000000000004 R08: 00007fff0adf67f0 R09: 0000000000005da0
R10: 0000000001000000 R11: 0000000000000282 R12: 0000000001000000
R13: 00007fff0adf67f0 R14: 0000000000000003 R15: 0000000001000000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__copy_super+0x59/0xe70 fs/bcachefs/super-io.c:552
Code: 44 24 10 80 3c 18 00 74 12 4c 89 f7 e8 30 81 b4 fd 48 ba 00 00 00 00 00 fc ff df 4d 8b 3e 49 8d 5c 24 10 48 89 d8 48 c1 e8 03 <0f> b6 04 10 84 c0 0f 85 2e 0c 00 00 0f b7 2b 49 8d 5f 10 48 89 d8
RSP: 0018:ffffc9000361f2f0 EFLAGS: 00010202
RAX: 0000000000000002 RBX: 0000000000000010 RCX: ffff88801e7b1e00
RDX: dffffc0000000000 RSI: 0000000000000000 RDI: ffff88807b6807d8
RBP: 0000000000000000 R08: ffffffff8446c205 R09: 00000000ffffffff
R10: dffffc0000000000 R11: fffffbfff2844b12 R12: 0000000000000000
R13: ffff88807b680000 R14: ffff88807b6807d8 R15: ffff88802e68b000
FS:  000055558f7c9380(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055bc1fed2068 CR3: 000000007a08e000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	44 24 10             	rex.R and $0x10,%al
   3:	80 3c 18 00          	cmpb   $0x0,(%rax,%rbx,1)
   7:	74 12                	je     0x1b
   9:	4c 89 f7             	mov    %r14,%rdi
   c:	e8 30 81 b4 fd       	call   0xfdb48141
  11:	48 ba 00 00 00 00 00 	movabs $0xdffffc0000000000,%rdx
  18:	fc ff df
  1b:	4d 8b 3e             	mov    (%r14),%r15
  1e:	49 8d 5c 24 10       	lea    0x10(%r12),%rbx
  23:	48 89 d8             	mov    %rbx,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	0f b6 04 10          	movzbl (%rax,%rdx,1),%eax <-- trapping instruction
  2e:	84 c0                	test   %al,%al
  30:	0f 85 2e 0c 00 00    	jne    0xc64
  36:	0f b7 2b             	movzwl (%rbx),%ebp
  39:	49 8d 5f 10          	lea    0x10(%r15),%rbx
  3d:	48 89 d8             	mov    %rbx,%rax

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/09/23 19:52 upstream f8eb5bd9a818 89298aad .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs general protection fault in __copy_super
2024/09/17 12:04 upstream a430d95c5efa c673ca06 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root general protection fault in __copy_super
2024/09/17 11:38 upstream a430d95c5efa c673ca06 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root general protection fault in __copy_super
2024/09/17 11:08 upstream a430d95c5efa c673ca06 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root general protection fault in __copy_super
2024/09/17 10:41 upstream a430d95c5efa c673ca06 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in __copy_super
* Struck through repros no longer work on HEAD.