[Android 5.15] UBSAN: shift-out-of-bounds in scalar32_min_max_arsh

0 views
Skip to first unread message

syzbot

unread,
Dec 17, 2023, 11:19:27 AM12/17/23
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 05ef4ccb5774 Revert "ipvlan: properly track tx_errors"
git tree: android13-5.15-lts
console+strace: https://syzkaller.appspot.com/x/log.txt?x=17db38f1e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=efa97e9d20fc8142
dashboard link: https://syzkaller.appspot.com/bug?extid=4e6d9667667204fca9b9
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=17675201e80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=127fe021e80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/08c970a04252/disk-05ef4ccb.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/ba3530601846/vmlinux-05ef4ccb.xz
kernel image: https://storage.googleapis.com/syzbot-assets/b019552eabf4/bzImage-05ef4ccb.xz

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

================================================================================
UBSAN: shift-out-of-bounds in kernel/bpf/verifier.c:7979:63
shift exponent 1073741824 is too large for 32-bit type 's32' (aka 'int')
CPU: 0 PID: 292 Comm: syz-executor319 Not tainted 5.15.139-syzkaller-00529-g05ef4ccb5774 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106
dump_stack+0x15/0x17 lib/dump_stack.c:113
ubsan_epilogue lib/ubsan.c:151 [inline]
__ubsan_handle_shift_out_of_bounds+0x3bf/0x420 lib/ubsan.c:321
scalar32_min_max_arsh+0x622/0x6c0 kernel/bpf/verifier.c:7979
adjust_scalar_min_max_vals kernel/bpf/verifier.c:8167 [inline]
adjust_reg_min_max_vals+0x3d1d/0x6360 kernel/bpf/verifier.c:8268
check_alu_op kernel/bpf/verifier.c:8439 [inline]
do_check+0x94d9/0xf2c0 kernel/bpf/verifier.c:11183
do_check_common+0x909/0x1290 kernel/bpf/verifier.c:13398
do_check_main kernel/bpf/verifier.c:13461 [inline]
bpf_check+0x3835/0x12bf0 kernel/bpf/verifier.c:14032
bpf_prog_load+0x12ac/0x1b50 kernel/bpf/syscall.c:2327
__sys_bpf+0x4bc/0x760 kernel/bpf/syscall.c:4618
__do_sys_bpf kernel/bpf/syscall.c:4722 [inline]
__se_sys_bpf kernel/bpf/syscall.c:4720 [inline]
__x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:4720
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:0x7ff1d19493e9
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:00007ffe67a82798 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007ffe67a82978 RCX: 00007ff1d19493e9
RDX: 0000000000000048 RSI: 00000000200054c0 RDI: 0000000000000005
RBP: 00007ff1d19bc610 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffe67a82968 R14: 0000000000000001 R15: 0000000000000001
</TASK>
================================================================================
================================================================================
UBSAN: shift-out-of-bounds in kernel/bpf/verifier.c:7980:63
shift exponent 1073741824 is too large for 32-bit type 's32' (aka 'int')
CPU: 0 PID: 292 Comm: syz-executor319 Not tainted 5.15.139-syzkaller-00529-g05ef4ccb5774 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106
dump_stack+0x15/0x17 lib/dump_stack.c:113
ubsan_epilogue lib/ubsan.c:151 [inline]
__ubsan_handle_shift_out_of_bounds+0x3bf/0x420 lib/ubsan.c:321
scalar32_min_max_arsh+0x676/0x6c0 kernel/bpf/verifier.c:7980
adjust_scalar_min_max_vals kernel/bpf/verifier.c:8167 [inline]
adjust_reg_min_max_vals+0x3d1d/0x6360 kernel/bpf/verifier.c:8268
check_alu_op kernel/bpf/verifier.c:8439 [inline]
do_check+0x94d9/0xf2c0 kernel/bpf/verifier.c:11183
do_check_common+0x909/0x1290 kernel/bpf/verifier.c:13398
do_check_main kernel/bpf/verifier.c:13461 [inline]
bpf_check+0x3835/0x12bf0 kernel/bpf/verifier.c:14032
bpf_prog_load+0x12ac/0x1b50 kernel/bpf/syscall.c:2327
__sys_bpf+0x4bc/0x760 kernel/bpf/syscall.c:4618
__do_sys_bpf kernel/bpf/syscall.c:4722 [inline]
__se_sys_bpf kernel/bpf/syscall.c:4720 [inline]
__x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:4720
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:0x7ff1d19493e9
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:00007ffe67a82798 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007ffe67a82978 RCX: 00007ff1d19493e9
RDX: 0000000000000048 RSI: 00000000200054c0 RDI: 0000000000000005
RBP: 00007ff1d19bc610 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffe67a82968 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 18, 2023, 2:55:23 AM12/18/23
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: cee8ebf7c508 ANDROID: GKI: build damon for monitoring virt..
git tree: android14-6.1
console+strace: https://syzkaller.appspot.com/x/log.txt?x=10b4ef49e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=2efa7ec05407068e
dashboard link: https://syzkaller.appspot.com/bug?extid=01216377512e895be703
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=163a741ae80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1564829ee80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/d8fa75dfd73d/disk-cee8ebf7.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/0b73455c5db4/vmlinux-cee8ebf7.xz
kernel image: https://storage.googleapis.com/syzbot-assets/ecb89ce6d496/bzImage-cee8ebf7.xz

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

