mbox series

[for-8.1,0/2] linux-user: Fix MAP_SHARED_VALIDATE, MAP_FIXED_NOREPLACE

Message ID 20230808025542.50392-1-richard.henderson@linaro.org
Headers show
Series linux-user: Fix MAP_SHARED_VALIDATE, MAP_FIXED_NOREPLACE | expand

Message

Richard Henderson Aug. 8, 2023, 2:55 a.m. UTC
Fixes LTP mmap17 (MAP_FIXED_NOREPLACE) and mmap20 (MAP_SHARED_VALIDATE),
both of which were added to linux-user during the 8.1 cycle, and so
would be nice to fix right away.

Does not fix mmap18, which will fail depending on the guest memory map.
The real kernel avoids placing new maps immediately prior to GROWSDOWN
regions (leaving them no room into which to expand) and qemu does not.
This is a long-standing problem and will not be fixable for 8.1.

Reported-by: Michael Tokarev <mjt@tls.msk.ru>


r~


Richard Henderson (2):
  linux-user: Split out do_mmap
  linux-user: Use ARRAY_SIZE with bitmask_transtbl

 bsd-user/syscall_defs.h   |  2 +
 include/exec/user/thunk.h | 15 ++++--
 linux-user/syscall.c      | 96 +++++++++++++++++++++++++++++----------
 linux-user/thunk.c        | 24 +++++-----
 4 files changed, 98 insertions(+), 39 deletions(-)