Commit 9a789fcf authored by Mathieu Desnoyers's avatar Mathieu Desnoyers Committed by Ingo Molnar

rseq/cleanup: Do not abort rseq c.s. in child on fork()

Considering that we explicitly forbid system calls in rseq critical
sections, it is not valid to issue a fork or clone system call within a
rseq critical section, so rseq_fork() is not required to restart an
active rseq c.s. in the child process.
Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Ben Maurer <bmaurer@fb.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Chris Lameter <cl@linux.com>
Cc: Dave Watson <davejwatson@fb.com>
Cc: Joel Fernandes <joelaf@google.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Paul E . McKenney <paulmck@linux.vnet.ibm.com>
Cc: Paul Turner <pjt@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-api@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org
Link: https://lore.kernel.org/lkml/20180619133230.4087-4-mathieu.desnoyers@efficios.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 0ea73d5e
...@@ -1831,9 +1831,7 @@ static inline void rseq_migrate(struct task_struct *t) ...@@ -1831,9 +1831,7 @@ static inline void rseq_migrate(struct task_struct *t)
/* /*
* If parent process has a registered restartable sequences area, the * If parent process has a registered restartable sequences area, the
* child inherits. Only applies when forking a process, not a thread. In * child inherits. Only applies when forking a process, not a thread.
* case a parent fork() in the middle of a restartable sequence, set the
* resume notifier to force the child to retry.
*/ */
static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags) static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags)
{ {
...@@ -1847,7 +1845,6 @@ static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags) ...@@ -1847,7 +1845,6 @@ static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags)
t->rseq_len = current->rseq_len; t->rseq_len = current->rseq_len;
t->rseq_sig = current->rseq_sig; t->rseq_sig = current->rseq_sig;
t->rseq_event_mask = current->rseq_event_mask; t->rseq_event_mask = current->rseq_event_mask;
rseq_preempt(t);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment