linux-stable/drivers/xen
Harshit Mogalapalli e0c5f1058e 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:25:46 +01:00
..
events xen: branch for v6.0-rc1b 2022-08-14 09:28:54 -07:00
xen-pciback xen-pciback: Allow setting PCI_MSIX_FLAGS_MASKALL too 2022-12-02 17:43:15 +01:00
xenbus xen: branch for v6.0-rc7 2022-09-23 08:31:24 -07:00
xenfs
Kconfig xen: don't require virtio with grants for non-PV guests 2022-08-01 07:43:03 +02:00
Makefile xen/grant-dma-iommu: Introduce stub IOMMU driver 2022-06-06 16:07:30 +02:00
acpi.c
arm-device.c
balloon.c xen/balloon: don't use PV mode extra memory for zone device allocations 2022-04-07 15:08:37 -05:00
biomerge.c
cpu_hotplug.c
dbgp.c
efi.c
evtchn.c
features.c x86/xen: Remove undefined behavior in setup_features() 2022-06-21 16:36:11 +02:00
gntalloc.c xen: switch gnttab_end_foreign_access() to take a struct page pointer 2022-05-27 11:05:29 +02:00
gntdev-common.h xen/gntdev: Accommodate VMA splitting 2022-10-21 12:37:43 +02:00
gntdev-dmabuf.c xen: switch gnttab_end_foreign_access() to take a struct page pointer 2022-05-27 11:05:29 +02:00
gntdev-dmabuf.h
gntdev.c xen/gntdev: Accommodate VMA splitting 2022-10-21 12:37:43 +02:00
grant-dma-iommu.c xen/grant-dma-iommu: Introduce stub IOMMU driver 2022-06-06 16:07:30 +02:00
grant-dma-ops.c xen: don't require virtio with grants for non-PV guests 2022-08-01 07:43:03 +02:00
grant-table.c xen/grants: prevent integer overflow in gnttab_dma_alloc_pages() 2022-09-02 11:05:19 +02:00
manage.c xen/manage: Use orderly_reboot() to reboot 2022-08-01 07:42:22 +02:00
mcelog.c
mem-reservation.c
pci.c xen/pci: Make use of the helper macro LIST_HEAD() 2022-02-10 11:10:23 +01:00
pcpu.c xen/pcpu: fix possible memory leak in register_pcpu() 2022-11-26 09:27:36 +01:00
platform-pci.c xen/platform-pci: add missing free_irq() in error path 2022-12-02 17:43:15 +01:00
privcmd-buf.c
privcmd.c xen/privcmd: Fix a possible warning in privcmd_ioctl_mmap_resource() 2022-12-31 13:25:46 +01:00
privcmd.h
pvcalls-back.c
pvcalls-front.c xen: switch gnttab_end_foreign_access() to take a struct page pointer 2022-05-27 11:05:29 +02:00
pvcalls-front.h
swiotlb-xen.c swiotlb-xen: fix DMA_ATTR_NO_KERNEL_MAPPING on arm 2022-05-11 19:48:32 +02:00
sys-hypervisor.c drivers/xen: use helper macro __ATTR_RW 2022-03-10 09:27:55 -06:00
time.c
unpopulated-alloc.c xen/balloon: don't use PV mode extra memory for zone device allocations 2022-04-07 15:08:37 -05:00
xen-acpi-pad.c
xen-acpi-processor.c
xen-balloon.c
xen-front-pgdir-shbuf.c xen: Fix spelling mistake 2022-08-01 07:42:42 +02:00
xen-scsiback.c xen: move from strlcpy with unused retval to strscpy 2022-08-25 13:38:07 +02:00
xlate_mmu.c xen: unexport __init-annotated xen_xlate_map_ballooned_pages() 2022-06-07 08:11:35 +02:00