diff options
author | Max Erenberg <merenber@uwaterloo.ca> | 2023-12-25 18:44:32 -0500 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2024-01-08 19:26:21 +0300 |
commit | 0bf355e6ca947b119b5d6b91a349ec607a137d94 (patch) | |
tree | d8ab6131256285c2cc978e41c719fd9843816e90 /pythondeps.toml | |
parent | 6e3cfd598cb9665689a485f1a25dff7c55023120 (diff) | |
download | qemu-0bf355e6ca947b119b5d6b91a349ec607a137d94.zip qemu-0bf355e6ca947b119b5d6b91a349ec607a137d94.tar.gz qemu-0bf355e6ca947b119b5d6b91a349ec607a137d94.tar.bz2 |
edu: fix DMA range upper bound check
The edu_check_range function checks that start <= end1 < end2, where
end1 is the upper bound (exclusive) of the guest-supplied DMA range and
end2 is the upper bound (exclusive) of the device's allowed DMA range.
When the guest tries to transfer exactly DMA_SIZE (4096) bytes, end1
will be equal to end2, so the check fails and QEMU aborts with this
puzzling error message (newlines added for formatting):
qemu: hardware error: EDU: DMA range
0x0000000000040000-0x0000000000040fff out of bounds
(0x0000000000040000-0x0000000000040fff)!
By checking end1 <= end2 instead, guests will be allowed to transfer
exactly 4096 bytes. It is not necessary to explicitly check for
start <= end1 because the previous two checks (within(addr, start, end2)
and end1 > addr) imply start < end1.
Fixes: b30934cb52a7 ("hw: misc, add educational driver", 2015-01-21)
Signed-off-by: Max Erenberg <merenber@uwaterloo.ca>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(cherry picked from commit 2c5107e1b455d4a157124f021826ead4e04b4aea)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'pythondeps.toml')
0 files changed, 0 insertions, 0 deletions