summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1997-04-06 02:29:45 +0000
committerdyson <dyson@FreeBSD.org>1997-04-06 02:29:45 +0000
commit22d3427970e54f676e2b00c131968543d5e158cf (patch)
tree7f36ab36e674c55b0016224f8352f9e013e48992 /sys/kern
parent6bd5a8ae498a480fda8c82b49ba9792836b14e9f (diff)
downloadFreeBSD-src-22d3427970e54f676e2b00c131968543d5e158cf.zip
FreeBSD-src-22d3427970e54f676e2b00c131968543d5e158cf.tar.gz
Fix the gdb executable modify problem. Thanks to the detective work
by Alan Cox <alc@cs.rice.edu>, and his description of the problem. The bug was primarily in procfs_mem, but the mistake likely happened due to the lack of vm system support for the operation. I added better support for selective marking of page dirty flags so that vm_map_pageable(wiring) will not cause this problem again. The code in procfs_mem is now less bogus (but maybe still a little so.)
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_trap.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c
index 9dca842..5e1f171 100644
--- a/sys/kern/subr_trap.c
+++ b/sys/kern/subr_trap.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
- * $Id$
+ * $Id: trap.c,v 1.88 1997/02/22 09:32:55 peter Exp $
*/
/*
@@ -529,7 +529,8 @@ trap_pfault(frame, usermode)
}
/* Fault in the user page: */
- rv = vm_fault(map, va, ftype, FALSE);
+ rv = vm_fault(map, va, ftype,
+ (ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY : 0);
--p->p_lock;
} else {
@@ -630,14 +631,13 @@ trap_pfault(frame, usermode)
}
/* Fault in the user page: */
- rv = vm_fault(map, va, ftype, FALSE);
+ rv = vm_fault(map, va, ftype,
+ (ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY : 0);
--p->p_lock;
} else {
/*
- * Since we know that kernel virtual address addresses
- * always have pte pages mapped, we just have to fault
- * the page.
+ * Don't have to worry about process locking or stacks in the kernel.
*/
rv = vm_fault(map, va, ftype, FALSE);
}
@@ -808,7 +808,7 @@ int trapwrite(addr)
/*
* fault the data page
*/
- rv = vm_fault(&vm->vm_map, va, VM_PROT_READ|VM_PROT_WRITE, FALSE);
+ rv = vm_fault(&vm->vm_map, va, VM_PROT_READ|VM_PROT_WRITE, VM_FAULT_DIRTY);
--p->p_lock;
OpenPOWER on IntegriCloud