summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_pipe.c
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>1999-09-20 19:08:48 +0000
committerdillon <dillon@FreeBSD.org>1999-09-20 19:08:48 +0000
commite8761b4e052785153d92b664a5dbe32e4a1de18e (patch)
treedcac6780728b4221aa67e14342e5541829c1b0c5 /sys/kern/sys_pipe.c
parent93e77b056762475c3c25ed8a6e2f428c8969b448 (diff)
downloadFreeBSD-src-e8761b4e052785153d92b664a5dbe32e4a1de18e.zip
FreeBSD-src-e8761b4e052785153d92b664a5dbe32e4a1de18e.tar.gz
Fix bug in pipe code relating to writes of mmap'd but illegal address
spaces which cross a segment boundry in the page table. pmap_kextract() is not designed for access to the user space portion of the page table and cannot handle the null-page-directory-entry case. The fix is to have vm_fault_quick() return a success or failure which is then used to avoid calling pmap_kextract().
Diffstat (limited to 'sys/kern/sys_pipe.c')
-rw-r--r--sys/kern/sys_pipe.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index c8f8e35..ee883ed 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -490,9 +490,8 @@ pipe_build_write_buffer(wpipe, uio)
vm_page_t m;
- vm_fault_quick( (caddr_t) addr, VM_PROT_READ);
- paddr = pmap_kextract(addr);
- if (!paddr) {
+ if (vm_fault_quick((caddr_t)addr, VM_PROT_READ) < 0 ||
+ (paddr = pmap_kextract(addr)) == 0) {
int j;
for(j=0;j<i;j++)
vm_page_unwire(wpipe->pipe_map.ms[j], 1);
OpenPOWER on IntegriCloud