linux/drivers/virt/acrn
Haoyu Li 4e15cf870d drivers: virt: acrn: hsm: Use kzalloc to avoid info leak in pmcmd_ioctl
commit 819cec1dc4 upstream.

In the "pmcmd_ioctl" function, three memory objects allocated by
kmalloc are initialized by "hcall_get_cpu_state", which are then
copied to user space. The initializer is indeed implemented in
"acrn_hypercall2" (arch/x86/include/asm/acrn.h). There is a risk of
information leakage due to uninitialized bytes.

Fixes: 3d679d5aec ("virt: acrn: Introduce interfaces to query C-states and P-states allowed by hypervisor")
Signed-off-by: Haoyu Li <lihaoyu499@gmail.com>
Cc: stable <stable@kernel.org>
Acked-by: Fei Li <fei1.li@intel.com>
Link: https://lore.kernel.org/r/20250130115811.92424-1-lihaoyu499@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-03-13 12:51:11 +01:00
..
acrn_drv.h virt: acrn: Prefer array_size and struct_size over open coded arithmetic 2024-06-16 13:39:31 +02:00
hsm.c drivers: virt: acrn: hsm: Use kzalloc to avoid info leak in pmcmd_ioctl 2025-03-13 12:51:11 +01:00
hypercall.h virt: acrn: Introduce an interface for Service VM to control vCPU 2021-02-09 10:58:19 +01:00
ioeventfd.c virt: acrn: Introduce ioeventfd 2021-02-09 10:58:19 +01:00
ioreq.c virt: acrn: Introduce I/O ranges operation interfaces 2021-02-09 10:58:19 +01:00
irqfd.c virt: acrn: Use EPOLLIN instead of POLLIN 2021-03-10 09:50:23 +01:00
Kconfig virt: acrn: Introduce ioeventfd 2021-02-09 10:58:19 +01:00
Makefile virt: acrn: Introduce irqfd 2021-02-09 10:58:19 +01:00
mm.c drivers/virt/acrn: fix PFNMAP PTE checks in acrn_vm_ram_map() 2024-06-16 13:39:32 +02:00
vm.c virt: acrn: Do hcall_destroy_vm() before resource release 2021-07-27 16:48:45 +02:00