[syzbot] [bpf?] KMSAN: uninit-value in trie_delete_elem

15 views
Skip to first unread message

syzbot

unread,
Mar 26, 2024, 3:00:26 PMMar 26
to and...@kernel.org, a...@kernel.org, b...@vger.kernel.org, dan...@iogearbox.net, edd...@gmail.com, hao...@google.com, john.fa...@gmail.com, jo...@kernel.org, kps...@kernel.org, linux-...@vger.kernel.org, marti...@linux.dev, s...@google.com, so...@kernel.org, syzkall...@googlegroups.com, yongho...@linux.dev
Hello,

syzbot found the following issue on:

HEAD commit: 4f55aa85a874 Merge tag 'fbdev-for-6.9-rc1' of git://git.ke..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=11a8dc6e180000
kernel config: https://syzkaller.appspot.com/x/.config?x=e6bd769cb793b98a
dashboard link: https://syzkaller.appspot.com/bug?extid=603bcd9b0bf1d94dbb9b
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: i386

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/991fcbce770a/disk-4f55aa85.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/bd716e5d2c3c/vmlinux-4f55aa85.xz
kernel image: https://storage.googleapis.com/syzbot-assets/bf1151dbf5fc/bzImage-4f55aa85.xz

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

=====================================================
BUG: KMSAN: uninit-value in trie_delete_elem+0xc0/0xbe0 kernel/bpf/lpm_trie.c:448
trie_delete_elem+0xc0/0xbe0 kernel/bpf/lpm_trie.c:448
____bpf_map_delete_elem kernel/bpf/helpers.c:77 [inline]
bpf_map_delete_elem+0x5c/0x80 kernel/bpf/helpers.c:73
___bpf_prog_run+0x13fe/0xe0f0 kernel/bpf/core.c:1997
__bpf_prog_run128+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 include/linux/filter.h:664 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline]
bpf_trace_run3+0x132/0x320 kernel/trace/bpf_trace.c:2421
__bpf_trace_kmem_cache_free+0x31/0x40 include/trace/events/kmem.h:114
trace_kmem_cache_free include/trace/events/kmem.h:114 [inline]
kmem_cache_free+0x6da/0xa80 mm/slub.c:4343
mt_free_one lib/maple_tree.c:172 [inline]
mas_destroy+0x56c9/0x5cd0 lib/maple_tree.c:5612
mas_store_prealloc+0x39c/0x550 lib/maple_tree.c:5487
vma_iter_store mm/internal.h:1290 [inline]
vma_complete+0x9b0/0x14e0 mm/mmap.c:535
__split_vma+0x1037/0x1200 mm/mmap.c:2385
split_vma mm/mmap.c:2411 [inline]
vma_modify+0x37c/0x4c0 mm/mmap.c:2452
vma_modify_flags include/linux/mm.h:3303 [inline]
mprotect_fixup+0x790/0x1170 mm/mprotect.c:635
do_mprotect_pkey+0x1159/0x1850 mm/mprotect.c:809
__do_sys_mprotect mm/mprotect.c:830 [inline]
__se_sys_mprotect mm/mprotect.c:827 [inline]
__ia32_sys_mprotect+0x98/0xf0 mm/mprotect.c:827
do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
__do_fast_syscall_32+0xba/0x120 arch/x86/entry/common.c:321
do_fast_syscall_32+0x38/0x80 arch/x86/entry/common.c:346
do_SYSENTER_32+0x1f/0x30 arch/x86/entry/common.c:384
entry_SYSENTER_compat_after_hwframe+0x7a/0x84

Local variable stack created at:
__bpf_prog_run128+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 include/linux/filter.h:664 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline]
bpf_trace_run3+0x132/0x320 kernel/trace/bpf_trace.c:2421

CPU: 0 PID: 14388 Comm: syz-executor.4 Not tainted 6.8.0-syzkaller-13006-g4f55aa85a874 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024
=====================================================


---
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 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,
Mar 29, 2024, 3:52:21 PMMar 29
to and...@kernel.org, a...@kernel.org, b...@vger.kernel.org, dan...@iogearbox.net, edd...@gmail.com, hao...@google.com, john.fa...@gmail.com, jo...@kernel.org, kerne...@meta.com, kps...@kernel.org, linux-...@vger.kernel.org, marti...@linux.dev, patchw...@kernel.org, s...@google.com, so...@kernel.org, syzkall...@googlegroups.com, yongho...@linux.dev
syzbot has found a reproducer for the following issue on:

HEAD commit: 317c7bc0ef03 Merge tag 'mmc-v6.9-rc1' of git://git.kernel...
git tree: upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=121ddb95180000
kernel config: https://syzkaller.appspot.com/x/.config?x=e2599baf258ef795
dashboard link: https://syzkaller.appspot.com/bug?extid=603bcd9b0bf1d94dbb9b
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=15af8b0d180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1590903d180000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/eea0b23c3f68/disk-317c7bc0.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/440f7aea55b5/vmlinux-317c7bc0.xz
kernel image: https://storage.googleapis.com/syzbot-assets/ecb91ede16f9/bzImage-317c7bc0.xz

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

