die() misleads with KERNELBASE
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.
Updated by Electric Monk over 3 years ago
- Status changed from New to Closed
commit 086dcf7e86461fd5b1eb18e47d0e3d136a959e5e Author: Patrick Mooney <firstname.lastname@example.org> Date: 2017-10-10T15:21:08.000Z 8667 die() misleads with KERNELBASE Reviewed by: Jerry Jelinek <email@example.com> Reviewed by: Robert Mustacchi <firstname.lastname@example.org> Approved by: Gordon Ross <email@example.com>