summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2003-05-31 21:21:35 +0000
committermarcel <marcel@FreeBSD.org>2003-05-31 21:21:35 +0000
commit536604960e88de727e6b773972fd146420b306fd (patch)
treea8fc70a6d6fb3411e06da28773e73870e041b2ab /sys
parent3d538bff10c615a5e10d3931797f15b9a0adea79 (diff)
downloadFreeBSD-src-536604960e88de727e6b773972fd146420b306fd.zip
FreeBSD-src-536604960e88de727e6b773972fd146420b306fd.tar.gz
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/ia64/ia64/trap.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/ia64/ia64/trap.c b/sys/ia64/ia64/trap.c
index c70726a..2fedb8f 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 =
OpenPOWER on IntegriCloud