Thread (2 messages) 2 messages, 2 authors, 2017-04-05

Re: [RFC][PATCH v2 3/5] clone: Disallown CLONE_THREAD with a shared sighand_struct

flat view

From: Oleg Nesterov <hidden>
Date: 2017-04-05 16:25:58
Also in: lkml

Possibly related (same subject, not in this thread)

On 04/02, Eric W. Biederman wrote:
quoted hunk ↗ jump to hunk
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1515,6 +1515,13 @@ static __latent_entropy struct task_struct *copy_process(
 	if ((clone_flags & CLONE_THREAD) && !(clone_flags & CLONE_SIGHAND))
 		return ERR_PTR(-EINVAL);

+	/* Disallow CLONE_THREAD with a shared SIGHAND structure.  No
+	 * one cares
Well, can't resists... I won't argue, but we can't know if no one cares
or not. I agree that most probably this won't break something, but who
knows... I am always scared when we add the incompatible changes.
and supporting it leads to unnecessarily complex
+	 * code.
+	 */
+	if ((clone_flags & CLONE_THREAD) && (atomic_read(&current->sighand->count) > 1))
+		return ERR_PTR(-EINVAL);
Perhaps the comment should explain why we do this and say that
sighand-unsharing in de_thread() depends on this.

Oleg.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help