Passing "0" or "FALSE" as the fourth argument to vm_fault is wrong. It
should be "VM_FAULT_NORMAL".
This commit is contained in:
parent
92e43b6747
commit
49c5eada3d
@ -439,7 +439,8 @@ trap(a0, a1, a2, entry, framep)
|
||||
/* Fault in the user page: */
|
||||
rv = vm_fault(map, va, ftype,
|
||||
(ftype & VM_PROT_WRITE)
|
||||
? VM_FAULT_DIRTY : 0);
|
||||
? VM_FAULT_DIRTY
|
||||
: VM_FAULT_NORMAL);
|
||||
|
||||
--p->p_lock;
|
||||
} else {
|
||||
@ -447,7 +448,7 @@ trap(a0, a1, a2, entry, framep)
|
||||
* Don't have to worry about process
|
||||
* locking or stacks in the kernel.
|
||||
*/
|
||||
rv = vm_fault(map, va, ftype, FALSE);
|
||||
rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL);
|
||||
}
|
||||
|
||||
nogo:;
|
||||
|
@ -664,7 +664,8 @@ trap_pfault(frame, usermode, eva)
|
||||
|
||||
/* Fault in the user page: */
|
||||
rv = vm_fault(map, va, ftype,
|
||||
(ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY : 0);
|
||||
(ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY
|
||||
: VM_FAULT_NORMAL);
|
||||
|
||||
--p->p_lock;
|
||||
} else {
|
||||
@ -679,7 +680,7 @@ trap_pfault(frame, usermode, eva)
|
||||
* always have pte pages mapped, we just have to fault
|
||||
* the page.
|
||||
*/
|
||||
rv = vm_fault(kernel_map, va, ftype, FALSE);
|
||||
rv = vm_fault(kernel_map, va, ftype, VM_FAULT_NORMAL);
|
||||
}
|
||||
|
||||
if (rv == KERN_SUCCESS)
|
||||
@ -778,14 +779,15 @@ trap_pfault(frame, usermode, eva)
|
||||
|
||||
/* Fault in the user page: */
|
||||
rv = vm_fault(map, va, ftype,
|
||||
(ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY : 0);
|
||||
(ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY
|
||||
: VM_FAULT_NORMAL);
|
||||
|
||||
--p->p_lock;
|
||||
} else {
|
||||
/*
|
||||
* Don't have to worry about process locking or stacks in the kernel.
|
||||
*/
|
||||
rv = vm_fault(map, va, ftype, FALSE);
|
||||
rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL);
|
||||
}
|
||||
|
||||
if (rv == KERN_SUCCESS)
|
||||
|
@ -172,7 +172,7 @@ procfs_rwmem(curp, p, uio)
|
||||
/*
|
||||
* Fault the page on behalf of the process
|
||||
*/
|
||||
error = vm_fault(map, pageno, reqprot, FALSE);
|
||||
error = vm_fault(map, pageno, reqprot, VM_FAULT_NORMAL);
|
||||
if (error) {
|
||||
error = EFAULT;
|
||||
break;
|
||||
|
@ -664,7 +664,8 @@ trap_pfault(frame, usermode, eva)
|
||||
|
||||
/* Fault in the user page: */
|
||||
rv = vm_fault(map, va, ftype,
|
||||
(ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY : 0);
|
||||
(ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY
|
||||
: VM_FAULT_NORMAL);
|
||||
|
||||
--p->p_lock;
|
||||
} else {
|
||||
@ -679,7 +680,7 @@ trap_pfault(frame, usermode, eva)
|
||||
* always have pte pages mapped, we just have to fault
|
||||
* the page.
|
||||
*/
|
||||
rv = vm_fault(kernel_map, va, ftype, FALSE);
|
||||
rv = vm_fault(kernel_map, va, ftype, VM_FAULT_NORMAL);
|
||||
}
|
||||
|
||||
if (rv == KERN_SUCCESS)
|
||||
@ -778,14 +779,15 @@ trap_pfault(frame, usermode, eva)
|
||||
|
||||
/* Fault in the user page: */
|
||||
rv = vm_fault(map, va, ftype,
|
||||
(ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY : 0);
|
||||
(ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY
|
||||
: VM_FAULT_NORMAL);
|
||||
|
||||
--p->p_lock;
|
||||
} else {
|
||||
/*
|
||||
* Don't have to worry about process locking or stacks in the kernel.
|
||||
*/
|
||||
rv = vm_fault(map, va, ftype, FALSE);
|
||||
rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL);
|
||||
}
|
||||
|
||||
if (rv == KERN_SUCCESS)
|
||||
|
@ -664,7 +664,8 @@ trap_pfault(frame, usermode, eva)
|
||||
|
||||
/* Fault in the user page: */
|
||||
rv = vm_fault(map, va, ftype,
|
||||
(ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY : 0);
|
||||
(ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY
|
||||
: VM_FAULT_NORMAL);
|
||||
|
||||
--p->p_lock;
|
||||
} else {
|
||||
@ -679,7 +680,7 @@ trap_pfault(frame, usermode, eva)
|
||||
* always have pte pages mapped, we just have to fault
|
||||
* the page.
|
||||
*/
|
||||
rv = vm_fault(kernel_map, va, ftype, FALSE);
|
||||
rv = vm_fault(kernel_map, va, ftype, VM_FAULT_NORMAL);
|
||||
}
|
||||
|
||||
if (rv == KERN_SUCCESS)
|
||||
@ -778,14 +779,15 @@ trap_pfault(frame, usermode, eva)
|
||||
|
||||
/* Fault in the user page: */
|
||||
rv = vm_fault(map, va, ftype,
|
||||
(ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY : 0);
|
||||
(ftype & VM_PROT_WRITE) ? VM_FAULT_DIRTY
|
||||
: VM_FAULT_NORMAL);
|
||||
|
||||
--p->p_lock;
|
||||
} else {
|
||||
/*
|
||||
* Don't have to worry about process locking or stacks in the kernel.
|
||||
*/
|
||||
rv = vm_fault(map, va, ftype, FALSE);
|
||||
rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL);
|
||||
}
|
||||
|
||||
if (rv == KERN_SUCCESS)
|
||||
|
@ -172,7 +172,7 @@ procfs_rwmem(curp, p, uio)
|
||||
/*
|
||||
* Fault the page on behalf of the process
|
||||
*/
|
||||
error = vm_fault(map, pageno, reqprot, FALSE);
|
||||
error = vm_fault(map, pageno, reqprot, VM_FAULT_NORMAL);
|
||||
if (error) {
|
||||
error = EFAULT;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user