1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:27:35 +00:00

Kernel: Make sys$msyscall() EFAULT on non-user address

Fixes #5361.
This commit is contained in:
Andreas Kling 2021-02-16 11:32:00 +01:00
parent e438dd3c9b
commit 575c7ed414

View file

@ -563,6 +563,9 @@ int Process::sys$msyscall(void* address)
return 0;
}
if (!is_user_address(VirtualAddress { address }))
return -EFAULT;
auto* region = space().find_region_containing(Range { VirtualAddress { address }, 1 });
if (!region)
return -EINVAL;