From 73e40f2d6e97bb04abc88c25b09f3ded3fedfba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 31 May 2004 21:43:57 +0000 Subject: [PATCH] Small hack to get create_area() to create valid r/w areas in the kernel (in BeOS, all kernel areas are r/w). If you use B_READ_AREA/B_WRITE_AREA flags, you make the area readable or even writeable from userland! git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7700 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/vm/vm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kernel/core/vm/vm.c b/src/kernel/core/vm/vm.c index c576c90b16..98ed015728 100755 --- a/src/kernel/core/vm/vm.c +++ b/src/kernel/core/vm/vm.c @@ -2385,7 +2385,7 @@ map_physical_memory(const char *name, void *physicalAddress, size_t numBytes, if (convertAddressSpec(&addressSpec) < B_OK) return B_BAD_VALUE; - protection = PROTECTION_TO_LOCK(protection) | LOCK_KERNEL; + protection = PROTECTION_TO_LOCK(protection) | LOCK_KERNEL | LOCK_RW; return vm_map_physical_memory(vm_get_kernel_aspace_id(), name, _virtualAddress, addressSpec, numBytes, protection, (addr)physicalAddress); @@ -2433,7 +2433,7 @@ create_area(const char *name, void **address, uint32 addressSpec, size_t size, u case B_ANY_KERNEL_ADDRESS: case B_EXACT_KERNEL_ADDRESS: areaSpace = vm_get_kernel_aspace_id(); - protection |= LOCK_KERNEL; + protection |= LOCK_KERNEL | LOCK_RW; // That's required for BeOS compatibility... // create_area_etc() doesn't do this, though break;