Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lib/propolis/src/hw/virtio/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,10 +520,21 @@ impl VirtQueue {
false => ChainBuf::Readable(GuestAddr(desc.addr), desc.len),
};

count += 1;
len += desc.len;
chain.push_buf(buf);

if flags.contains(DescFlag::NEXT) {
// The virto spec states:
//
// A driver MUST NOT create a descriptor chain longer than
// the Queue Size of the device
if count >= self.size() {
// TODO (#1190): This needs to properly signal the error
// condition
chain.idx = None;
return None;
}
// XXX: better error handling
desc = idescs.get(desc.next as usize).unwrap();
flags = DescFlag::from_bits_truncate(desc.flags);
Expand Down