summaryrefslogtreecommitdiff
path: root/sys/src/9/port/fault.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-02-02 10:41:51 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2014-02-02 10:41:51 +0100
commit29eea45931f6ae094bb2be5c82d7ad6641dc1e65 (patch)
tree3a67e2d0f4fb8403f0e88aa7fb690e0dd59a4a4f /sys/src/9/port/fault.c
parent0b95485db79d3033cacd42038f0cf575e430e066 (diff)
kernel: do not pass user address of fd[2] array to newfd2()
access to user memory can pagefault and newfd2() holds fgrp spinlock while writing to it. make temporary copy on the stack in syspipe().
Diffstat (limited to 'sys/src/9/port/fault.c')
-rw-r--r--sys/src/9/port/fault.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/src/9/port/fault.c b/sys/src/9/port/fault.c
index 55a739bc3..9b2d05392 100644
--- a/sys/src/9/port/fault.c
+++ b/sys/src/9/port/fault.c
@@ -14,8 +14,11 @@ fault(uintptr addr, int read)
if(up == nil)
panic("fault: nil up");
- if(up->nlocks.ref)
- print("fault: nlocks %ld\n", up->nlocks.ref);
+ if(up->nlocks.ref){
+ Lock *l = up->lastlock;
+ print("fault: nlocks %ld, proc %lud %s, addr %#p, lock %#p, lpc %#p\n",
+ up->nlocks.ref, up->pid, up->text, addr, l, l ? l->pc : 0);
+ }
pnd = up->notepending;
sps = up->psstate;