validate number of indirect desc in pop_avail - #1188
Conversation
|
|
||
| if flags.contains(DescFlag::NEXT) { | ||
| if count == self.size() { | ||
| // XXX: signal error condition? |
There was a problem hiding this comment.
We need to address #1190 to properly solve this.
Currently return None and we also fail to return the descriptor to the used ring, this can leave the queue stalled or in an overall bad state.
iximeow
left a comment
There was a problem hiding this comment.
small thought on the comment but it probably applies to all the XXX: signal error condition? in here anyway. thanks for the improvement 🙏
|
|
||
| if flags.contains(DescFlag::NEXT) { | ||
| if count == self.size() { | ||
| // XXX: signal error condition? |
There was a problem hiding this comment.
in particular we can gate this on if count >= self.size() { .. } because VirtIO says
A driver MUST NOT create a descriptor chain longer than the Queue Size of the device
and it's probably useful to future readers to know this is a "driver MUST NOT" when actually signalling an error (rather than a "we'd really rather you not" like "the table shouldn't be gargantuan either please" - i don't see VirtIO describing a max size of the dscriptor table, just the length of the chainthrough it...)
The
pop_availfunction now validates that the number of indirect descriptors is not larger than the size of the virtio queue.Stack: