allocate_memory: Respect PROT_NONE

This commit is contained in:
apio 2023-01-12 17:59:17 +01:00
parent 586ca19b62
commit 9454b65682
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -33,6 +33,7 @@ Result<u64> sys_allocate_memory(Registers*, SyscallArgs args)
int mmu_flags = MMU::User | MMU::NoExecute; int mmu_flags = MMU::User | MMU::NoExecute;
if (flags & PROT_WRITE) mmu_flags |= MMU::ReadWrite; if (flags & PROT_WRITE) mmu_flags |= MMU::ReadWrite;
if (flags & PROT_EXEC) mmu_flags &= ~MMU::NoExecute; if (flags & PROT_EXEC) mmu_flags &= ~MMU::NoExecute;
if (flags == PROT_NONE) mmu_flags = MMU::NoExecute;
kdbgln("allocate_memory: allocating memory at %#lx", address); kdbgln("allocate_memory: allocating memory at %#lx", address);