[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/24] bsd-user: Use page_check_range_empty for MAP_EXCL
From: |
Richard Henderson |
Subject: |
[PATCH 08/24] bsd-user: Use page_check_range_empty for MAP_EXCL |
Date: |
Fri, 30 Jun 2023 15:21:43 +0200 |
The previous check returned -1 when any page within
[start, start+len) is unmapped, not when all are unmapped.
Cc: Warner Losh <imp@bsdimp.com>
Cc: Kyle Evans <kevans@freebsd.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
bsd-user/mmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c
index 565b9f97ed..07b5b8055e 100644
--- a/bsd-user/mmap.c
+++ b/bsd-user/mmap.c
@@ -609,7 +609,7 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int
prot,
}
/* Reject the mapping if any page within the range is mapped */
- if ((flags & MAP_EXCL) && page_check_range(start, len, 0) < 0) {
+ if ((flags & MAP_EXCL) && !page_check_range_empty(start, end - 1)) {
errno = EINVAL;
goto fail;
}
--
2.34.1
- [PATCH for-8.1? 00/24] linux-user: mmap range fixes, Richard Henderson, 2023/06/30
- [PATCH 01/24] linux-user: Use assert in mmap_fork_start, Richard Henderson, 2023/06/30
- [PATCH 02/24] linux-user: Fix formatting of mmap.c, Richard Henderson, 2023/06/30
- [PATCH 06/24] linux-user: Populate more bits in mmap_flags_tbl, Richard Henderson, 2023/06/30
- [PATCH 04/24] linux-user: Split TARGET_MAP_* out of syscall_defs.h, Richard Henderson, 2023/06/30
- [PATCH 07/24] accel/tcg: Introduce page_check_range_empty, Richard Henderson, 2023/06/30
- [PATCH 03/24] linux-user/strace: Expand struct flags to hold a mask, Richard Henderson, 2023/06/30
- [PATCH 05/24] linux-user: Split TARGET_PROT_* out of syscall_defs.h, Richard Henderson, 2023/06/30
- [PATCH 08/24] bsd-user: Use page_check_range_empty for MAP_EXCL,
Richard Henderson <=
- [PATCH 11/24] linux-user: Widen target_mmap offset argument to off_t, Richard Henderson, 2023/06/30
- [PATCH 12/24] linux-user: Rewrite target_mprotect, Richard Henderson, 2023/06/30
- [PATCH 09/24] linux-user: Implement MAP_FIXED_NOREPLACE, Richard Henderson, 2023/06/30
- [PATCH 10/24] linux-user: Split out target_to_host_prot, Richard Henderson, 2023/06/30
- [PATCH 14/24] accel/tcg: Introduce page_find_range_empty, Richard Henderson, 2023/06/30
- [PATCH 13/24] linux-user: Rewrite mmap_frag, Richard Henderson, 2023/06/30
- [PATCH 18/24] linux-user: Rewrite mmap_reserve, Richard Henderson, 2023/06/30
- [PATCH 15/24] bsd-user: Use page_find_range_empty for mmap_find_vma_reserved, Richard Henderson, 2023/06/30