diff options
author | Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | 2018-06-19 09:32:30 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-06-21 06:40:13 -0400 |
commit | 9a789fcfe8605417f7a1a970355f5efa4fe88c64 (patch) | |
tree | 5112863ffa94f3730db3f3e18475a69f05768be6 | |
parent | 0ea73d5e286193be4dec70d04021d6005b5b1771 (diff) |
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: Mathieu 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.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | include/linux/sched.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 87bf02d93a27..c1882643d455 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1831,9 +1831,7 @@ static inline void rseq_migrate(struct task_struct *t) | |||
1831 | 1831 | ||
1832 | /* | 1832 | /* |
1833 | * If parent process has a registered restartable sequences area, the | 1833 | * If parent process has a registered restartable sequences area, the |
1834 | * child inherits. Only applies when forking a process, not a thread. In | 1834 | * child inherits. Only applies when forking a process, not a thread. |
1835 | * case a parent fork() in the middle of a restartable sequence, set the | ||
1836 | * resume notifier to force the child to retry. | ||
1837 | */ | 1835 | */ |
1838 | static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags) | 1836 | static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags) |
1839 | { | 1837 | { |
@@ -1847,7 +1845,6 @@ static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags) | |||
1847 | t->rseq_len = current->rseq_len; | 1845 | t->rseq_len = current->rseq_len; |
1848 | t->rseq_sig = current->rseq_sig; | 1846 | t->rseq_sig = current->rseq_sig; |
1849 | t->rseq_event_mask = current->rseq_event_mask; | 1847 | t->rseq_event_mask = current->rseq_event_mask; |
1850 | rseq_preempt(t); | ||
1851 | } | 1848 | } |
1852 | } | 1849 | } |
1853 | 1850 | ||