]> git.hungrycats.org Git - linux/commitdiff
[PATCH] shared signals require shared VM
authorAlbert Cahalan <albert.cahalan@ccur.com>
Mon, 22 Sep 2003 06:23:42 +0000 (23:23 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 22 Sep 2003 06:23:42 +0000 (23:23 -0700)
Elimination of this nonsense allows for the assumption
that a task group shares VM. This lets procps run faster.

kernel/fork.c

index f2d3115483dad322e2246402381450df911948f0..2005c5c180de4f35f7a903abaf8a9e90e3f1df0e 100644 (file)
@@ -774,6 +774,14 @@ struct task_struct *copy_process(unsigned long clone_flags,
        if ((clone_flags & CLONE_THREAD) && !(clone_flags & CLONE_SIGHAND))
                return ERR_PTR(-EINVAL);
 
+       /*
+        * Shared signal handlers imply shared VM. By way of the above,
+        * thread groups also imply shared VM. Blocking this case allows
+        * for various simplifications in other code.
+        */
+       if ((clone_flags & CLONE_SIGHAND) && !(clone_flags & CLONE_VM))
+               return ERR_PTR(-EINVAL);
+
        /*
         * CLONE_DETACHED must match CLONE_THREAD: it's a historical
         * thing.