linux/drivers/virtio
Michael S. Tsirkin 281eb4732a virtio_balloon: disable indirect descriptors
The page reporting callback submits an sg list to the reporting
virtqueue.  With VIRTIO_RING_F_INDIRECT_DESC negotiated and
total_sg > 1 (which it typically is), virtqueue_add reports it to the
host by allocating an indirect descriptor via kmalloc(GFP_KERNEL).

This is not pretty: the reporting worker isolates potentially hundreds
of MB of free pages from the buddy allocator (reported pages are at
least pageblock_order, and the sg can contain up to
PAGE_REPORTING_CAPACITY entries of varying orders).  As the result,
very theoretically, the kmalloc might trigger OOM when we have in fact a
ton of free memory.

Clear VIRTIO_RING_F_INDIRECT_DESC, to avoid using indirect descriptors.

Fixes: b0c504f154 ("virtio-balloon: add support for providing free page reports to host")
Assisted-by: Claude:claude-opus-4-6
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <73fac8a629fd9aca7bb3265ac243a769c28af25d.1783232420.git.mst@redhat.com>
History 2026-08-19 06:38:43 -04:00
..
Kconfig mm: rename CONFIG_MEMORY_BALLOON -> CONFIG_BALLOON 2026-01-31 14:22:36 -08:00
Makefile virtio_rtc: Add RTC class driver 2025-05-27 10:27:54 -04:00
virtio.c virtio: add num_vf callback to virtio_bus 2026-06-10 02:17:00 -04:00
virtio_anchor.c virtio: replace restricted mem access flag with callback 2022-08-01 07:42:49 +02:00
virtio_balloon.c virtio_balloon: disable indirect descriptors 2026-08-19 06:38:43 -04:00
virtio_debug.c virtio: clean up features qword/dword terms 2025-11-27 02:03:07 -05:00
virtio_dma_buf.c virtio: virtio_dma_buf: fix missing parameter documentation 2025-08-01 09:11:08 -04:00
virtio_input.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
virtio_mem.c virtio-mem: Destroy mutex before freeing virtio_mem 2026-06-10 02:16:59 -04:00
virtio_mmio.c virtio-mmio: add support for transport version 3 2026-08-19 06:38:43 -04:00
virtio_pci_admin_legacy_io.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
virtio_pci_common.c virtio_pci: fix vq info pointer lookup via wrong index 2026-06-04 01:18:12 -04:00
virtio_pci_common.h VFIO updates for v6.13 2024-11-27 12:57:03 -08:00
virtio_pci_legacy.c virtio: rename find_vqs_info() op to find_vqs() 2024-07-17 05:20:57 -04:00
virtio_pci_legacy_dev.c virtio_pci: Fix misleading comment for queue vector 2025-08-26 03:38:10 -04:00
virtio_pci_modern.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
virtio_pci_modern_dev.c virtio: clean up features qword/dword terms 2025-11-27 02:03:07 -05:00
virtio_ring.c virtio_ring: Add READ_ONCE annotations for device-writable fields 2026-06-10 02:16:59 -04:00
virtio_rtc_arm.c virtio_rtc: Add Arm Generic Timer cross-timestamping 2025-05-27 10:27:54 -04:00
virtio_rtc_class.c virtio_rtc: Add RTC class driver 2025-05-27 10:27:54 -04:00
virtio_rtc_driver.c virtio: rtc: tear down old virtqueues before restore 2026-06-10 02:14:02 -04:00
virtio_rtc_internal.h virtio_rtc: Add RTC class driver 2025-05-27 10:27:54 -04:00
virtio_rtc_ptp.c virtio_rtc: Use provided clock ID for history snapshot 2026-06-04 11:04:17 +02:00
virtio_vdpa.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00