Skip to content

Commit 9a789fc

Browse files
compudjIngo Molnar
authored andcommitted
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 <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Ben Maurer <[email protected]> Cc: Boqun Feng <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Chris Lameter <[email protected]> Cc: Dave Watson <[email protected]> Cc: Joel Fernandes <[email protected]> Cc: Josh Triplett <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Michael Kerrisk <[email protected]> Cc: Paul E . McKenney <[email protected]> Cc: Paul Turner <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Russell King <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Will Deacon <[email protected]> Cc: [email protected] Cc: [email protected] Link: https://lore.kernel.org/lkml/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 0ea73d5 commit 9a789fc

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

include/linux/sched.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1831,9 +1831,7 @@ static inline void rseq_migrate(struct task_struct *t)
18311831

18321832
/*
18331833
* If parent process has a registered restartable sequences area, the
1834-
* child inherits. Only applies when forking a process, not a thread. In
1835-
* case a parent fork() in the middle of a restartable sequence, set the
1836-
* resume notifier to force the child to retry.
1834+
* child inherits. Only applies when forking a process, not a thread.
18371835
*/
18381836
static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags)
18391837
{
@@ -1847,7 +1845,6 @@ static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags)
18471845
t->rseq_len = current->rseq_len;
18481846
t->rseq_sig = current->rseq_sig;
18491847
t->rseq_event_mask = current->rseq_event_mask;
1850-
rseq_preempt(t);
18511848
}
18521849
}
18531850

0 commit comments

Comments
 (0)