linux/drivers/misc/vmw_vmci
Lizhi Xu 8282013b56 vmci: Prevent the dispatching of uninitialized payloads
The reproducer executes the host's unlocked_ioctl call in two different
tasks. When init_context fails, the struct vmci_event_ctx is not fully
initialized when executing vmci_datagram_dispatch() to send events to all
vm contexts. This affects the datagram taken from the datagram queue of
its context by another task, because the datagram payload is not initialized
according to the size payload_size, which causes the kernel data to leak
to the user space.

Before dispatching the datagram, and before setting the payload content,
explicitly set the payload content to 0 to avoid data leakage caused by
incomplete payload initialization.

To avoid the oob check failure when executing __compiletime_lessthan()
in memset(), directly use the address of the vmci_event_ctx instance ev
to replace ev.msg.hdr, because their addresses are the same.

Fixes: 28d6692cd8 ("VMCI: context implementation.")
Reported-by: syzbot+9b9124ae9b12d5af5d95@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=9b9124ae9b12d5af5d95
Tested-by: syzbot+9b9124ae9b12d5af5d95@syzkaller.appspotmail.com
Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com>
Link: https://lore.kernel.org/r/20250703075334.856445-1-lizhi.xu@windriver.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-07-16 14:23:57 +02:00
..
Kconfig
Makefile
vmci_context.c vmci: Prevent the dispatching of uninitialized payloads 2025-07-16 14:23:57 +02:00
vmci_context.h misc: vmw_vmci: Remove unused vmci_ctx functions 2025-06-24 16:45:35 +01:00
vmci_datagram.c VMCI: Fix possible memcpy() run-time warning in vmci_datagram_invoke_guest_handler() 2024-03-01 16:03:32 -08:00
vmci_datagram.h
vmci_doorbell.c misc: vmw_vmci: Remove unused vmci_doorbell_notify 2025-06-24 16:45:35 +01:00
vmci_doorbell.h
vmci_driver.c
vmci_driver.h
vmci_event.c vmci: prevent speculation leaks by sanitizing event in event_deliver() 2024-05-03 07:28:53 +02:00
vmci_event.h
vmci_guest.c Char/Misc and other driver subsystem changes for 6.10-rc1 2024-05-22 12:26:46 -07:00
vmci_handle_array.c VMCI: Remove handle_arr_calc_size() 2023-12-15 17:27:04 +01:00
vmci_handle_array.h Char/Misc and other Driver changes for 6.8-rc1 2024-01-17 16:47:17 -08:00
vmci_host.c VMCI: fix race between vmci_host_setup_notify and vmci_ctx_unset_notify 2025-05-21 14:52:38 +02:00
vmci_queue_pair.c misc: vmw_vmci: Remove unused qpair functions 2025-06-24 16:45:35 +01:00
vmci_queue_pair.h
vmci_resource.c VMCI: Fix use-after-free when removing resource in vmci_resource_remove() 2024-09-03 13:16:42 +02:00
vmci_resource.h
vmci_route.c
vmci_route.h