Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/uvm Only include PROT_EXEC in maxprot if the user specif...



details:   https://anonhg.NetBSD.org/src/rev/3b0b357c7d01
branches:  trunk
changeset: 501764:3b0b357c7d01
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Jan 07 06:16:46 2001 +0000

description:
Only include PROT_EXEC in maxprot if the user specified PROT_EXEC
in the mmap() call.  maxprot is used to create device mappings,
and always including PROT_EXEC causes the mapping to fail on the Alpha
when mapping a non-RAM offset of /dev/mem (which may be sparse, so
instruction fetch from there is disallowed).

diffstat:

 sys/uvm/uvm_mmap.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 899cef351c9b -r 3b0b357c7d01 sys/uvm/uvm_mmap.c
--- a/sys/uvm/uvm_mmap.c        Sun Jan 07 06:16:02 2001 +0000
+++ b/sys/uvm/uvm_mmap.c        Sun Jan 07 06:16:46 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_mmap.c,v 1.46 2000/11/27 08:40:04 chs Exp $        */
+/*     $NetBSD: uvm_mmap.c,v 1.47 2001/01/07 06:16:46 thorpej Exp $    */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -428,7 +428,7 @@
                 * now check protection
                 */
 
-               maxprot = VM_PROT_EXECUTE;
+               maxprot = (prot & PROT_EXEC);
 
                /* check read access */
                if (fp->f_flag & FREAD)



Home | Main Index | Thread Index | Old Index