KMSAN: kernel-infoleak in vmci_host_unlocked_ioctl

9 views
Skip to first unread message

syzbot

unread,
Nov 17, 2020, 4:00:19 AM11/17/20
to ar...@arndb.de, gli...@google.com, gre...@linuxfoundation.org, jrdr....@gmail.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com, vi...@zeniv.linux.org.uk
Hello,

syzbot found the following issue on:

HEAD commit: 73d62e81 kmsan: random: prevent boot-time reports in _mix_..
git tree: https://github.com/google/kmsan.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=10c36af6500000
kernel config: https://syzkaller.appspot.com/x/.config?x=81c697c46ab63515
dashboard link: https://syzkaller.appspot.com/bug?extid=a79e17c39564bedf0930
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project.git ca2dcbd030eadbf0aa9b660efe864ff08af6e18b)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11180fe6500000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14e0e5e6500000

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

=====================================================
BUG: KMSAN: kernel-infoleak in kmsan_copy_to_user+0x9c/0xb0 mm/kmsan/kmsan_hooks.c:249
CPU: 1 PID: 8267 Comm: syz-executor275 Not tainted 5.10.0-rc4-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x21c/0x280 lib/dump_stack.c:118
kmsan_report+0xf7/0x1e0 mm/kmsan/kmsan_report.c:118
kmsan_internal_check_memory+0x484/0x520 mm/kmsan/kmsan.c:437
kmsan_copy_to_user+0x9c/0xb0 mm/kmsan/kmsan_hooks.c:249
instrument_copy_to_user include/linux/instrumented.h:121 [inline]
_copy_to_user+0x16e/0x240 lib/usercopy.c:33
copy_to_user include/linux/uaccess.h:209 [inline]
vmci_host_do_ctx_get_cpt_state drivers/misc/vmw_vmci/vmci_host.c:723 [inline]
vmci_host_unlocked_ioctl+0x3486/0x59a0 drivers/misc/vmw_vmci/vmci_host.c:939
vfs_ioctl fs/ioctl.c:48 [inline]
__do_sys_ioctl fs/ioctl.c:753 [inline]
__se_sys_ioctl+0x311/0x4d0 fs/ioctl.c:739
__x64_sys_ioctl+0x4a/0x70 fs/ioctl.c:739
do_syscall_64+0x9f/0x140 arch/x86/entry/common.c:48
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x443f19
Code: e8 fc ab 02 00 48 83 c4 18 c3 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 0f 83 1b 09 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffeaed45fc8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000443f19
RDX: 0000000020001540 RSI: 00000000000007b1 RDI: 0000000000000003
RBP: 00000000006ce018 R08: 00000000004002c8 R09: 00000000004002c8
R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000404cc0
R13: 0000000000404d50 R14: 0000000000000000 R15: 0000000000000000

Uninit was created at:
kmsan_save_stack_with_flags mm/kmsan/kmsan.c:121 [inline]
kmsan_internal_poison_shadow+0x5c/0xf0 mm/kmsan/kmsan.c:104
kmsan_slab_alloc+0x8d/0xe0 mm/kmsan/kmsan_hooks.c:76
slab_alloc_node mm/slub.c:2906 [inline]
slab_alloc mm/slub.c:2915 [inline]
__kmalloc+0x2f0/0x530 mm/slub.c:3983
kmalloc include/linux/slab.h:557 [inline]
vmci_ctx_get_chkpt_doorbells drivers/misc/vmw_vmci/vmci_context.c:746 [inline]
vmci_ctx_get_chkpt_state+0x6a0/0xf30 drivers/misc/vmw_vmci/vmci_context.c:798
vmci_host_do_ctx_get_cpt_state drivers/misc/vmw_vmci/vmci_host.c:719 [inline]
vmci_host_unlocked_ioctl+0x2e02/0x59a0 drivers/misc/vmw_vmci/vmci_host.c:939
vfs_ioctl fs/ioctl.c:48 [inline]
__do_sys_ioctl fs/ioctl.c:753 [inline]
__se_sys_ioctl+0x311/0x4d0 fs/ioctl.c:739
__x64_sys_ioctl+0x4a/0x70 fs/ioctl.c:739
do_syscall_64+0x9f/0x140 arch/x86/entry/common.c:48
entry_SYSCALL_64_after_hwframe+0x44/0xa9

Bytes 8-15 of 16 are uninitialized
Memory access of size 16 starts at ffff8881248eec00
Data copied to user address 0000000020000540
=====================================================


---
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.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

syzbot

