mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: mem: Relax descriptor size check
The virtio spec allows the use of larger descriptors (for future expansion). Relax the bounds check to only reject descriptors that are too small. Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
@@ -293,7 +293,7 @@ impl Request {
|
||||
if desc.is_write_only() {
|
||||
return Err(Error::UnexpectedWriteOnlyDescriptor);
|
||||
}
|
||||
if desc.len() as usize != size_of::<VirtioMemReq>() {
|
||||
if (desc.len() as usize) < size_of::<VirtioMemReq>() {
|
||||
return Err(Error::InvalidRequest);
|
||||
}
|
||||
let req: VirtioMemReq = desc_chain
|
||||
|
||||
Reference in New Issue
Block a user