mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Don't use VM_MIN_KERNEL_ADDRESS to check if the faulting address is
in user space or kernel space. VM_MIN_KERNEL_ADDRESS starts after the gateway page, which means that improper memory accesses to the gateway page while in user mode would panic the kernel. Use VM_MAX_ADDRESS instead. It ends before the gateway page. The difference between VM_MIN_KERNEL_ADDRESS and VM_MAX_ADDRESS is exactly the gateway page.
This commit is contained in:
parent
46add12552
commit
6e1f209af1
1 changed files with 2 additions and 2 deletions
|
|
@ -589,10 +589,10 @@ trap(int vector, struct trapframe *framep)
|
|||
rv = 0;
|
||||
va = trunc_page(framep->tf_special.ifa);
|
||||
|
||||
if (va >= VM_MIN_KERNEL_ADDRESS) {
|
||||
if (va >= VM_MAX_ADDRESS) {
|
||||
/*
|
||||
* Don't allow user-mode faults for kernel virtual
|
||||
* addresses
|
||||
* addresses, including the gateway page.
|
||||
*/
|
||||
if (user)
|
||||
goto no_fault_in;
|
||||
|
|
|
|||
Loading…
Reference in a new issue