From 5e7019bf324072c7fcb1c70f9e55bf4f2533b5b1 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Sat, 31 May 2003 21:21:35 +0000 Subject: [PATCH] Now that we have the signal trampolines in the gateway page and the gateway page is considered kernel space, we can panic when we should only SIGSEGV. Hence, add the additional constraint that for page faults we also require running with kernel privileges. The gateway page is the only kernel code running with user privileges, iso this is a correct way to exclude the gateway page from kernel land. We do not currently exclude the gateway page for other faults as it is not always the right way to do it. Further tuning will happen on a case by case bases. --- sys/ia64/ia64/trap.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/ia64/ia64/trap.c b/sys/ia64/ia64/trap.c index c70726a1c21f..2fedb8fe24cf 100644 --- a/sys/ia64/ia64/trap.c +++ b/sys/ia64/ia64/trap.c @@ -696,7 +696,13 @@ trap(int vector, struct trapframe *framep) goto out; no_fault_in: - if (!user) { + /* + * Additionally check the privilege level. We don't want to + * panic when we're in the gateway page, running at user + * level. + */ + if (!user && (framep->tf_special.psr & IA64_PSR_CPL) + == IA64_PSR_CPL_KERN) { /* Check for copyin/copyout fault. */ if (td != NULL && td->td_pcb->pcb_onfault != 0) { framep->tf_special.iip =