Re: [syzbot] [bpf?] KMSAN: uninit-value in __bpf_strtoull

From: syzbot
Date: Thu Mar 28 2024 - 22:59:32 EST


syzbot has found a reproducer for the following issue on:

HEAD commit: 8d025e2092e2 Merge tag 'erofs-for-6.9-rc2-fixes' of git://..
git tree: upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=10f2ffe6180000
kernel config: https://syzkaller.appspot.com/x/.config?x=e2599baf258ef795
dashboard link: https://syzkaller.appspot.com/bug?extid=8ac8b7b2292ea867a162
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=15b3ac29180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=160153c9180000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/5ccde1a19e22/disk-8d025e20.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/45420817e7d9/vmlinux-8d025e20.xz
kernel image: https://storage.googleapis.com/syzbot-assets/354bdafd8c8f/bzImage-8d025e20.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+8ac8b7b2292ea867a162@xxxxxxxxxxxxxxxxxxxxxxxxx

=====================================================
BUG: KMSAN: uninit-value in __bpf_strtoull+0x245/0x5b0 kernel/bpf/helpers.c:465
__bpf_strtoull+0x245/0x5b0 kernel/bpf/helpers.c:465
__bpf_strtoll kernel/bpf/helpers.c:504 [inline]
____bpf_strtol kernel/bpf/helpers.c:525 [inline]
bpf_strtol+0x7c/0x270 kernel/bpf/helpers.c:519
___bpf_prog_run+0x13fe/0xe0f0 kernel/bpf/core.c:1997
__bpf_prog_run96+0xb5/0xe0 kernel/bpf/core.c:2236
bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline]
__bpf_prog_run include/linux/filter.h:657 [inline]
bpf_prog_run_xdp include/net/xdp.h:514 [inline]
bpf_test_run+0x43e/0xc30 net/bpf/test_run.c:423
bpf_prog_test_run_xdp+0xeaa/0x1a40 net/bpf/test_run.c:1269
bpf_prog_test_run+0x6b7/0xad0 kernel/bpf/syscall.c:4240
__sys_bpf+0x6aa/0xd90 kernel/bpf/syscall.c:5649
__do_sys_bpf kernel/bpf/syscall.c:5738 [inline]
__se_sys_bpf kernel/bpf/syscall.c:5736 [inline]
__x64_sys_bpf+0xa0/0xe0 kernel/bpf/syscall.c:5736
do_syscall_64+0xd5/0x1f0
entry_SYSCALL_64_after_hwframe+0x6d/0x75

Local variable stack created at:
__bpf_prog_run96+0x45/0xe0 kernel/bpf/core.c:2236
bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline]
__bpf_prog_run include/linux/filter.h:657 [inline]
bpf_prog_run_xdp include/net/xdp.h:514 [inline]
bpf_test_run+0x43e/0xc30 net/bpf/test_run.c:423

CPU: 1 PID: 5019 Comm: syz-executor335 Not tainted 6.9.0-rc1-syzkaller-00061-g8d025e2092e2 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
=====================================================


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