unread,
Nov 22, 2020, 5:09:07 PM11/22/20
to anant.th...@gmail.com, gli...@google.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+a79e17...@syzkaller.appspotmail.com

Tested on:

commit: 73d62e81 kmsan: random: prevent boot-time reports in _mix_..
git tree: https://github.com/google/kmsan.git master
kernel config: https://syzkaller.appspot.com/x/.config?x=cbcec003f6760f79
dashboard link: https://syzkaller.appspot.com/bug?extid=a79e17c39564bedf0930
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project.git ca2dcbd030eadbf0aa9b660efe864ff08af6e18b)
patch: https://syzkaller.appspot.com/x/patch.diff?x=11f726d1500000

Note: testing is done by a robot and is best-effort only.

syzbot

unread,
Nov 22, 2020, 5:40:07 PM11/22/20
to anant.th...@gmail.com, gli...@google.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
KMSAN: kernel-infoleak in vmci_host_unlocked_ioctl

=====================================================
BUG: KMSAN: kernel-infoleak in kmsan_copy_to_user+0x9c/0xb0 mm/kmsan/kmsan_hooks.c:249
CPU: 0 PID: 9999 Comm: syz-executor.1 Not tainted 5.10.0-rc4-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x21c/0x280 lib/dump_stack.c:118
kmsan_report+0xf7/0x1e0 mm/kmsan/kmsan_report.c:118
kmsan_internal_check_memory+0x484/0x520 mm/kmsan/kmsan.c:437
kmsan_copy_to_user+0x9c/0xb0 mm/kmsan/kmsan_hooks.c:249
instrument_copy_to_user include/linux/instrumented.h:121 [inline]
_copy_to_user+0x16e/0x240 lib/usercopy.c:33
copy_to_user include/linux/uaccess.h:209 [inline]
vmci_host_do_ctx_get_cpt_state drivers/misc/vmw_vmci/vmci_host.c:723 [inline]
vmci_host_unlocked_ioctl+0x3486/0x59a0 drivers/misc/vmw_vmci/vmci_host.c:939
vfs_ioctl fs/ioctl.c:48 [inline]
__do_sys_ioctl fs/ioctl.c:753 [inline]
__se_sys_ioctl+0x311/0x4d0 fs/ioctl.c:739
__x64_sys_ioctl+0x4a/0x70 fs/ioctl.c:739
do_syscall_64+0x9f/0x140 arch/x86/entry/common.c:48
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45deb9
Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f1ebf035c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000010140 RCX: 000000000045deb9
RDX: 0000000020001540 RSI: 00000000000007b1 RDI: 0000000000000003
RBP: 000000000118bf60 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118bf2c
R13: 00007fff78cb504f R14: 00007f1ebf0369c0 R15: 000000000118bf2c

Uninit was created at:
kmsan_save_stack_with_flags mm/kmsan/kmsan.c:121 [inline]
kmsan_internal_poison_shadow+0x5c/0xf0 mm/kmsan/kmsan.c:104
kmsan_slab_alloc+0x8d/0xe0 mm/kmsan/kmsan_hooks.c:76
slab_alloc_node mm/slub.c:2906 [inline]
slab_alloc mm/slub.c:2915 [inline]
__kmalloc+0x2f0/0x530 mm/slub.c:3983
kmalloc include/linux/slab.h:557 [inline]
vmci_ctx_get_chkpt_doorbells drivers/misc/vmw_vmci/vmci_context.c:746 [inline]
vmci_ctx_get_chkpt_state+0x6a0/0xf30 drivers/misc/vmw_vmci/vmci_context.c:798
vmci_host_do_ctx_get_cpt_state drivers/misc/vmw_vmci/vmci_host.c:719 [inline]
vmci_host_unlocked_ioctl+0x2e02/0x59a0 drivers/misc/vmw_vmci/vmci_host.c:939
vfs_ioctl fs/ioctl.c:48 [inline]
__do_sys_ioctl fs/ioctl.c:753 [inline]
__se_sys_ioctl+0x311/0x4d0 fs/ioctl.c:739
__x64_sys_ioctl+0x4a/0x70 fs/ioctl.c:739
do_syscall_64+0x9f/0x140 arch/x86/entry/common.c:48
entry_SYSCALL_64_after_hwframe+0x44/0xa9

Bytes 8-15 of 16 are uninitialized
Memory access of size 16 starts at ffff8880145e4540
Data copied to user address 0000000020000540
=====================================================


Tested on:

commit: 73d62e81 kmsan: random: prevent boot-time reports in _mix_..
git tree: https://github.com/google/kmsan.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=17519069500000
Reply all
Reply to author
Forward
0 new messages