Re: [syzbot] [kernel?] KMSAN: kernel-infoleak in vmci_host_unlocked_ioctl (3)
From: Hillf Danton
Date: Sun Jun 22 2025 - 00:47:09 EST
On Thu, 19 Jun 2025 16:57:26 -0700
> syzbot found the following issue on:
>
> HEAD commit: 08215f5486ec Merge tag 'kbuild-fixes-v6.16' of git://git.k..
> git tree: upstream
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=13f7fd70580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=61539536677af51c
> dashboard link: https://syzkaller.appspot.com/bug?extid=9b9124ae9b12d5af5d95
> compiler: Debian clang version 20.1.6 (++20250514063057+1e4d39e07757-1~exp1~20250514183223.118), Debian LLD 20.1.6
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17f7fd70580000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1485690c580000
#syz test
--- x/drivers/misc/vmw_vmci/vmci_context.c
+++ y/drivers/misc/vmw_vmci/vmci_context.c
@@ -535,6 +535,7 @@ int vmci_ctx_dequeue_datagram(struct vmc
(u32) *max_size);
return VMCI_ERROR_NO_MEM;
}
+ *max_size = dq_entry->dg_size;
list_del(list_item);
context->pending_datagrams--;
--- x/drivers/misc/vmw_vmci/vmci_host.c
+++ y/drivers/misc/vmw_vmci/vmci_host.c
@@ -435,7 +435,7 @@ static int vmci_host_do_receive_datagram
if (recv_info.result >= VMCI_SUCCESS) {
void __user *ubuf = (void __user *)(uintptr_t)recv_info.addr;
- retval = copy_to_user(ubuf, dg, VMCI_DG_SIZE(dg));
+ retval = copy_to_user(ubuf, dg, size);
kfree(dg);
if (retval != 0)
return -EFAULT;
--