OSDN Git Service

linux-user: Fix shmdt
authorRichard Henderson <richard.henderson@linaro.org>
Sun, 20 Aug 2023 19:38:49 +0000 (12:38 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Fri, 1 Sep 2023 20:35:27 +0000 (13:35 -0700)
commitceda5688b650646248f269a992c06b11148c5759
tree21189e4e130433246adfb66243200abb36758f0b
parent69fa2708a216df715ba5102a0f98468b540a464e
linux-user: Fix shmdt

If the shm region is not mapped at shmaddr, EINVAL.
Do not unmap the region until the syscall succeeds.
Use mmap_reserve_or_unmap to preserve reserved_va semantics.

Tested-by: Helge Deller <deller@gmx.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
linux-user/mmap.c