From 9454b65682ea66200f54d5d36ed2c0d340412d86 Mon Sep 17 00:00:00 2001 From: apio Date: Thu, 12 Jan 2023 17:59:17 +0100 Subject: [PATCH] allocate_memory: Respect PROT_NONE --- kernel/src/sys/allocate_memory.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/src/sys/allocate_memory.cpp b/kernel/src/sys/allocate_memory.cpp index 84083cc7..5203d551 100644 --- a/kernel/src/sys/allocate_memory.cpp +++ b/kernel/src/sys/allocate_memory.cpp @@ -33,6 +33,7 @@ Result sys_allocate_memory(Registers*, SyscallArgs args) int mmu_flags = MMU::User | MMU::NoExecute; if (flags & PROT_WRITE) mmu_flags |= MMU::ReadWrite; if (flags & PROT_EXEC) mmu_flags &= ~MMU::NoExecute; + if (flags == PROT_NONE) mmu_flags = MMU::NoExecute; kdbgln("allocate_memory: allocating memory at %#lx", address);