================================================================================
UBSAN: shift-out-of-bounds in kernel/bpf/verifier.c:9205:63
shift exponent 1073741824 is too large for 32-bit type 's32' (aka 'int')
CPU: 0 PID: 295 Comm: syz-executor414 Not tainted 6.1.57-syzkaller-00058-gcee8ebf7c508 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106
dump_stack+0x15/0x17 lib/dump_stack.c:113
ubsan_epilogue lib/ubsan.c:151 [inline]
__ubsan_handle_shift_out_of_bounds+0x3e1/0x440 lib/ubsan.c:321
scalar32_min_max_arsh+0x622/0x6c0 kernel/bpf/verifier.c:9205
adjust_scalar_min_max_vals kernel/bpf/verifier.c:9393 [inline]
adjust_reg_min_max_vals+0x3d20/0x6360 kernel/bpf/verifier.c:9494
check_alu_op kernel/bpf/verifier.c:9665 [inline]
do_check+0x8e35/0xdd60 kernel/bpf/verifier.c:12516
do_check_common+0x6ce/0xed0 kernel/bpf/verifier.c:14930
do_check_main kernel/bpf/verifier.c:14993 [inline]
bpf_check+0x673b/0x16560 kernel/bpf/verifier.c:15567
bpf_prog_load+0x1304/0x1bf0 kernel/bpf/syscall.c:2605
__sys_bpf+0x52c/0x7f0 kernel/bpf/syscall.c:4972
__do_sys_bpf kernel/bpf/syscall.c:5076 [inline]
__se_sys_bpf kernel/bpf/syscall.c:5074 [inline]
__x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5074
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+0x63/0xcd
RIP: 0033:0x7fe597b543e9
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:00007fff70e91208 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007fff70e913e8 RCX: 00007fe597b543e9
RDX: 0000000000000048 RSI: 00000000200054c0 RDI: 0000000000000005
RBP: 00007fe597bc7610 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000246 R12: 0000000000000001
R13: 00007fff70e913d8 R14: 0000000000000001 R15: 0000000000000001
</TASK>
================================================================================
================================================================================
UBSAN: shift-out-of-bounds in kernel/bpf/verifier.c:9206:63
shift exponent 1073741824 is too large for 32-bit type 's32' (aka 'int')
CPU: 0 PID: 295 Comm: syz-executor414 Not tainted 6.1.57-syzkaller-00058-gcee8ebf7c508 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106
dump_stack+0x15/0x17 lib/dump_stack.c:113
ubsan_epilogue lib/ubsan.c:151 [inline]
__ubsan_handle_shift_out_of_bounds+0x3e1/0x440 lib/ubsan.c:321
scalar32_min_max_arsh+0x676/0x6c0 kernel/bpf/verifier.c:9206
adjust_scalar_min_max_vals kernel/bpf/verifier.c:9393 [inline]
adjust_reg_min_max_vals+0x3d20/0x6360 kernel/bpf/verifier.c:9494
check_alu_op kernel/bpf/verifier.c:9665 [inline]
do_check+0x8e35/0xdd60 kernel/bpf/verifier.c:12516
do_check_common+0x6ce/0xed0 kernel/bpf/verifier.c:14930
do_check_main kernel/bpf/verifier.c:14993 [inline]
bpf_check+0x673b/0x16560 kernel/bpf/verifier.c:15567
bpf_prog_load+0x1304/0x1bf0 kernel/bpf/syscall.c:2605
__sys_bpf+0x52c/0x7f0 kernel/bpf/syscall.c:4972
__do_sys_bpf kernel/bpf/syscall.c:5076 [inline]
__se_sys_bpf kernel/bpf/syscall.c:5074 [inline]
__x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5074
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+0x63/0xcd
RIP: 0033:0x7fe597b543e9
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:00007fff70e91208 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007fff70e913e8 RCX: 00007fe597b543e9
RDX: 0000000000000048 RSI: 00000000200054c0 RDI: 0000000000000005
RBP: 00007fe597bc7610 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000246 R12: 0000000000000001
R13: 00007fff70e913d8 R14: 0000000000000001 R15: 0000000000000001
</TASK>
================================================================================

syzbot

unread,
Dec 22, 2023, 4:21:05 AM12/22/23
to syzkaller-a...@googlegroups.com
syzbot has bisected this issue to:

commit 8b57a37d0ee77013eaab53e3853825b2ee11d851
Author: Andrii Nakryiko <and...@kernel.org>
Date: Mon Jul 24 12:42:19 2023 +0000

bpf: stop setting precise in current state

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=177a6d9ee80000
start commit: 30bca9e2785b UPSTREAM: netfilter: nft_set_pipapo: skip ina..
git tree: android14-6.1
final oops: https://syzkaller.appspot.com/x/report.txt?x=14fa6d9ee80000
console output: https://syzkaller.appspot.com/x/log.txt?x=10fa6d9ee80000
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12fa15a5e80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17cee26ee80000

Reported-by: syzbot+012163...@syzkaller.appspotmail.com
Fixes: 8b57a37d0ee7 ("bpf: stop setting precise in current state")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

syzbot

unread,
Apr 19, 2024, 8:13:04 PM (13 days ago) Apr 19
to syzkaller-a...@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=146c0e6f180000
start commit: 30bca9e2785b UPSTREAM: netfilter: nft_set_pipapo: skip ina..
git tree: android14-6.1
If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: bpf: fix precision backtracking instruction iteration
Reply all
Reply to author
Forward
0 new messages