Skip to content

virtio-devices: balloon: Cap inflate and deflate descriptor length - #8177

Merged
rbradford merged 1 commit into
cloud-hypervisor:mainfrom
weltling:balloon-cap-len
May 8, 2026
Merged

virtio-devices: balloon: Cap inflate and deflate descriptor length#8177
rbradford merged 1 commit into
cloud-hypervisor:mainfrom
weltling:balloon-cap-len

Conversation

@weltling

@weltling weltling commented May 8, 2026

Copy link
Copy Markdown
Member

Hardening. The inflate and deflate queues carry a packed array of 32 bit Page Frame Number (PFN) entries. The spec puts no upper bound on desc.len. Meaning, for example, a guest can submit a descriptor with desc.len = 1 GiB over a small backing, and the device thread then walks 256M entries emitting one warn per unmapped PFN. This is a guest driven host log and worker DoS.

Cap desc.len at the Linux driver maximum of VIRTIO_BALLOON_ARRAY_PFNS_MAX PFN entries of 4 bytes each. No real driver hits the cap.

Drop inflate or deflate descriptors whose len exceeds the Linux
driver maximum of VIRTIO_BALLOON_ARRAY_PFNS_MAX PFN entries of 4
bytes each. Without the cap, a guest can submit a descriptor with
a huge len over a small backing and drive an unbounded warn loop
in the device thread.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
@weltling
weltling requested a review from a team as a code owner May 8, 2026 21:26
@rbradford
rbradford added this pull request to the merge queue May 8, 2026
Merged via the queue into cloud-hypervisor:main with commit cfec130 May 8, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants