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:
Daniel Verkamp 2022-08-31 15:50:41 -07:00 committed by crosvm LUCI
parent c1c37179e1
commit 02214710df

View file

@ -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)