Commit cbdcf7f7 authored by Michal Hocko's avatar Michal Hocko Committed by Linus Torvalds
Browse files

mm, oom_reaper: do not use siglock in try_oom_reaper()

Oleg has noted that siglock usage in try_oom_reaper is both pointless
and dangerous.  signal_group_exit can be checked lockless.  The problem
is that sighand becomes NULL in __exit_signal so we can crash.

Fixes: 3ef22dff ("oom, oom_reaper: try to reap tasks which skip regular OOM killer path")

Signed-off-by: default avatarMichal Hocko <>
Suggested-by: default avatarOleg Nesterov <>
Cc: Tetsuo Handa <>
Cc: David Rientjes <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 83b9355b
......@@ -625,8 +625,6 @@ void try_oom_reaper(struct task_struct *tsk)
if (atomic_read(&mm->mm_users) > 1) {
for_each_process(p) {
bool exiting;
if (!process_shares_mm(p, mm))
if (fatal_signal_pending(p))
......@@ -636,10 +634,7 @@ void try_oom_reaper(struct task_struct *tsk)
* If the task is exiting make sure the whole thread group
* is exiting and cannot acces mm anymore.
exiting = signal_group_exit(p->signal);
if (exiting)
if (signal_group_exit(p->signal))
/* Give up */
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