syzbot


UBSAN: shift-out-of-bounds in scalar32_min_max_arsh

Status: upstream: reported C repro on 2023/12/17 16:29
Bug presence: origin:upstream
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+87cdeb317f4a33389321@syzkaller.appspotmail.com
First crash: 353d, last: 62d
Fix bisection: the issue occurs on the latest tested release (bisect log)
Crash: UBSAN: shift-out-of-bounds in adjust_reg_min_max_vals (log)
Repro: C syz .config
  
Bug presence (3)
Date Name Commit Repro Result
2024/01/31 linux-5.15.y (ToT) 6139f2a02fe0 C [report] UBSAN: shift-out-of-bounds in scalar32_min_max_arsh
2023/12/17 upstream (ToT) 3b8a9b2e6809 C [report] UBSAN: shift-out-of-bounds in scalar32_min_max_arsh
2024/01/31 upstream (ToT) 1bbb19b6eb1b C Didn't crash
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-15 UBSAN: shift-out-of-bounds in scalar32_min_max_arsh origin:upstream missing-backport C 2 6d12h 353d 0/2 upstream: reported C repro on 2023/12/17 16:19
linux-6.1 UBSAN: shift-out-of-bounds in scalar32_min_max_arsh origin:upstream C done 1 350d 350d 3/3 fixed on 2024/01/20 11:41
android-6-1 UBSAN: shift-out-of-bounds in scalar32_min_max_arsh origin:upstream missing-backport C done done 2 262d 353d 0/2 auto-obsoleted due to no activity on 2024/06/25 14:59
Last patch testing requests (1)
Created Duration User Patch Repo Result
2024/10/04 05:16 13m retest repro linux-5.15.y report log
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2024/02/13 00:24 1h01m fix candidate upstream OK (0) job log
2024/01/17 22:23 2h14m bisect fix linux-5.15.y OK (0) job log log

Sample crash report:
================================================================================
UBSAN: shift-out-of-bounds in kernel/bpf/verifier.c:8002:63
shift exponent 1073741824 is too large for 32-bit type 's32' (aka 'int')
CPU: 1 PID: 3500 Comm: syz-executor214 Not tainted 5.15.143-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 ubsan_epilogue lib/ubsan.c:151 [inline]
 __ubsan_handle_shift_out_of_bounds+0x3bf/0x420 lib/ubsan.c:321
 scalar32_min_max_arsh+0x564/0x5f0 kernel/bpf/verifier.c:8002
 adjust_scalar_min_max_vals kernel/bpf/verifier.c:8190 [inline]
 adjust_reg_min_max_vals+0x3d1d/0x6360 kernel/bpf/verifier.c:8291
 check_alu_op kernel/bpf/verifier.c:8462 [inline]
 do_check+0x94e2/0xf2d0 kernel/bpf/verifier.c:11206
 do_check_common+0x844/0x1070 kernel/bpf/verifier.c:13427
 do_check_main kernel/bpf/verifier.c:13490 [inline]
 bpf_check+0xcb80/0x12d00 kernel/bpf/verifier.c:14061
 bpf_prog_load+0x12b3/0x1b60 kernel/bpf/syscall.c:2325
 __sys_bpf+0x343/0x670 kernel/bpf/syscall.c:4614
 __do_sys_bpf kernel/bpf/syscall.c:4718 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:4716 [inline]
 __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4716
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7fd0104253e9
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 00 00 00 00 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:00007fffd6dc5988 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007fffd6dc5b68 RCX: 00007fd0104253e9
RDX: 0000000000000048 RSI: 00000000200054c0 RDI: 0000000000000005
RBP: 00007fd010498610 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000246 R12: 0000000000000001
R13: 00007fffd6dc5b58 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
================================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/12/17 16:29 linux-5.15.y d0fc081c6241 3222d10c .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf UBSAN: shift-out-of-bounds in scalar32_min_max_arsh
* Struck through repros no longer work on HEAD.