summaryrefslogtreecommitdiff
path: root/sys/kern/kern_physio.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-11-29 12:24:19 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-11-29 12:24:19 +0000
commit83368008eb99b7d2d9cb6f221de83c9af517b654 (patch)
tree0a2dbd431fbc167b1d69b949392ff3f47e6a82ef /sys/kern/kern_physio.c
parente83961e1eb1bda3be0177245339cfd8037ed4c4a (diff)
Kernel stack can be swapped. This means that stuff that's on the stack
should never be referenced outside the context of the process to which this stack belongs unless we do the PHOLD/PRELE dance. Loads of code doesn't follow the rules here. Instead of trying to track down all offenders and fix this hairy situation, it makes much more sense to not swap kernel stacks. From art@, tested by many some time ago.
Diffstat (limited to 'sys/kern/kern_physio.c')
-rw-r--r--sys/kern/kern_physio.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c
index 436436be615..a6489286910 100644
--- a/sys/kern/kern_physio.c
+++ b/sys/kern/kern_physio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_physio.c,v 1.25 2006/11/15 17:25:40 jmc Exp $ */
+/* $OpenBSD: kern_physio.c,v 1.26 2006/11/29 12:24:17 miod Exp $ */
/* $NetBSD: kern_physio.c,v 1.28 1997/05/19 10:43:28 pk Exp $ */
/*-
@@ -157,7 +157,6 @@ physio(void (*strategy)(struct buf *), struct buf *bp, dev_t dev, int flags,
* saves it in b_saveaddr. However, vunmapbuf()
* restores it.
*/
- PHOLD(p);
error = uvm_vslock(p, bp->b_data, todo,
(flags & B_READ) ?
VM_PROT_READ | VM_PROT_WRITE : VM_PROT_READ);
@@ -198,7 +197,6 @@ physio(void (*strategy)(struct buf *), struct buf *bp, dev_t dev, int flags,
vunmapbuf(bp, todo);
uvm_vsunlock(p, bp->b_data, todo);
after_unlock:
- PRELE(p);
/* remember error value (save a splbio/splx pair) */
if (bp->b_flags & B_ERROR)