From 2e3843ffce78fd8b49ee7675f0ee0e8151e35d0a Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Wed, 1 Aug 2012 18:54:45 +0200 Subject: [PATCH] Fixed incorrect x86-family protection flags. --- sortix/x86-family/memorymanagement.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sortix/x86-family/memorymanagement.cpp b/sortix/x86-family/memorymanagement.cpp index 2ac3230b..c6e9d71e 100644 --- a/sortix/x86-family/memorymanagement.cpp +++ b/sortix/x86-family/memorymanagement.cpp @@ -380,14 +380,14 @@ namespace Sortix if ( prot & PROT_WRITE ) { result |= PML_USERSPACE | PML_WRITABLE; } if ( prot & PROT_KEXEC ) { result |= 0; } if ( prot & PROT_KREAD ) { result |= 0; } - if ( prot & PROT_KWRITE ) { result |= PML_WRITABLE; } + if ( prot & PROT_KWRITE ) { result |= 0; } if ( prot & PROT_FORK ) { result |= PML_FORK; } return result; } int PMLFlagsToProtection(addr_t flags) { - int prot = PROT_KREAD | PROT_KEXEC; + int prot = PROT_KREAD | PROT_KWRITE | PROT_KEXEC; bool user = flags & PML_USERSPACE; bool write = flags & PML_WRITABLE; if ( user ) { prot |= PROT_EXEC | PROT_READ; }