syzbot


KMSAN: kernel-infoleak in move_addr_to_user (5)

Status: fixed on 2021/11/10 00:50
Reported-by: syzbot+@syzkaller.appspotmail.com
Fix commit: 50535249f624 net: qrtr: fix a kernel-infoleak in qrtr_recvmsg()
First crash: 566d, last: 425d
similar bugs (5):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KMSAN: kernel-infoleak in move_addr_to_user (3) C 79 743d 778d 17/24 fixed on 2020/09/28 09:09
upstream KMSAN: kernel-infoleak in move_addr_to_user (2) C 8 1283d 1298d 12/24 fixed on 2019/03/28 12:00
upstream KMSAN: kernel-infoleak in move_addr_to_user (4) C 59 576d 628d 21/24 fixed on 2021/03/10 01:48
upstream KMSAN: kernel-infoleak in move_addr_to_user 5 1311d 1361d 12/24 fixed on 2019/03/06 07:43
upstream KMSAN: kernel-infoleak in move_addr_to_user (6) C 4 245d 283d 22/24 fixed on 2022/03/08 16:11

Sample crash report:
udc-core: couldn't find an available UDC or it's busy
misc raw-gadget: fail, usb_gadget_probe_driver returned -16
=====================================================
BUG: KMSAN: kernel-infoleak in kmsan_copy_to_user+0x9c/0xb0 mm/kmsan/kmsan_hooks.c:252
CPU: 0 PID: 19987 Comm: syz-executor.1 Not tainted 5.13.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x24c/0x2e0 lib/dump_stack.c:120
 kmsan_report+0xfb/0x1e0 mm/kmsan/kmsan_report.c:121
 kmsan_internal_check_memory+0x1f5/0x500 mm/kmsan/kmsan.c:400
 kmsan_copy_to_user+0x9c/0xb0 mm/kmsan/kmsan_hooks.c:252
 instrument_copy_to_user include/linux/instrumented.h:126 [inline]
 _copy_to_user+0x1ac/0x270 lib/usercopy.c:33
 copy_to_user include/linux/uaccess.h:209 [inline]
 move_addr_to_user+0x3a2/0x640 net/socket.c:237
 __sys_getpeername+0x471/0x690 net/socket.c:1915
 __do_sys_getpeername net/socket.c:1925 [inline]
 __se_sys_getpeername net/socket.c:1922 [inline]
 __x64_sys_getpeername+0xda/0x120 net/socket.c:1922
 do_syscall_64+0xb3/0x180 arch/x86/entry/common.c:53
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x4665e9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007feebae86188 EFLAGS: 00000246 ORIG_RAX: 0000000000000034
RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665e9
RDX: 0000000020000040 RSI: 0000000020000000 RDI: 000000000000000e
RBP: 00000000004bfcc4 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80
R13: 0000000000a9fb1f R14: 00007feebae86300 R15: 0000000000022000

Uninit was stored to memory at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:120 [inline]
 kmsan_internal_chain_origin+0xad/0x130 mm/kmsan/kmsan.c:288
 __msan_chain_origin+0x54/0xa0 mm/kmsan/kmsan_instr.c:147
 tipc_getname+0x591/0x600 net/tipc/socket.c:758
 __sys_getpeername+0x3b4/0x690 net/socket.c:1912
 __do_sys_getpeername net/socket.c:1925 [inline]
 __se_sys_getpeername net/socket.c:1922 [inline]
 __x64_sys_getpeername+0xda/0x120 net/socket.c:1922
 do_syscall_64+0xb3/0x180 arch/x86/entry/common.c:53
 entry_SYSCALL_64_after_hwframe+0x44/0xae

Uninit was stored to memory at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:120 [inline]
 kmsan_internal_chain_origin+0xad/0x130 mm/kmsan/kmsan.c:288
 __msan_chain_origin+0x54/0xa0 mm/kmsan/kmsan_instr.c:147
 msg_set_word net/tipc/msg.h:211 [inline]
 msg_set_destport net/tipc/msg.h:618 [inline]
 __tipc_sendmsg+0x3451/0x4670 net/tipc/socket.c:1495
 tipc_sendmsg+0xeb/0x140 net/tipc/socket.c:1409
 sock_sendmsg_nosec net/socket.c:654 [inline]
 sock_sendmsg net/socket.c:674 [inline]
 ____sys_sendmsg+0xcfc/0x12f0 net/socket.c:2337
 ___sys_sendmsg net/socket.c:2391 [inline]
 __sys_sendmmsg+0xa57/0x1010 net/socket.c:2477
 __do_sys_sendmmsg net/socket.c:2506 [inline]
 __se_sys_sendmmsg net/socket.c:2503 [inline]
 __x64_sys_sendmmsg+0x11c/0x170 net/socket.c:2503
 do_syscall_64+0xb3/0x180 arch/x86/entry/common.c:53
 entry_SYSCALL_64_after_hwframe+0x44/0xae

Local variable ----skaddr@__tipc_sendmsg created at:
 __tipc_sendmsg+0x338/0x4670 net/tipc/socket.c:1426
 __tipc_sendmsg+0x338/0x4670 net/tipc/socket.c:1426

Bytes 4-7 of 16 are uninitialized
Memory access of size 16 starts at ffff888131903df0
Data copied to user address 0000000020000000
=====================================================

Crashes (3):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kmsan-gce 2021/08/01 02:43 https://github.com/google/kmsan.git master dfab4dc3af38 6c236867 .config log report info KMSAN: kernel-infoleak in move_addr_to_user
ci-upstream-kmsan-gce 2021/03/12 13:59 https://github.com/google/kmsan.git master 29ad81a1074a 429d8a6b .config log report info KMSAN: kernel-infoleak in move_addr_to_user
ci-upstream-kmsan-gce-386 2021/04/06 12:53 https://github.com/google/kmsan.git master 29ad81a1074a 6a81331a .config log report info KMSAN: kernel-infoleak in move_addr_to_user
* Struck through repros no longer work on HEAD.