virtio-devices: pmem: 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:
Rob Bradford
2026-04-18 11:18:46 +01:00
parent 82d426162d
commit 8685eb5c53

View File

@@ -115,7 +115,7 @@ impl Request {
return Err(Error::UnexpectedWriteOnlyDescriptor);
}
if desc.len() as usize != size_of::<VirtioPmemReq>() {
if (desc.len() as usize) < size_of::<VirtioPmemReq>() {
return Err(Error::InvalidRequest);
}