Bug #8667
die() misleads with KERNELBASE
Start date:
2017-09-21
Due date:
% Done:
100%
Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
Description
When panicking during a T_PGFLT trap, the die() function will customize the error message based on the fault address. It checks for addresses below KERNELBASE to signify an improper access to userspace (or a NULL pointer dereference for addresses in the first page). While this is fine on 32-bit kernels, 64-bit machines with large amounts of DRAM adjust 'kernelbase' relative to the segkpm mapping. This means that the true 'kernelbase' falls below KERNELBASE, leading to potentially confusing error messages.
If die() compares against 'kernelbase' instead, it will properly differentiate between improper userspace accesses and faults to kernel addresses.