virtio-devices: console: Skip device-writable output descriptors

The output queue handler read data from every descriptor without
checking the write-only flag. The driver must not put device-writable
buffers in the transmitq. Skip them with a warning.

Signed-off-by: Rob Bradford <rbradford@meta.com>
Assisted-by: Claude:claude-opus-4-6
This commit is contained in:
Rob Bradford
2026-05-06 15:08:11 +01:00
parent 521b15bda6
commit 48123669b5

View File

@@ -261,6 +261,10 @@ impl ConsoleEpollHandler {
while let Some(mut desc_chain) = trans_queue.pop_descriptor_chain(self.mem.memory()) {
while let Some(desc) = desc_chain.next() {
if desc.is_write_only() {
warn!("Skipping device-writable descriptor on transmitq");
continue;
}
if let Some(out) = &mut self.out {
let mut buf: Vec<u8> = Vec::new();
desc_chain