syzbot


general protection fault in bio_seg_gap

Status: upstream: reported C repro on 2025/11/14 05:24
Subsystems: block
[Documentation on labels]
Reported-by: syzbot+8df17e797225d69050d4@syzkaller.appspotmail.com
Fix commit: fd9ecd005252 block: fix merging data-less bios
Patched on: [ci-qemu-gce-upstream-auto ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-snapshot-upstream-root ci-upstream-bpf-next-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 ci-upstream-linux-next-kasan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci-upstream-rust-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb], missing on: [ci-qemu-native-arm64-kvm ci-qemu2-riscv64 ci-upstream-bpf-kasan-gce ci-upstream-gce-arm64]
First crash: 50d, last: 48d
Cause bisection: introduced by (bisect log) :
commit 2f6b2565d43cdb5087cac23d530cca84aa3d897e
Author: Keith Busch <kbusch@kernel.org>
Date: Tue Oct 14 15:04:55 2025 +0000

  block: accumulate memory segment gaps per bio

Crash: BUG: unable to handle kernel NULL pointer dereference in bio_seg_gap (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [block?] general protection fault in bio_seg_gap 1 (2) 2025/11/14 18:01

Sample crash report:
=======================================================
WARNING: The mand mount option has been deprecated and
         and is ignored by this kernel. Remove the mand
         option from the mount to silence this warning.
=======================================================
EXT4-fs: Ignoring removed i_version option
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] SMP KASAN PTI
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 UID: 0 PID: 6018 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
RIP: 0010:bio_get_first_bvec block/blk-merge.c:22 [inline]
RIP: 0010:bio_get_last_bvec block/blk-merge.c:30 [inline]
RIP: 0010:bio_seg_gap+0x1c6/0x7d0 block/blk-merge.c:743
Code: fd 48 ba 00 00 00 00 00 fc ff df 49 8b 06 48 89 5c 24 20 49 89 de 49 c1 e6 04 48 89 44 24 08 4a 8d 2c 30 48 89 e8 48 c1 e8 03 <80> 3c 10 00 74 12 48 89 ef e8 0c 33 b9 fd 48 ba 00 00 00 00 00 fc
RSP: 0018:ffffc90003036a60 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff8880788e5b80
RDX: dffffc0000000000 RSI: 0000000000000000 RDI: ffff8880786a1030
RBP: 0000000000000000 R08: ffff888141f6d877 R09: 1ffff110283edb0e
R10: dffffc0000000000 R11: ffffed10283edb0f R12: 0000000000000400
R13: 0000000000000000 R14: 0000000000000000 R15: ffff8880786a1000
FS:  0000555589f40500(0000) GS:ffff888125ecd000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fe080ddae9c CR3: 00000000745c6000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 bio_attempt_back_merge+0x4ba/0x920 block/blk-merge.c:940
 blk_attempt_plug_merge+0x145/0x1d0 block/blk-merge.c:1073
 blk_mq_attempt_bio_merge block/blk-mq.c:3022 [inline]
 blk_mq_submit_bio+0x1abd/0x26d0 block/blk-mq.c:3186
 __submit_bio+0x207/0x5a0 block/blk-core.c:637
 __submit_bio_noacct_mq block/blk-core.c:724 [inline]
 submit_bio_noacct_nocheck+0x2fb/0xa50 block/blk-core.c:755
 submit_bio_wait+0x104/0x200 block/bio.c:1389
 blkdev_issue_discard+0x113/0x1b0 block/blk-lib.c:95
 ext4_mb_clear_bb fs/ext4/mballoc.c:6620 [inline]
 ext4_free_blocks+0xce2/0x1bf0 fs/ext4/mballoc.c:6770
 ext4_clear_blocks+0x372/0x3f0 fs/ext4/indirect.c:888
 ext4_free_data fs/ext4/indirect.c:962 [inline]
 ext4_ind_truncate+0x701/0xb30 fs/ext4/indirect.c:1154
 ext4_truncate+0xb24/0x12e0 fs/ext4/inode.c:4620
 ext4_evict_inode+0x86e/0xe80 fs/ext4/inode.c:260
 evict+0x5f4/0xae0 fs/inode.c:837
 ext4_orphan_cleanup+0xc20/0x1460 fs/ext4/orphan.c:470
 __ext4_fill_super fs/ext4/super.c:5618 [inline]
 ext4_fill_super+0x5920/0x61e0 fs/ext4/super.c:5737
 get_tree_bdev_flags+0x40e/0x4d0 fs/super.c:1697
 vfs_get_tree+0x92/0x2b0 fs/super.c:1757
 fc_mount fs/namespace.c:1198 [inline]
 do_new_mount_fc fs/namespace.c:3641 [inline]
 do_new_mount+0x302/0xa10 fs/namespace.c:3717
 do_mount fs/namespace.c:4040 [inline]
 __do_sys_mount fs/namespace.c:4228 [inline]
 __se_sys_mount+0x313/0x410 fs/namespace.c:4205
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f74a6990e6a
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd3db28e18 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffd3db28ea0 RCX: 00007f74a6990e6a
RDX: 0000200000000ac0 RSI: 0000200000000240 RDI: 00007ffd3db28e60
RBP: 0000200000000ac0 R08: 00007ffd3db28ea0 R09: 0000000003810744
R10: 0000000003810744 R11: 0000000000000246 R12: 0000200000000240
R13: 00007ffd3db28e60 R14: 0000000000000453 R15: 000000000000002c
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:bio_get_first_bvec block/blk-merge.c:22 [inline]
RIP: 0010:bio_get_last_bvec block/blk-merge.c:30 [inline]
RIP: 0010:bio_seg_gap+0x1c6/0x7d0 block/blk-merge.c:743
Code: fd 48 ba 00 00 00 00 00 fc ff df 49 8b 06 48 89 5c 24 20 49 89 de 49 c1 e6 04 48 89 44 24 08 4a 8d 2c 30 48 89 e8 48 c1 e8 03 <80> 3c 10 00 74 12 48 89 ef e8 0c 33 b9 fd 48 ba 00 00 00 00 00 fc
RSP: 0018:ffffc90003036a60 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff8880788e5b80
RDX: dffffc0000000000 RSI: 0000000000000000 RDI: ffff8880786a1030
RBP: 0000000000000000 R08: ffff888141f6d877 R09: 1ffff110283edb0e
R10: dffffc0000000000 R11: ffffed10283edb0f R12: 0000000000000400
R13: 0000000000000000 R14: 0000000000000000 R15: ffff8880786a1000
FS:  0000555589f40500(0000) GS:ffff888125ecd000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fe080ddae9c CR3: 00000000745c6000 CR4: 00000000003526f0
----------------
Code disassembly (best guess):
   0:	fd                   	std
   1:	48 ba 00 00 00 00 00 	movabs $0xdffffc0000000000,%rdx
   8:	fc ff df
   b:	49 8b 06             	mov    (%r14),%rax
   e:	48 89 5c 24 20       	mov    %rbx,0x20(%rsp)
  13:	49 89 de             	mov    %rbx,%r14
  16:	49 c1 e6 04          	shl    $0x4,%r14
  1a:	48 89 44 24 08       	mov    %rax,0x8(%rsp)
  1f:	4a 8d 2c 30          	lea    (%rax,%r14,1),%rbp
  23:	48 89 e8             	mov    %rbp,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	80 3c 10 00          	cmpb   $0x0,(%rax,%rdx,1) <-- trapping instruction
  2e:	74 12                	je     0x42
  30:	48 89 ef             	mov    %rbp,%rdi
  33:	e8 0c 33 b9 fd       	call   0xfdb93344
  38:	48                   	rex.W
  39:	ba 00 00 00 00       	mov    $0x0,%edx
  3e:	00 fc                	add    %bh,%ah

Crashes (231):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/11/10 20:57 linux-next ab40c92c74c6 4e1406b4 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/12 02:25 linux-next 2666975a8905 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/12 00:23 linux-next 2666975a8905 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/11 22:35 linux-next 2666975a8905 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/11 22:35 linux-next 2666975a8905 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/11 20:43 linux-next 2666975a8905 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/11 19:39 linux-next 2666975a8905 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/11 19:08 linux-next 2666975a8905 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/11 17:35 linux-next 2666975a8905 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/11 17:17 linux-next 2666975a8905 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/11 16:17 linux-next 2666975a8905 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/11 14:48 linux-next 2666975a8905 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/11 13:48 linux-next 2666975a8905 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/11 10:30 linux-next 2666975a8905 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/11 03:28 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/11 03:16 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 23:29 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 20:36 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 19:15 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 17:18 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 17:18 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 15:45 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 15:04 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 14:17 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 12:51 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 12:01 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 10:54 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 10:54 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 10:54 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 10:54 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 10:47 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 10:46 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 10:46 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 10:46 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 10:45 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 10:45 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 10:44 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 10:44 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 10:02 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 10:02 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 10:01 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 10:01 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 10:01 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 10:00 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
2025/11/10 10:00 linux-next ab40c92c74c6 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bio_seg_gap
* Struck through repros no longer work on HEAD.