1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:48:12 +00:00

Kernel: Ptrace should not assert on poke in non-mapped tracee memory

This commit is contained in:
Andreas Kling 2020-12-20 18:45:08 +01:00
parent 9bf02c32c0
commit 02ef3f6343

View file

@ -75,7 +75,8 @@ KResult Process::poke_user_data(Userspace<u32*> address, u32 data)
ProcessPagingScope scope(*this);
Range range = { VirtualAddress(address), sizeof(u32) };
auto* region = find_region_containing(range);
ASSERT(region != nullptr);
if (!region)
return KResult(-EFAULT);
if (region->is_shared()) {
// If the region is shared, we change its vmobject to a PrivateInodeVMObject
// to prevent the write operation from changing any shared inode data