syzbot


KMSAN: kernel-infoleak in move_addr_to_user (7)

Status: upstream: reported C repro on 2024/09/22 17:46
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+346474e3bf0b26bd3090@syzkaller.appspotmail.com
First crash: 23d, last: 8d19h
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] Fix KMSAN infoleak, initialize unused data in pskb_expand_head 7 (7) 2024/10/05 04:59
[syzbot] [net?] KMSAN: kernel-infoleak in move_addr_to_user (7) 0 (2) 2024/10/02 00:05
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KMSAN: kernel-infoleak in move_addr_to_user (3) net C 79 1489d 1524d 15/28 fixed on 2020/09/28 09:09
upstream KMSAN: kernel-infoleak in move_addr_to_user (2) net C 8 2029d 2044d 11/28 fixed on 2019/03/28 12:00
upstream KMSAN: kernel-infoleak in move_addr_to_user (4) net C 59 1322d 1374d 19/28 fixed on 2021/03/10 01:48
upstream KMSAN: kernel-infoleak in move_addr_to_user (5) tipc 3 1171d 1312d 20/28 fixed on 2021/11/10 00:50
upstream KMSAN: kernel-infoleak in move_addr_to_user net 5 2057d 2107d 11/28 fixed on 2019/03/06 07:43
upstream KMSAN: kernel-infoleak in move_addr_to_user (6) tipc C 4 991d 1029d 20/28 fixed on 2022/03/08 16:11
Last patch testing requests (3)
Created Duration User Patch Repo Result
2024/10/06 17:28 23m retest repro upstream report log
2024/10/06 17:28 29m retest repro upstream report log
2024/10/02 00:05 36m danielyangkang@gmail.com patch upstream OK log

