From 38458c72672b8f53ebe43c4300e3bcd504cb5abc Mon Sep 17 00:00:00 2001 From: MemoryShore <105195940+MemoryShore@users.noreply.github.com> Date: Tue, 16 Jul 2024 19:26:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dmprotect=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E6=9C=AA=E6=AD=A3=E7=A1=AE=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?vm=5Fflags=E7=9A=84=E9=94=99=E8=AF=AF=20(#847)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/src/mm/ucontext.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/src/mm/ucontext.rs b/kernel/src/mm/ucontext.rs index f5d484bc4..8664cee32 100644 --- a/kernel/src/mm/ucontext.rs +++ b/kernel/src/mm/ucontext.rs @@ -556,6 +556,8 @@ impl InnerAddressSpace { return Err(SystemError::EACCES); } + r_guard.set_vm_flags(VmFlags::from(prot_flags)); + let new_flags: PageFlags = r_guard .flags() .set_execute(prot_flags.contains(ProtFlags::PROT_EXEC))