Jesse Keating 2f82dda
This needs a fixed toolchain, and a userspace rebuild to work.
Jesse Keating 2f82dda
For these reasons, it's had difficulty getting upstream.
Jesse Keating 2f82dda
Jesse Keating 2f82dda
ie, Fedora has a new enough toolchain, and has been rebuilt, so we don't need
Jesse Keating 2f82dda
the ifdefs.  Other distros don't/haven't, and this patch would break them
Jesse Keating 2f82dda
if pushed upstream.
Jesse Keating 2f82dda
Jesse Keating 2f82dda
--- linux-2.6.26.noarch/security/selinux/hooks.c~	2008-09-25 14:11:17.000000000 -0400
Jesse Keating 2f82dda
+++ linux-2.6.26.noarch/security/selinux/hooks.c	2008-09-25 14:12:17.000000000 -0400
Jesse Keating 2f82dda
@@ -3018,7 +3018,6 @@ static int file_map_prot_check(struct fi
Jesse Keating 2f82dda
 	const struct cred *cred = current_cred();
Jesse Keating 2f82dda
 	int rc = 0;
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
-#ifndef CONFIG_PPC32
Jesse Keating 2f82dda
 	if ((prot & PROT_EXEC) && (!file || (!shared && (prot & PROT_WRITE)))) {
Jesse Keating 2f82dda
 		/*
Jesse Keating 2f82dda
 		 * We are making executable an anonymous mapping or a
Jesse Keating 2f82dda
@@ -3029,7 +3028,6 @@ static int file_map_prot_check(struct fi
Jesse Keating 2f82dda
 		if (rc)
Jesse Keating 2f82dda
 			goto error;
Jesse Keating 2f82dda
 	}
Jesse Keating 2f82dda
-#endif
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
 	if (file) {
Jesse Keating 2f82dda
 		/* read access is always possible with a mapping */
Jesse Keating 2f82dda
@@ -3024,7 +3022,6 @@ static int selinux_file_mprotect(struct 
Jesse Keating 2f82dda
 	if (selinux_checkreqprot)
Jesse Keating 2f82dda
 		prot = reqprot;
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
-#ifndef CONFIG_PPC32
Jesse Keating 2f82dda
 	if ((prot & PROT_EXEC) && !(vma->vm_flags & VM_EXEC)) {
Jesse Keating 2f82dda
 		rc = 0;
Jesse Keating 2f82dda
 		if (vma->vm_start >= vma->vm_mm->start_brk &&
Jesse Keating 2f82dda
@@ -3049,7 +3046,6 @@ static int selinux_file_mprotect(struct 
Jesse Keating 2f82dda
 		if (rc)
Jesse Keating 2f82dda
 			return rc;
Jesse Keating 2f82dda
 	}
Jesse Keating 2f82dda
-#endif
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
 	return file_map_prot_check(vma->vm_file, prot, vma->vm_flags&VM_SHARED);
Jesse Keating 2f82dda
 }