Sample crash report:
=====================================================
BUG: KMSAN: kernel-infoleak in instrument_copy_to_user include/linux/instrumented.h:114 [inline]
BUG: KMSAN: kernel-infoleak in _inline_copy_to_user include/linux/uaccess.h:180 [inline]
BUG: KMSAN: kernel-infoleak in _copy_to_user+0xbc/0x110 lib/usercopy.c:26
 instrument_copy_to_user include/linux/instrumented.h:114 [inline]
 _inline_copy_to_user include/linux/uaccess.h:180 [inline]
 _copy_to_user+0xbc/0x110 lib/usercopy.c:26
 copy_to_user include/linux/uaccess.h:209 [inline]
 move_addr_to_user+0x28b/0x400 net/socket.c:292
 ____sys_recvmsg+0x232/0x620 net/socket.c:2829
 ___sys_recvmsg+0x223/0x840 net/socket.c:2864
 do_recvmmsg+0x4f6/0xfd0 net/socket.c:2958
 __sys_recvmmsg net/socket.c:3037 [inline]
 __do_sys_recvmmsg net/socket.c:3060 [inline]
 __se_sys_recvmmsg net/socket.c:3053 [inline]
 __x64_sys_recvmmsg+0x397/0x490 net/socket.c:3053
 x64_sys_call+0x2e5d/0x3ba0 arch/x86/include/generated/asm/syscalls_64.h:300
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Uninit was stored to memory at:
 packet_recvmsg+0x176a/0x2500 net/packet/af_packet.c:3585
 sock_recvmsg_nosec+0x22f/0x2b0 net/socket.c:1052
 ____sys_recvmsg+0x541/0x620 net/socket.c:2820
 ___sys_recvmsg+0x223/0x840 net/socket.c:2864
 do_recvmmsg+0x4f6/0xfd0 net/socket.c:2958
 __sys_recvmmsg net/socket.c:3037 [inline]
 __do_sys_recvmmsg net/socket.c:3060 [inline]
 __se_sys_recvmmsg net/socket.c:3053 [inline]
 __x64_sys_recvmmsg+0x397/0x490 net/socket.c:3053
 x64_sys_call+0x2e5d/0x3ba0 arch/x86/include/generated/asm/syscalls_64.h:300
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Uninit was stored to memory at:
 eth_header_parse+0xb8/0x110 net/ethernet/eth.c:204
 dev_parse_header include/linux/netdevice.h:3158 [inline]
 packet_rcv+0xefc/0x2050 net/packet/af_packet.c:2253
 dev_queue_xmit_nit+0x114b/0x12a0 net/core/dev.c:2347
 xmit_one net/core/dev.c:3584 [inline]
 dev_hard_start_xmit+0x17d/0xa20 net/core/dev.c:3604
 __dev_queue_xmit+0x3576/0x55e0 net/core/dev.c:4424
 dev_queue_xmit include/linux/netdevice.h:3094 [inline]
 __bpf_tx_skb net/core/filter.c:2152 [inline]
 __bpf_redirect_common net/core/filter.c:2196 [inline]
 __bpf_redirect+0x148c/0x1610 net/core/filter.c:2203
 ____bpf_clone_redirect net/core/filter.c:2475 [inline]
 bpf_clone_redirect+0x37e/0x500 net/core/filter.c:2447
 ___bpf_prog_run+0x13fe/0xe0f0 kernel/bpf/core.c:2010
 __bpf_prog_run512+0xc5/0xf0 kernel/bpf/core.c:2253
 bpf_dispatcher_nop_func include/linux/bpf.h:1257 [inline]
 __bpf_prog_run include/linux/filter.h:701 [inline]
 bpf_prog_run include/linux/filter.h:708 [inline]
 bpf_test_run+0x546/0xd20 net/bpf/test_run.c:433
 bpf_prog_test_run_skb+0x182f/0x24d0 net/bpf/test_run.c:1094
 bpf_prog_test_run+0x6b1/0xac0 kernel/bpf/syscall.c:4320
 __sys_bpf+0x6aa/0xd90 kernel/bpf/syscall.c:5735
 __do_sys_bpf kernel/bpf/syscall.c:5824 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5822 [inline]
 __x64_sys_bpf+0xa0/0xe0 kernel/bpf/syscall.c:5822
 x64_sys_call+0x2cce/0x3ba0 arch/x86/include/generated/asm/syscalls_64.h:322
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Uninit was created at:
 slab_post_alloc_hook mm/slub.c:4092 [inline]
 slab_alloc_node mm/slub.c:4135 [inline]
 kmem_cache_alloc_node_noprof+0x6bf/0xb80 mm/slub.c:4187
 kmalloc_reserve+0x13d/0x4a0 net/core/skbuff.c:587
 pskb_expand_head+0x226/0x1a60 net/core/skbuff.c:2275
 skb_ensure_writable+0x496/0x520 net/core/skbuff.c:6214
 __bpf_try_make_writable net/core/filter.c:1677 [inline]
 bpf_try_make_writable net/core/filter.c:1683 [inline]
 bpf_try_make_head_writable net/core/filter.c:1691 [inline]
 ____bpf_clone_redirect net/core/filter.c:2469 [inline]
 bpf_clone_redirect+0x1c5/0x500 net/core/filter.c:2447
 ___bpf_prog_run+0x13fe/0xe0f0 kernel/bpf/core.c:2010
 __bpf_prog_run512+0xc5/0xf0 kernel/bpf/core.c:2253
 bpf_dispatcher_nop_func include/linux/bpf.h:1257 [inline]
 __bpf_prog_run include/linux/filter.h:701 [inline]
 bpf_prog_run include/linux/filter.h:708 [inline]
 bpf_test_run+0x546/0xd20 net/bpf/test_run.c:433
 bpf_prog_test_run_skb+0x182f/0x24d0 net/bpf/test_run.c:1094
 bpf_prog_test_run+0x6b1/0xac0 kernel/bpf/syscall.c:4320
 __sys_bpf+0x6aa/0xd90 kernel/bpf/syscall.c:5735
 __do_sys_bpf kernel/bpf/syscall.c:5824 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5822 [inline]
 __x64_sys_bpf+0xa0/0xe0 kernel/bpf/syscall.c:5822
 x64_sys_call+0x2cce/0x3ba0 arch/x86/include/generated/asm/syscalls_64.h:322
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Bytes 12-17 of 20 are uninitialized
Memory access of size 20 starts at ffff88812112fa48
Data copied to user address 0000000020000ac0

CPU: 0 UID: 0 PID: 5234 Comm: syz-executor312 Not tainted 6.11.0-syzkaller-08481-g88264981f208 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
=====================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/09/22 17:20 upstream 88264981f208 6f888b75 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-kmsan-gce-root KMSAN: kernel-infoleak in move_addr_to_user
2024/09/22 12:36 upstream 88264981f208 6f888b75 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-kmsan-gce-root KMSAN: kernel-infoleak in move_addr_to_user
2024/09/21 21:47 upstream 1868f9d0260e 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kmsan-gce-root KMSAN: kernel-infoleak in move_addr_to_user
* Struck through repros no longer work on HEAD.