=====================================================
BUG: KMSAN: uninit-value in trie_delete_elem+0xc0/0xbe0 kernel/bpf/lpm_trie.c:448
trie_delete_elem+0xc0/0xbe0 kernel/bpf/lpm_trie.c:448
____bpf_map_delete_elem kernel/bpf/helpers.c:77 [inline]
bpf_map_delete_elem+0x5c/0x80 kernel/bpf/helpers.c:73
___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 include/linux/filter.h:664 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline]
bpf_trace_run2+0x116/0x300 kernel/trace/bpf_trace.c:2420
__bpf_trace_kfree+0x29/0x40 include/trace/events/kmem.h:94
trace_kfree include/trace/events/kmem.h:94 [inline]
kfree+0x6a5/0xa30 mm/slub.c:4377
bpf_free_used_maps kernel/bpf/core.c:2723 [inline]
bpf_prog_free_deferred+0x390/0xc70 kernel/bpf/core.c:2761
process_one_work kernel/workqueue.c:3254 [inline]
process_scheduled_works+0xa81/0x1bd0 kernel/workqueue.c:3335
worker_thread+0xea5/0x1560 kernel/workqueue.c:3416
kthread+0x3e2/0x540 kernel/kthread.c:388
ret_from_fork+0x6d/0x90 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243

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 include/linux/filter.h:664 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline]
bpf_trace_run2+0x116/0x300 kernel/trace/bpf_trace.c:2420

CPU: 0 PID: 7 Comm: kworker/0:0 Not tainted 6.9.0-rc1-syzkaller-00178-g317c7bc0ef03 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Workqueue: events bpf_prog_free_deferred
=====================================================


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

Yonghong Song

unread,
Apr 1, 2024, 2:55:33 PMApr 1
to syzbot, and...@kernel.org, a...@kernel.org, b...@vger.kernel.org, dan...@iogearbox.net, edd...@gmail.com, hao...@google.com, john.fa...@gmail.com, jo...@kernel.org, kps...@kernel.org, linux-...@vger.kernel.org, marti...@linux.dev, s...@google.com, so...@kernel.org, syzkall...@googlegroups.com

On 3/26/24 12:00 PM, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 4f55aa85a874 Merge tag 'fbdev-for-6.9-rc1' of git://git.ke..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=11a8dc6e180000
> kernel config: https://syzkaller.appspot.com/x/.config?x=e6bd769cb793b98a
> dashboard link: https://syzkaller.appspot.com/bug?extid=603bcd9b0bf1d94dbb9b
> compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
> userspace arch: i386
>
> Unfortunately, I don't have any reproducer for this issue yet.
>
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/991fcbce770a/disk-4f55aa85.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/bd716e5d2c3c/vmlinux-4f55aa85.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/bf1151dbf5fc/bzImage-4f55aa85.xz
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+603bcd...@syzkaller.appspotmail.com
>
> =====================================================
> BUG: KMSAN: uninit-value in trie_delete_elem+0xc0/0xbe0 kernel/bpf/lpm_trie.c:448

Unrelated to the bug itself, with KMSAN is enabled, qemu cannot boot my vm
any more. Anything special I need to do in order to boot a KMSAN kernel?

Aleksandr Nogikh

unread,
Apr 2, 2024, 2:37:01 AMApr 2
to Yonghong Song, Alexander Potapenko, syzbot, and...@kernel.org, a...@kernel.org, b...@vger.kernel.org, dan...@iogearbox.net, edd...@gmail.com, hao...@google.com, john.fa...@gmail.com, jo...@kernel.org, kps...@kernel.org, linux-...@vger.kernel.org, marti...@linux.dev, s...@google.com, so...@kernel.org, syzkall...@googlegroups.com
Hi,

On Mon, Apr 1, 2024 at 8:55 PM Yonghong Song <yongho...@linux.dev> wrote:
>
>
> On 3/26/24 12:00 PM, syzbot wrote:
> > Hello,
> >
> > syzbot found the following issue on:
> >
> > =====================================================
> > BUG: KMSAN: uninit-value in trie_delete_elem+0xc0/0xbe0 kernel/bpf/lpm_trie.c:448
>
> Unrelated to the bug itself, with KMSAN is enabled, qemu cannot boot my vm
> any more. Anything special I need to do in order to boot a KMSAN kernel?
>

Does the kernel print any specific errors to the serial console while
booting? Or nothing at all?

--
Aleksandr

Yonghong Song

unread,
Apr 2, 2024, 11:59:24 PMApr 2
to Aleksandr Nogikh, Alexander Potapenko, syzbot, and...@kernel.org, a...@kernel.org, b...@vger.kernel.org, dan...@iogearbox.net, edd...@gmail.com, hao...@google.com, john.fa...@gmail.com, jo...@kernel.org, kps...@kernel.org, linux-...@vger.kernel.org, marti...@linux.dev, s...@google.com, so...@kernel.org, syzkall...@googlegroups.com
In my case, nothing at all.

>

Aleksandr Nogikh

unread,
Apr 3, 2024, 4:47:20 AMApr 3
to Yonghong Song, Alexander Potapenko, syzbot, and...@kernel.org, a...@kernel.org, b...@vger.kernel.org, dan...@iogearbox.net, edd...@gmail.com, hao...@google.com, john.fa...@gmail.com, jo...@kernel.org, kps...@kernel.org, linux-...@vger.kernel.org, marti...@linux.dev, s...@google.com, so...@kernel.org, syzkall...@googlegroups.com
If you're using qemu, please try adding "-machine pc-q35-7.1" to its
arguments. Otherwise it's known to have problems with very large
kernel images.

--
Aleksandr

Yonghong Song

unread,
Apr 4, 2024, 3:00:20 PMApr 4
to Aleksandr Nogikh, Alexander Potapenko, syzbot, and...@kernel.org, a...@kernel.org, b...@vger.kernel.org, dan...@iogearbox.net, edd...@gmail.com, hao...@google.com, john.fa...@gmail.com, jo...@kernel.org, kps...@kernel.org, linux-...@vger.kernel.org, marti...@linux.dev, s...@google.com, so...@kernel.org, syzkall...@googlegroups.com
I still do not help. My qemu does not support pc-q35-7.1. The most
q35 machine is pc-q35-5.2 and it does not work.

Reply all
Reply to author
Forward
0 new messages