mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-09 03:57:24 +00:00
devices: vhost-user: remove incorrect get_config offset check
The offset field of the VHOST_USER_GET_CONFIG message indicates the offset within the whole device configuration, not within the buffer in the message, so offset does not need to be less than size. BUG=None TEST=connect fs device with modified read_config() impl Change-Id: Ifabac14ec087da200a09f41aa3a0041e96cf56f3 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3867542 Commit-Queue: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Abhishek Bhardwaj <abhishekbh@chromium.org>
This commit is contained in:
parent
c1c37179e1
commit
02214710df
1 changed files with 0 additions and 4 deletions
|
@ -629,10 +629,6 @@ impl<O: VhostUserPlatformOps> VhostUserSlaveReqHandlerMut for DeviceRequestHandl
|
|||
size: u32,
|
||||
_flags: VhostUserConfigFlags,
|
||||
) -> VhostResult<Vec<u8>> {
|
||||
if offset >= size {
|
||||
return Err(VhostError::InvalidParam);
|
||||
}
|
||||
|
||||
let mut data = vec![0; size as usize];
|
||||
self.backend.read_config(u64::from(offset), &mut data);
|
||||
Ok(data)
|
||||
|
|
Loading…
Reference in a new issue