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
commit 02ef3f6343
Notes: sideshowbarker 2024-07-19 00:43:31 +09:00

View file

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