+ mprotect-patch-for-use-by-slim.patch added to -mm tree

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

 



The patch titled

     mprotect patch for use by SLIM

has been added to the -mm tree.  Its filename is

     mprotect-patch-for-use-by-slim.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: mprotect patch for use by SLIM
From: Kylene Jo Hall <kjhall@xxxxxxxxxx>

This small patch makes mprotect available for use by SLIM for write
revocation.

Updated to allow the usage locking to work properly.

Signed-off-by: Mimi Zohar <zohar@xxxxxxxxxx>
Signed-off-by: Kylene Hall <kjhall@xxxxxxxxxx>
Cc: Dave Safford <safford@xxxxxxxxxx>
Cc: Mimi Zohar <zohar@xxxxxxxxxx>
Cc: Serge Hallyn <sergeh@xxxxxxxxxx>
Cc: Chris Wright <chrisw@xxxxxxxxxxxx>
Cc: Stephen Smalley <sds@xxxxxxxxxxxxx>
Cc: James Morris <jmorris@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 include/linux/mm.h |    2 ++
 mm/mprotect.c      |   22 ++++++++++++++++------
 2 files changed, 18 insertions(+), 6 deletions(-)

diff -puN include/linux/mm.h~mprotect-patch-for-use-by-slim include/linux/mm.h
--- a/include/linux/mm.h~mprotect-patch-for-use-by-slim
+++ a/include/linux/mm.h
@@ -139,6 +139,8 @@ extern unsigned int kobjsize(const void 
 #define VM_EXEC		0x00000004
 #define VM_SHARED	0x00000008
 
+extern int do_mprotect(unsigned long start, size_t len, unsigned long prot);
+
 /* mprotect() hardcodes VM_MAYREAD >> 4 == VM_READ, and so for r/w/x bits. */
 #define VM_MAYREAD	0x00000010	/* limits for mprotect() etc */
 #define VM_MAYWRITE	0x00000020
diff -puN mm/mprotect.c~mprotect-patch-for-use-by-slim mm/mprotect.c
--- a/mm/mprotect.c~mprotect-patch-for-use-by-slim
+++ a/mm/mprotect.c
@@ -19,6 +19,7 @@
 #include <linux/mempolicy.h>
 #include <linux/personality.h>
 #include <linux/syscalls.h>
+#include <linux/module.h>
 #include <linux/swap.h>
 #include <linux/swapops.h>
 #include <asm/uaccess.h>
@@ -213,9 +214,10 @@ fail:
 	vm_unacct_memory(charged);
 	return error;
 }
-
-asmlinkage long
-sys_mprotect(unsigned long start, size_t len, unsigned long prot)
+/*
+ * Call holding the current->mm->mmap_sem for writing
+ */
+int do_mprotect(unsigned long start, size_t len, unsigned long prot)
 {
 	unsigned long vm_flags, nstart, end, tmp, reqprot;
 	struct vm_area_struct *vma, *prev;
@@ -245,8 +247,6 @@ sys_mprotect(unsigned long start, size_t
 
 	vm_flags = calc_vm_prot_bits(prot);
 
-	down_write(&current->mm->mmap_sem);
-
 	vma = find_vma_prev(current->mm, start, &prev);
 	error = -ENOMEM;
 	if (!vma)
@@ -309,6 +309,16 @@ sys_mprotect(unsigned long start, size_t
 		}
 	}
 out:
-	up_write(&current->mm->mmap_sem);
 	return error;
 }
+
+asmlinkage long
+sys_mprotect(unsigned long start, size_t len, unsigned long prot)
+{
+	int ret;
+
+	down_write(&current->mm->mmap_sem);
+	ret = do_mprotect(start, len, prot);
+	up_write(&current->mm->mmap_sem);
+	return ret;
+}
_

Patches currently in -mm which might be from kjhall@xxxxxxxxxx are

mprotect-patch-for-use-by-slim.patch
integrity-service-api-and-dummy-provider.patch
slim-main-patch.patch
slim-secfs-patch.patch
slim-make-and-config-stuff.patch
slim-debug-output.patch
slim-documentation.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux