syzbot


UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key

Status: upstream: reported C repro on 2025/05/28 13:15
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+cfd994b9cdf00446fd54@syzkaller.appspotmail.com
First crash: 13d, last: 18h46m
Cause bisection: introduced by (bisect log) :
commit cd3cdb1ef706a1ac725194d81858d58375739b25
Author: Kent Overstreet <kent.overstreet@linux.dev>
Date: Tue Apr 22 13:14:19 2025 +0000

  bcachefs: Single err message for btree node reads

Crash: UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key (log)
Repro: C syz .config
  
Discussions (2)
Title Replies (including bot) Last reply
Re: [syzbot] [bcachefs?] UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key 1 (1) 2025/06/01 15:37
[syzbot] [bcachefs?] UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key 0 (1) 2025/05/28 13:15

Sample crash report:
bcachefs (loop0): sb invalid before write: Unsupported superblock version_min 0.0: (unknown version) (min 0.9: (unknown version), max 1.28: inode_has_case_insensitive)
  emergency read only at seq 10
------------[ cut here ]------------
UBSAN: shift-out-of-bounds in fs/bcachefs/bkey.c:163:16
shift exponent 4294967127 is too large for 64-bit type 'u64' (aka 'unsigned long long')
CPU: 0 UID: 0 PID: 5832 Comm: read_btree_node Not tainted 6.15.0-syzkaller-01958-g785cdec46e92 #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
 ubsan_epilogue+0xa/0x40 lib/ubsan.c:231
 __ubsan_handle_shift_out_of_bounds+0x386/0x410 lib/ubsan.c:492
 get_inc_field fs/bcachefs/bkey.c:163 [inline]
 __bch2_bkey_unpack_key+0xdc4/0xe10 fs/bcachefs/bkey.c:284
 __bch2_bkey_compat+0x4db/0xbd0 fs/bcachefs/bkey_methods.c:480
 bch2_bkey_compat fs/bcachefs/bkey_methods.h:134 [inline]
 validate_bset_keys+0x6c1/0x1390 fs/bcachefs/btree_io.c:983
 bch2_btree_node_read_done+0x18c8/0x4f60 fs/bcachefs/btree_io.c:1211
 btree_node_read_work+0x426/0xe30 fs/bcachefs/btree_io.c:1400
 bch2_btree_node_read+0x887/0x29f0 fs/bcachefs/btree_io.c:-1
 bch2_btree_node_fill+0xd12/0x14f0 fs/bcachefs/btree_cache.c:994
 bch2_btree_node_get_noiter+0xa2c/0x1000 fs/bcachefs/btree_cache.c:1261
 found_btree_node_is_readable fs/bcachefs/btree_node_scan.c:85 [inline]
 try_read_btree_node fs/bcachefs/btree_node_scan.c:220 [inline]
 read_btree_nodes_worker+0x1319/0x1e20 fs/bcachefs/btree_node_scan.c:269
 kthread+0x711/0x8a0 kernel/kthread.c:464
 ret_from_fork+0x4e/0x80 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>
---[ end trace ]---

Crashes (43):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/27 10:36 upstream 785cdec46e92 874a1386 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/05/27 06:05 upstream ddddf9d64f73 874a1386 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/05/27 05:13 upstream ddddf9d64f73 874a1386 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/05/27 04:26 upstream ddddf9d64f73 874a1386 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/03 19:43 upstream 546b1c9e93c2 a30356b7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/02 16:52 upstream cd2e103d57e5 b396b4bf .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/08 16:17 upstream 8630c59e9936 4826c28e .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/08 14:12 upstream 8630c59e9936 4826c28e .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/08 07:51 upstream 8630c59e9936 4826c28e .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/07 23:02 upstream bdc7f8c5adad 4826c28e .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/07 18:12 upstream bdc7f8c5adad 4826c28e .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/07 03:06 upstream c0c9379f235d 4826c28e .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/07 02:47 upstream c0c9379f235d 4826c28e .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/06 16:12 upstream e271ed52b344 3d899f2c .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/06 15:35 upstream e271ed52b344 3d899f2c .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/06 14:09 upstream e271ed52b344 3d899f2c .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/06 07:10 upstream e271ed52b344 6b6b5f21 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/05 18:06 upstream ec7714e49479 6b6b5f21 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/04 23:07 upstream 1af80d00e1e0 6b6b5f21 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/04 08:28 upstream 5abc7438f1e9 a30356b7 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/04 05:27 upstream 5abc7438f1e9 a30356b7 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/03 21:42 upstream 546b1c9e93c2 a30356b7 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/03 16:57 upstream 546b1c9e93c2 a30356b7 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/03 00:54 upstream 7f9039c524a3 a30356b7 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/02 18:59 upstream cd2e103d57e5 aaaaf5ea .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/02 12:42 upstream cd2e103d57e5 aaaaf5ea .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/05/31 22:38 upstream 0f70f5b08a47 3d2f584d .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/05/31 21:20 upstream 0f70f5b08a47 3d2f584d .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/05/31 14:11 upstream 0f70f5b08a47 3d2f584d .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/05/31 05:43 upstream 8477ab143069 3d2f584d .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/05/31 01:16 upstream 8477ab143069 3d2f584d .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/05/30 11:36 upstream f66bc387efbe 3d2f584d .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/05/30 07:46 upstream e0797d3b91de 3d2f584d .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/05/29 14:48 upstream 90b83efa6701 3d2f584d .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/05/29 14:18 upstream 90b83efa6701 3d2f584d .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/05/29 13:23 upstream 90b83efa6701 3d2f584d .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/05/29 04:18 upstream feacb1774bd5 3d2f584d .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/05/28 14:12 upstream c89756bcf406 874a1386 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/05/28 07:07 upstream c89756bcf406 874a1386 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/05/27 17:19 upstream 914873bc7df9 874a1386 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/05/27 03:39 upstream ddddf9d64f73 874a1386 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
2025/06/02 10:16 linux-next 3a83b350b5be 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root UBSAN: shift-out-of-bounds in __bch2_bkey_unpack_key
* Struck through repros no longer work on HEAD.