syzbot


UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid

Status: fixed on 2024/06/05 13:52
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+9833a1d29d4a44361e2c@syzkaller.appspotmail.com
Fix commit: 61692c7812ab bcachefs: bch2_bkey_format_field_overflows()
First crash: 267d, last: 239d
Discussions (3)
Title Replies (including bot) Last reply
[PATCH] bcachefs: guard against invalid bits_per_field in bch2_bkey_format_invalid 2 (2) 2024/05/09 19:32
Re: [syzbot] [PATCH] bcachefs: guard against invalid bits_per_field in bch2_bkey_format_invalid 0 (1) 2024/05/09 00:22
[syzbot] [bcachefs?] UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid 0 (1) 2024/05/08 08:11
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid (2) bcachefs C 117 167d 231d 27/28 fixed on 2024/08/14 03:44
Last patch testing requests (1)
Created Duration User Patch Repo Result
2024/05/09 00:22 21m cam.alvarez.i@gmail.com patch linux-next OK log

Sample crash report:
loop0: detected capacity change from 0 to 32768
bcachefs (loop0): mounting version 1.7: mi_btree_bitmap opts=compression=lz4,nojournal_transaction_names
bcachefs (loop0): recovering from clean shutdown, journal seq 7
------------[ cut here ]------------
UBSAN: shift-out-of-bounds in fs/bcachefs/bkey.c:663:22
shift exponent 254 is too large for 64-bit type 'unsigned long long'
CPU: 1 PID: 5092 Comm: syz-executor406 Not tainted 6.9.0-rc6-next-20240503-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
 ubsan_epilogue lib/ubsan.c:231 [inline]
 __ubsan_handle_shift_out_of_bounds+0x3c8/0x420 lib/ubsan.c:468
 bch2_bkey_format_invalid+0x46c/0x5c0 fs/bcachefs/bkey.c:663
 validate_bset+0x168d/0x25a0 fs/bcachefs/btree_io.c:824
 bch2_btree_node_read_done+0x20d2/0x5ed0 fs/bcachefs/btree_io.c:1142
 btree_node_read_work+0x665/0x1300 fs/bcachefs/btree_io.c:1345
 bch2_btree_node_read+0x2637/0x2c80 fs/bcachefs/btree_io.c:1730
 __bch2_btree_root_read fs/bcachefs/btree_io.c:1769 [inline]
 bch2_btree_root_read+0x61e/0x970 fs/bcachefs/btree_io.c:1793
 read_btree_roots+0x22d/0x7b0 fs/bcachefs/recovery.c:472
 bch2_fs_recovery+0x2334/0x36e0 fs/bcachefs/recovery.c:800
 bch2_fs_start+0x356/0x5b0 fs/bcachefs/super.c:1030
 bch2_fs_open+0xa8d/0xdf0 fs/bcachefs/super.c:2105
 bch2_mount+0x71d/0x1320 fs/bcachefs/fs.c:1917
 legacy_get_tree+0xee/0x190 fs/fs_context.c:662
 vfs_get_tree+0x90/0x2a0 fs/super.c:1780
 do_new_mount+0x2be/0xb40 fs/namespace.c:3352
 do_mount fs/namespace.c:3692 [inline]
 __do_sys_mount fs/namespace.c:3898 [inline]
 __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3875
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fa35434c8fa
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:00007fff2b30e848 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fff2b30e860 RCX: 00007fa35434c8fa
RDX: 0000000020005d80 RSI: 0000000020005dc0 RDI: 00007fff2b30e860
RBP: 0000000000000010 R08: 00007fff2b30e8a0 R09: 0000000000005d8f
R10: 0000000000000010 R11: 0000000000000282 R12: 0000000000000004
R13: 00007fff2b30e8a0 R14: 0000000000000003 R15: 0000000001000000
 </TASK>
---[ end trace ]---

Crashes (45):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/05 05:24 linux-next 9221b2819b8a 610f2a54 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-linux-next-kasan-gce-root UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/06/02 19:10 upstream 83814698cf48 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/06/02 05:14 upstream 89be4025b0db 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/06/01 18:04 upstream cc8ed4d0a848 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/06/01 15:34 upstream cc8ed4d0a848 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/30 05:16 upstream 4a4be1ad3a6e 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/29 12:01 upstream e0cce98fe279 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/27 20:09 upstream 2bfcfd584ff5 761766e6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/27 08:22 upstream 6fbf71854e2d a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/27 08:22 upstream 6fbf71854e2d a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/27 06:13 upstream 6fbf71854e2d a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/27 06:13 upstream 6fbf71854e2d a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/27 06:09 upstream 1613e604df0c a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/27 06:09 upstream 1613e604df0c a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/27 00:28 upstream c13320499ba0 a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/26 23:37 upstream c13320499ba0 a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/23 21:17 upstream b6394d6f7159 4c2072ee .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/23 01:47 upstream b6394d6f7159 4d098039 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/23 01:23 upstream 8f6a15f095a6 4d098039 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/23 00:59 upstream b6394d6f7159 4d098039 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/21 23:14 upstream b6394d6f7159 1014eca7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/21 20:07 upstream 8f6a15f095a6 4c0d3ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/20 11:02 upstream eb6a9339efeb c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/20 10:07 upstream eb6a9339efeb c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/20 10:07 upstream eb6a9339efeb c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/30 10:25 upstream 4a4be1ad3a6e c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/27 06:15 upstream 1613e604df0c c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/24 14:23 upstream 6d69b6c12fce c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/21 01:43 upstream 6e51b4b5bbc0 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/31 16:51 upstream 4a4be1ad3a6e c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/31 16:15 upstream 4a4be1ad3a6e c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/31 16:15 upstream 4a4be1ad3a6e c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/31 08:22 upstream 4a4be1ad3a6e c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/27 06:18 upstream 1613e604df0c c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/27 06:18 upstream 1613e604df0c c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/31 03:01 linux-next 9d99040b1bc8 34889ee3 .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_format_invalid
2024/05/19 20:13 linux-next c75962170e49 c0f1611a .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_format_invalid
2024/05/19 17:47 linux-next c75962170e49 c0f1611a .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_format_invalid
2024/05/19 13:50 linux-next c75962170e49 c0f1611a .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_format_invalid
2024/05/18 21:29 linux-next c75962170e49 c0f1611a .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_format_invalid
2024/05/13 06:55 linux-next 75fa778d74b7 9026e142 .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_format_invalid
2024/05/10 03:34 linux-next 704ba27ac555 de979bc2 .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_format_invalid
2024/05/05 04:53 linux-next 9221b2819b8a 610f2a54 .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_format_invalid
2024/06/02 14:37 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fda5695d692c 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
2024/05/07 09:21 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 78186bd77b47 c035c6de .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 UBSAN: shift-out-of-bounds in bch2_bkey_format_invalid
* Struck through repros no longer work on HEAD.