From 83368008eb99b7d2d9cb6f221de83c9af517b654 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Wed, 29 Nov 2006 12:24:19 +0000 Subject: 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. --- sys/kern/kern_physio.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sys/kern/kern_physio.c') 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) -- cgit v1.2.3