+ c-r-prctl-drop-vma-flags-test-on-pr_set_mm_-stack-data-assignment.patch added to -mm tree

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

 



The patch titled
     Subject: c/r: prctl: drop VMA flags test on PR_SET_MM_ stack data assignment
has been added to the -mm tree.  Its filename is
     c-r-prctl-drop-vma-flags-test-on-pr_set_mm_-stack-data-assignment.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Cyrill Gorcunov <gorcunov@xxxxxxxxx>
Subject: c/r: prctl: drop VMA flags test on PR_SET_MM_ stack data assignment


With the

 | commit b76437579d1344b612cf1851ae610c636cec7db0
 | Author: Siddhesh Poyarekar <siddhesh.poyarekar@xxxxxxxxx>
 | Date:   Wed Mar 21 16:34:04 2012 -0700
 |
 | procfs: mark thread stack correctly in proc/<pid>/maps

the stack allocated via clone() is marked in /proc/<pid>/maps as
[stack:%d] thus it might be out of the former mm->start_stack/end_stack
values (and even has some custom VMA flags set).  So to be able to restore
mm->start_stack/end_stack drop vma flags test, but still require the
underlying VMA to exist.

As always note this feature is under CONFIG_CHECKPOINT_RESTORE and
requires CAP_SYS_RESOURCE to be granted.

Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxxx>
Cc: Oleg Nesterov <oleg@xxxxxxxxxx>
Cc: Kees Cook <keescook@xxxxxxxxxxxx>
Cc: Pavel Emelyanov <xemul@xxxxxxxxxxxxx>
Cc: Serge Hallyn <serge.hallyn@xxxxxxxxxxxxx>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 kernel/sys.c |   14 --------------
 1 file changed, 14 deletions(-)

diff -puN kernel/sys.c~c-r-prctl-drop-vma-flags-test-on-pr_set_mm_-stack-data-assignment kernel/sys.c
--- a/kernel/sys.c~c-r-prctl-drop-vma-flags-test-on-pr_set_mm_-stack-data-assignment
+++ a/kernel/sys.c
@@ -1704,14 +1704,6 @@ SYSCALL_DEFINE1(umask, int, mask)
 }
 
 #ifdef CONFIG_CHECKPOINT_RESTORE
-static bool vma_flags_mismatch(struct vm_area_struct *vma,
-			       unsigned long required,
-			       unsigned long banned)
-{
-	return (vma->vm_flags & required) != required ||
-		(vma->vm_flags & banned);
-}
-
 static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd)
 {
 	struct vm_area_struct *vma;
@@ -1847,12 +1839,6 @@ static int prctl_set_mm(int opt, unsigne
 			error = -EFAULT;
 			goto out;
 		}
-#ifdef CONFIG_STACK_GROWSUP
-		if (vma_flags_mismatch(vma, VM_READ | VM_WRITE | VM_GROWSUP, 0))
-#else
-		if (vma_flags_mismatch(vma, VM_READ | VM_WRITE | VM_GROWSDOWN, 0))
-#endif
-			goto out;
 		if (opt == PR_SET_MM_START_STACK)
 			mm->start_stack = addr;
 		else if (opt == PR_SET_MM_ARG_START)
_
Subject: Subject: c/r: prctl: drop VMA flags test on PR_SET_MM_ stack data assignment

Patches currently in -mm which might be from gorcunov@xxxxxxxxx are

linux-next.patch
sysctl-make-kernelns_last_pid-control-being-checkpoint_restore-dependent.patch
c-r-prctl-drop-vma-flags-test-on-pr_set_mm_-stack-data-assignment.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