[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/20] linux-user: Clear translations on mprotect()
From: |
Richard Henderson |
Subject: |
[PULL 05/20] linux-user: Clear translations on mprotect() |
Date: |
Thu, 1 Sep 2022 07:51:55 +0100 |
From: Ilya Leoshkevich <iii@linux.ibm.com>
Currently it's possible to execute pages that do not have PAGE_EXEC
if there is an existing translation block. Fix by invalidating TBs
that touch the affected pages.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-Id: <20220817150506.592862-2-iii@linux.ibm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/mmap.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 048c4135af..6a828e8418 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -177,9 +177,11 @@ int target_mprotect(abi_ulong start, abi_ulong len, int
target_prot)
goto error;
}
}
+
page_set_flags(start, start + len, page_flags);
- mmap_unlock();
- return 0;
+ tb_invalidate_phys_range(start, start + len);
+ ret = 0;
+
error:
mmap_unlock();
return ret;
--
2.34.1
- [PULL 00/20] tcg patch queue, Richard Henderson, 2022/09/01
- [PULL 01/20] linux-user/arm: Mark the commpage executable, Richard Henderson, 2022/09/01
- [PULL 1/4] target/avr: Support probe argument to tlb_fill, Richard Henderson, 2022/09/01
- [PULL 02/20] linux-user/hppa: Allocate page zero as a commpage, Richard Henderson, 2022/09/01
- [PULL 2/4] target/avr: Call avr_cpu_do_interrupt directly, Richard Henderson, 2022/09/01
- [PULL 06/20] tests/tcg/i386: Move smc_code2 to an executable section, Richard Henderson, 2022/09/01
- [PULL 10/20] accel/tcg: Make tb_htable_lookup static, Richard Henderson, 2022/09/01
- [PULL 05/20] linux-user: Clear translations on mprotect(),
Richard Henderson <=
- [PULL 07/20] accel/tcg: Introduce is_same_page(), Richard Henderson, 2022/09/01
- [PULL 12/20] accel/tcg: Use probe_access_internal for softmmu get_page_addr_code_hostp, Richard Henderson, 2022/09/01
- [PULL 4/4] target/avr: Disable interrupts when env->skip set, Richard Henderson, 2022/09/01
- [PULL 11/20] accel/tcg: Move qemu_ram_addr_from_host_nofail to physmem.c, Richard Henderson, 2022/09/01
- [PULL 03/20] linux-user/x86_64: Allocate vsyscall page as a commpage, Richard Henderson, 2022/09/01
- [PULL 3/4] target/avr: Only execute one interrupt at a time, Richard Henderson, 2022/09/01
- [PULL 04/20] linux-user: Honor PT_GNU_STACK, Richard Henderson, 2022/09/01
- [PULL 14/20] accel/tcg: Remove translator_ldsw, Richard Henderson, 2022/09/01
- [PULL 09/20] accel/tcg: Unlock mmap_lock after longjmp, Richard Henderson, 2022/09/01
- [PULL 08/20] accel/tcg: Properly implement get_page_addr_code for user-only, Richard Henderson, 2022/09/01