[v5.15] UBSAN: shift-out-of-bounds in scalar32_min_max_arsh

6 views
Skip to first unread message

syzbot

unread,
Dec 17, 2023, 11:29:21 AM12/17/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: d0fc081c6241 Linux 5.15.143
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1066f949e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=ffd22c928742e176
dashboard link: https://syzkaller.appspot.com/bug?extid=87cdeb317f4a33389321
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13840556e80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=130c213ee80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/26693024567d/disk-d0fc081c.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/db9b0567069d/vmlinux-d0fc081c.xz
kernel image: https://storage.googleapis.com/syzbot-assets/0cff63098e70/bzImage-d0fc081c.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+87cdeb...@syzkaller.appspotmail.com

================================================================================
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>
================================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Dec 21, 2023, 1:26:22 AM12/21/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 4aa6747d9352 Linux 6.1.69
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14d1a1d6e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=e1e9066810307299
dashboard link: https://syzkaller.appspot.com/bug?extid=397b2bcc19cc8c232f89
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11080d76e80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14768576e80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/90e712af4aa7/disk-4aa6747d.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/bdaad5d91499/vmlinux-4aa6747d.xz
kernel image: https://storage.googleapis.com/syzbot-assets/157abc0d55dc/bzImage-4aa6747d.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+397b2b...@syzkaller.appspotmail.com

================================================================================
UBSAN: shift-out-of-bounds in kernel/bpf/verifier.c:9211:63
shift exponent 1073741824 is too large for 32-bit type 's32' (aka 'int')
CPU: 0 PID: 3544 Comm: syz-executor176 Not tainted 6.1.69-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:9211
adjust_scalar_min_max_vals kernel/bpf/verifier.c:9399 [inline]
adjust_reg_min_max_vals+0x3d1d/0x6360 kernel/bpf/verifier.c:9500
check_alu_op kernel/bpf/verifier.c:9671 [inline]
do_check+0x9dd3/0xf550 kernel/bpf/verifier.c:12526
do_check_common+0x8cb/0x1110 kernel/bpf/verifier.c:14940
do_check_main kernel/bpf/verifier.c:15003 [inline]
bpf_check+0x66ca/0x16230 kernel/bpf/verifier.c:15577
bpf_prog_load+0x12df/0x1bb0 kernel/bpf/syscall.c:2603
__sys_bpf+0x382/0x6c0 kernel/bpf/syscall.c:4968
__do_sys_bpf kernel/bpf/syscall.c:5072 [inline]
__se_sys_bpf kernel/bpf/syscall.c:5070 [inline]
__x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5070
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f2c376d43e9
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:00007ffc08c065b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007ffc08c06798 RCX: 00007f2c376d43e9
RDX: 0000000000000048 RSI: 00000000200054c0 RDI: 0000000000000005
RBP: 00007f2c37747610 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffc08c06788 R14: 0000000000000001 R15: 0000000000000001

syzbot

unread,
Jan 20, 2024, 5:54:05 AMJan 20
to syzkaller...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit 803fb6109fcfa939d78907ad34161a720b37848d
Author: Andrii Nakryiko <and...@kernel.org>
Date: Fri Nov 10 00:26:37 2023 +0000

bpf: fix precision backtracking instruction iteration

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=11a7cc8be80000
start commit: 4aa6747d9352 Linux 6.1.69
git tree: linux-6.1.y
If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: bpf: fix precision backtracking instruction iteration

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages