From 08afaf7cdf95d7ca7518dcfbbed57140cfa43af6 Mon Sep 17 00:00:00 2001 From: msmith Date: Mon, 28 Apr 1997 02:53:17 +0000 Subject: [PATCH] Always include PROT_READ for Linux mmap operations. Submitted by: Hannu Savolainen via jkh --- sys/compat/linux/linux_misc.c | 4 ++-- sys/i386/linux/linux_misc.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 9f88a75197d8..fc8bae9e3781 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: linux_misc.c,v 1.26 1997/03/24 11:24:30 bde Exp $ + * $Id: linux_misc.c,v 1.27 1997/04/01 08:39:06 bde Exp $ */ #include @@ -611,7 +611,7 @@ linux_mmap(struct proc *p, struct linux_mmap_args *args, int *retval) bsd_args.flags |= MAP_ANON; bsd_args.addr = linux_args.addr; bsd_args.len = linux_args.len; - bsd_args.prot = linux_args.prot; + bsd_args.prot = linux_args.prot | PROT_READ; /* always required */ bsd_args.fd = linux_args.fd; bsd_args.pos = linux_args.pos; bsd_args.pad = 0; diff --git a/sys/i386/linux/linux_misc.c b/sys/i386/linux/linux_misc.c index 9f88a75197d8..fc8bae9e3781 100644 --- a/sys/i386/linux/linux_misc.c +++ b/sys/i386/linux/linux_misc.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: linux_misc.c,v 1.26 1997/03/24 11:24:30 bde Exp $ + * $Id: linux_misc.c,v 1.27 1997/04/01 08:39:06 bde Exp $ */ #include @@ -611,7 +611,7 @@ linux_mmap(struct proc *p, struct linux_mmap_args *args, int *retval) bsd_args.flags |= MAP_ANON; bsd_args.addr = linux_args.addr; bsd_args.len = linux_args.len; - bsd_args.prot = linux_args.prot; + bsd_args.prot = linux_args.prot | PROT_READ; /* always required */ bsd_args.fd = linux_args.fd; bsd_args.pos = linux_args.pos; bsd_args.pad = 0;