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 <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
Jérôme Duval 2022-08-07 18:11:09 +02:00 committed by waddlesplash
parent ee96bcfe51
commit fc473ac261

View File

@ -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;
}