Module Name: src Committed By: njoly Date: Fri Nov 27 12:25:10 UTC 2009
Modified Files: src/sys/uvm: uvm_unix.c Log Message: Make break(2) reject high adresses that wrap to 0 after page rounding. To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sys/uvm/uvm_unix.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/uvm/uvm_unix.c diff -u src/sys/uvm/uvm_unix.c:1.41 src/sys/uvm/uvm_unix.c:1.42 --- src/sys/uvm/uvm_unix.c:1.41 Wed Mar 4 21:52:38 2009 +++ src/sys/uvm/uvm_unix.c Fri Nov 27 12:25:10 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_unix.c,v 1.41 2009/03/04 21:52:38 christos Exp $ */ +/* $NetBSD: uvm_unix.c,v 1.42 2009/11/27 12:25:10 njoly Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -50,7 +50,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uvm_unix.c,v 1.41 2009/03/04 21:52:38 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_unix.c,v 1.42 2009/11/27 12:25:10 njoly Exp $"); #include "opt_pax.h" @@ -86,7 +86,8 @@ mutex_enter(&p->p_auxlock); old = (vaddr_t)vm->vm_daddr; new = round_page((vaddr_t)SCARG(uap, nsize)); - if ((new - old) > p->p_rlimit[RLIMIT_DATA].rlim_cur && new > old) { + if (new == 0 || + ((new - old) > p->p_rlimit[RLIMIT_DATA].rlim_cur && new > old)) { mutex_exit(&p->p_auxlock); return (ENOMEM); }