Skip to content

Commit 76518d3

Browse files
bernd-edlingerebiederm
authored andcommitted
proc: io_accounting: Use new infrastructure to fix deadlocks in execve
This changes do_io_accounting to use the new exec_update_mutex instead of cred_guard_mutex. This fixes possible deadlocks when the trace is accessing /proc/$pid/io for instance. This should be safe, as the credentials are only used for reading. Signed-off-by: Bernd Edlinger <[email protected]> Signed-off-by: Eric W. Biederman <[email protected]>
1 parent 2db9dbf commit 76518d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/proc/base.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2883,7 +2883,7 @@ static int do_io_accounting(struct task_struct *task, struct seq_file *m, int wh
28832883
unsigned long flags;
28842884
int result;
28852885

2886-
result = mutex_lock_killable(&task->signal->cred_guard_mutex);
2886+
result = mutex_lock_killable(&task->signal->exec_update_mutex);
28872887
if (result)
28882888
return result;
28892889

@@ -2919,7 +2919,7 @@ static int do_io_accounting(struct task_struct *task, struct seq_file *m, int wh
29192919
result = 0;
29202920

29212921
out_unlock:
2922-
mutex_unlock(&task->signal->cred_guard_mutex);
2922+
mutex_unlock(&task->signal->exec_update_mutex);
29232923
return result;
29242924
}
29252925

0 commit comments

Comments
 (0)