|
@@ -578,6 +578,9 @@ ErrorOr<FlatPtr> Process::sys$annotate_mapping(Userspace<void*> address, int fla
|
|
if (flags == to_underlying(VirtualMemoryRangeFlags::None))
|
|
if (flags == to_underlying(VirtualMemoryRangeFlags::None))
|
|
return EINVAL;
|
|
return EINVAL;
|
|
|
|
|
|
|
|
+ if (!address)
|
|
|
|
+ return EINVAL;
|
|
|
|
+
|
|
if (!Memory::is_user_address(address.vaddr()))
|
|
if (!Memory::is_user_address(address.vaddr()))
|
|
return EFAULT;
|
|
return EFAULT;
|
|
|
|
|
|
@@ -585,11 +588,6 @@ ErrorOr<FlatPtr> Process::sys$annotate_mapping(Userspace<void*> address, int fla
|
|
if (space->enforces_syscall_regions() && (flags & to_underlying(VirtualMemoryRangeFlags::SyscallCode)))
|
|
if (space->enforces_syscall_regions() && (flags & to_underlying(VirtualMemoryRangeFlags::SyscallCode)))
|
|
return EPERM;
|
|
return EPERM;
|
|
|
|
|
|
- if (!address) {
|
|
|
|
- space->set_enforces_syscall_regions(true);
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
auto* region = space->find_region_containing(Memory::VirtualRange { address.vaddr(), 1 });
|
|
auto* region = space->find_region_containing(Memory::VirtualRange { address.vaddr(), 1 });
|
|
if (!region)
|
|
if (!region)
|
|
return EINVAL;
|
|
return EINVAL;
|