acrn-kernel/drivers/xen
Harshit Mogalapalli 4da411086f xen/privcmd: Fix a possible warning in privcmd_ioctl_mmap_resource()
[ Upstream commit 8b997b2bb2 ]

As 'kdata.num' is user-controlled data, if user tries to allocate
memory larger than(>=) MAX_ORDER, then kcalloc() will fail, it
creates a stack trace and messes up dmesg with a warning.

Call trace:
-> privcmd_ioctl
--> privcmd_ioctl_mmap_resource

Add __GFP_NOWARN in order to avoid too large allocation warning.
This is detected by static analysis using smatch.

Fixes: 3ad0876554 ("xen/privcmd: add IOCTL_PRIVCMD_MMAP_RESOURCE")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20221126050745.778967-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:31:59 +01:00
..
events
xen-pciback xen-pciback: Allow setting PCI_MSIX_FLAGS_MASKALL too 2022-11-14 13:29:10 +01:00
xenbus xen: branch for v6.0-rc7 2022-09-23 08:31:24 -07:00
xenfs
Kconfig xen: Kconfig: Fix spelling mistake "Maxmium" -> "Maximum" 2022-10-12 08:39:50 +02:00
Makefile
acpi.c
arm-device.c
balloon.c
biomerge.c
cpu_hotplug.c
dbgp.c
efi.c
evtchn.c
features.c
gntalloc.c
gntdev-common.h xen/gntdev: Accommodate VMA splitting 2022-10-06 10:40:21 +02:00
gntdev-dmabuf.c
gntdev-dmabuf.h
gntdev.c xen/gntdev: Accommodate VMA splitting 2022-10-06 10:40:21 +02:00
grant-dma-iommu.c
grant-dma-ops.c xen/virtio: Convert PAGE_SIZE/PAGE_SHIFT/PFN_UP to Xen counterparts 2022-10-14 14:22:23 +02:00
grant-table.c
manage.c
mcelog.c
mem-reservation.c
pci.c
pcpu.c xen/pcpu: fix possible memory leak in register_pcpu() 2022-11-14 13:29:07 +01:00
platform-pci.c xen/platform-pci: use define instead of literal number 2022-11-15 07:34:13 +01:00
privcmd-buf.c
privcmd.c xen/privcmd: Fix a possible warning in privcmd_ioctl_mmap_resource() 2022-12-31 13:31:59 +01:00
privcmd.h
pvcalls-back.c
pvcalls-front.c
pvcalls-front.h
swiotlb-xen.c
sys-hypervisor.c
time.c
unpopulated-alloc.c
xen-acpi-pad.c
xen-acpi-processor.c
xen-balloon.c
xen-front-pgdir-shbuf.c
xen-scsiback.c SCSI misc on 20221007 2022-10-07 12:33:18 -07:00
xlate_mmu.c