From fc473ac261d412184f60fd6611aa06109bb961c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sun, 7 Aug 2022 18:11:09 +0200 Subject: [PATCH] kernel/vm: _user_set_memory_protection() should only check the user protection as it extends the provided protection with the kernel protection. fix hrev55016 Change-Id: I9fa9349c15b4ef896a9dadd1b1b7a4165cc03b39 Reviewed-on: https://review.haiku-os.org/c/haiku/+/5531 Tested-by: Commit checker robot Reviewed-by: waddlesplash --- src/system/kernel/vm/vm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/kernel/vm/vm.cpp b/src/system/kernel/vm/vm.cpp index 941232c851..b6eefeb338 100644 --- a/src/system/kernel/vm/vm.cpp +++ b/src/system/kernel/vm/vm.cpp @@ -6647,7 +6647,7 @@ _user_set_memory_protection(void* _address, size_t size, uint32 protection) if ((area->protection & B_KERNEL_AREA) != 0) return B_NOT_ALLOWED; if (area->protection_max != 0 - && (protection & area->protection_max) != protection) { + && (protection & area->protection_max) != (protection & B_USER_PROTECTION)) { return B_NOT_ALLOWED; }