Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jan 2007 22:52:15 GMT
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 113025 for review
Message-ID:  <200701162252.l0GMqFdx051482@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=113025

Change 113025 by jkim@jkim_hammer on 2007/01/16 22:52:01

	Check PROT_READ before setting PROT_EXEC.  Linux has added
	READ_IMPLIES_EXEC personality but we do not have the feature.
	We just assume it is always on to make it backward compatible.
	This fixes mmap05 LTP test case on amd64.

Affected files ...

.. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_machdep.c#21 edit

Differences ...

==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_machdep.c#21 (text+ko) ====

@@ -877,11 +877,12 @@
 	}
 
 	/*
-	 * We add PROT_EXEC to work around buggy applications (e.g. Java)
-	 * that take advantage of the fact that execute permissions are not
-	 * enforced by x86 CPUs.
+	 * Linux has added READ_IMPLIES_EXEC personality but we do not support
+	 * the feature yet. We just assume READ_IMPLIES_EXEC is always on.
 	 */
-	bsd_args.prot = linux_args->prot | PROT_EXEC;
+	if (linux_args->prot & PROT_READ)
+		bsd_args.prot = linux_args->prot | PROT_EXEC;
+
 	if (linux_args->flags & LINUX_MAP_ANON)
 		bsd_args.fd = -1;
 	else {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701162252.l0GMqFdx051482>