From 6e1f209af1a563ac4f86e77b4e30571cdc4884e9 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Wed, 13 Aug 2003 03:20:10 +0000 Subject: [PATCH] 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. --- sys/ia64/ia64/trap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/ia64/ia64/trap.c b/sys/ia64/ia64/trap.c index af2bea7f655c..3391dff89a45 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;