Null pointers are always invalid, so don't bother going through all the various checks for them.
@@ -1371,6 +1371,8 @@ static KernelMemoryCheckResult check_kernel_memory_access(LinearAddress laddr, b
bool Process::validate_read_from_kernel(LinearAddress laddr) const
{
+ if (laddr.is_null())
+ return false;
// We check extra carefully here since the first 4MB of the address space is identity-mapped.
// This code allows access outside of the known used address ranges to get caught.
auto kmc_result = check_kernel_memory_access(laddr, false);