qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/5] linux-user: Unset MAP_FIXED_NOREPLACE for host


From: Richard Henderson
Subject: Re: [PATCH 1/5] linux-user: Unset MAP_FIXED_NOREPLACE for host
Date: Mon, 31 Jul 2023 08:43:41 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

On 7/31/23 01:03, Akihiko Odaki wrote:
Passing MAP_FIXED_NOREPLACE to host will fail if the virtual
address space is reserved with mmap. Replace it with MAP_FIXED.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
  linux-user/mmap.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index a5dfb56545..2f26cbaf5d 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -610,6 +610,8 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int 
target_prot,
              goto fail;
          }
+ flags = (flags & ~MAP_FIXED_NOREPLACE) | MAP_FIXED;

This is wrong for 64-bit guests, when reserved_va is not in effect.


r~




reply via email to

[Prev in Thread] Current Thread [Next in Thread]