diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-11-26 09:18:13 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-11-26 09:18:13 +0000 |
commit | 44f2de9d092a7920666054f9be7b72617cf1e25b (patch) | |
tree | 9d91d33537da30564716c1f09375ff5afbe6844e /sys/compat/linux | |
parent | f2eb552cb851dda28c686807bc78ca9983a01193 (diff) |
enforce VM_PROT_READ in mmap
Diffstat (limited to 'sys/compat/linux')
-rw-r--r-- | sys/compat/linux/linux_misc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 83bae49e180..92754f2e790 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_misc.c,v 1.12 1997/11/13 18:35:26 deraadt Exp $ */ +/* $OpenBSD: linux_misc.c,v 1.13 1997/11/26 09:18:12 deraadt Exp $ */ /* $NetBSD: linux_misc.c,v 1.27 1996/05/20 01:59:21 fvdl Exp $ */ /* @@ -503,6 +503,8 @@ linux_sys_mmap(p, v, retval) SCARG(&cma,addr) = lmap.lm_addr; SCARG(&cma,len) = lmap.lm_len; + if (lmap.lm_prot & VM_PROT_WRITE) /* XXX */ + lmap.lm_prot |= VM_PROT_READ; SCARG(&cma,prot) = lmap.lm_prot; SCARG(&cma,flags) = flags; SCARG(&cma,fd) = lmap.lm_fd; |