Fix tests for start+len address valid for guest
Status from this message: Thanks, applied.
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | target-sparc: Fix TARGET_{PHYS, VIRT}_ADDR_SPACE_BITS.target-sparc/ | +6 | 0 replies | |
| 2/7 | Add guest_start_len_valid function.cpu-all.h | +10 | 3 replies | |
| 3/7 | linux-user: Use guest_start_len_valid in msync.linux-user/ | +8 | 0 replies | |
| 4/7 | linux-user: Use guest_start_len_valid in mremap.linux-user/ | +24 | 0 replies | |
| 5/7 | linux-user: Use guest_start_len_valid in mmap.linux-user/ | +2 | 0 replies | |
| 6/7 | Fix zero-length write(2).exec.c | +3 | 1 reply | |
| 7/7 | Use guest_start_len_valid in page_check_range.exec.c | +1 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [Qemu-devel] [PATCH 0/7] Fix tests for start+len address valid for guest
The first patch in the series fixes a major think-o in the sparc port. The 64 and 32-bit constants were reversed. Fixing these are required to avoid a build error in later patches.
For the actual problem, introduce a guest_start_len_valid macro similar to the existing h2g_valid macro, where we compare the address range against TARGET_VIRT_ADDR_SPACE_BITS (or ULONG_MAX, depending on the host).
Use this in 3 places in the linux-user memory handling functions, and also in the generic page_check_range. In the later case, also remove a mis-conception that I had that page_check_range was already bounds checked -- these values come directly from a guest syscall and so can contain any random errant values.
r~
Richard Henderson (7):
target-sparc: Fix TARGET_{PHYS,VIRT}_ADDR_SPACE_BITS. Add guest_start_len_valid function.
linux-user: Use guest_start_len_valid in msync.
linux-user: Use guest_start_len_valid in mremap.
linux-user: Use guest_start_len_valid in mmap. Fix zero-length write(2).
Use guest_start_len_valid in page_check_range.
cpu-all.h | 10 ++++++++ exec.c | 12 +++------ linux-user/mmap.c | 65 +++++++++++++++++++++++++++------------------------ target-sparc/cpu.h | 12 ++++---- 4 files changed, 54 insertions(+), 45 deletions(-)