Skip to content

Commit 326fc46

Browse files
committed
fix(balloon): make duplicate stats buffer visible to guest
When a non-compliant driver submits more than one stats buffer, process_stats_queue returns the previous descriptor via add_used but never calls advance_used_ring_idx or signal_used_queue. The write to the used ring is therefore invisible to the guest, which can never reclaim the buffer. Add the missing advance_used_ring_idx and signal_used_queue calls so the guest actually sees the returned descriptor. Signed-off-by: Nikita Kalyazin <kalyazin@amazon.com>
1 parent ed96b50 commit 326fc46

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/vmm/src/devices/virtio/balloon/device.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,8 @@ impl Balloon {
498498
// the protocol, but return it if we find one.
499499
error!("balloon: driver is not compliant, more than one stats buffer received");
500500
self.queues[STATS_INDEX].add_used(prev_stats_desc, 0)?;
501+
self.queues[STATS_INDEX].advance_used_ring_idx();
502+
self.signal_used_queue(STATS_INDEX)?;
501503
}
502504

503505
// Reject oversized descriptors to prevent a guest from causing

0 commit comments

Comments
 (0)