|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [for-4.18] Re: [PATCH v2] arm/ioreq: guard interaction data on read/write operations
(+ Henry) Hi Andrii,@Henry, this patch is a candidate for Xen 4.18. The fix is self-contained in the IOREQ code which is in tech preview. So I think the risk is limited. On 05/10/2023 10:21, Andrii Chepurnyi wrote: For read operations, there's a potential issue when the data field of the ioreq struct is partially updated in the response. To address this, zero data field during read operations. This modification serves as a safeguard against implementations that may inadvertently partially update the data field in response to read requests. For instance, consider an 8-bit read operation. In such cases, QEMU, returns the same content of the dat field with only 8 bits of updated data. This behavior could potentially result in the propagation of incorrect or unintended data to ioreq clients. There is also a good point to guard interaction data with actual size of the interaction. I don't quite understand the last sentence. Is it meant to justify why the two other changes? I.e.: * Masking the value for a write * Masking the value returned by the Device-Model Please use 1U.
I would add a comment on top with:"The Arm Arm requires the value to be zero-extended to the size of the register. The Device Model is not meant to touch the bits outside of the access size, but let's not trust that."
Please use 1U.
This change seems to be spurious? - p.data = get_user_reg(regs, info->dabt.reg); + p.data = p.dir ? 0 : get_user_reg(regs, info->dabt.reg) & access_mask; For this case, I would add:"During a write access, the Device Model only need to know the content of the bits associated with the access size (e.g. for 8-bit, the lower 8-bits). During a read access, the Device Model don't need to know any value. So restrict the value it can access." Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |