]> xenbits.xensource.com Git - qemu-xen.git/commit
linux-user: Fix MAP_FIXED_NOREPLACE on old kernels
authorAkihiko Odaki <akihiko.odaki@daynix.com>
Wed, 2 Aug 2023 07:17:48 +0000 (16:17 +0900)
committerRichard Henderson <richard.henderson@linaro.org>
Sun, 6 Aug 2023 17:10:11 +0000 (10:10 -0700)
commitddcdd8c48fc48b2d528756fc98f1ce0ec3d7b617
treec1680ace1ec56ab7c0c2c97596907b6e3fccbb84
parentc3dd50da0f4d00fffe8ea5e211c2c189fe6ad4fb
linux-user: Fix MAP_FIXED_NOREPLACE on old kernels

The man page states:
> Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE
> flag will typically (upon detecting a collision with a preexisting
> mapping) fall back to a “non-MAP_FIXED” type of behavior: they will
> return an address that is different from the requested address.
> Therefore, backward-compatible software should check the returned
> address against the requested address.
https://man7.org/linux/man-pages/man2/mmap.2.html

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20230802071754.14876-3-akihiko.odaki@daynix.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
linux-user/mmap.c