summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2003-08-13 03:20:10 +0000
committermarcel <marcel@FreeBSD.org>2003-08-13 03:20:10 +0000
commitec1e7cccbaa3dfdfb058ff7ff7cde84f8b21c675 (patch)
tree7bf58d8c969efe0c9af6e641ff5dcb75699cc689 /sys
parent23077fe3b55685878e9a5cc253aac2a7311b2755 (diff)
downloadFreeBSD-src-ec1e7cccbaa3dfdfb058ff7ff7cde84f8b21c675.zip
FreeBSD-src-ec1e7cccbaa3dfdfb058ff7ff7cde84f8b21c675.tar.gz
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/ia64/ia64/trap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/ia64/ia64/trap.c b/sys/ia64/ia64/trap.c
index af2bea7..3391dff 100644
--- a/sys/ia64/ia64/trap.c
+++ b/sys/ia64/ia64/trap.c
@@ -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;
OpenPOWER on IntegriCloud