From 8912ad073fd7d7110a57acbfa0b33d4dad9d1ee1 Mon Sep 17 00:00:00 2001 From: Albert Cahalan Date: Sun, 21 Sep 2003 23:23:42 -0700 Subject: [PATCH] [PATCH] shared signals require shared VM Elimination of this nonsense allows for the assumption that a task group shares VM. This lets procps run faster. --- kernel/fork.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernel/fork.c b/kernel/fork.c index f2d3115483dad..2005c5c180de4 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -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. -- 2.53.0