Commit 002984e2 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] AB-BA deadlock between uidhash_lock and tasklist_lock.

switch_uid() doesn't care about tasklist_lock, so do it outside
the lock and avoid a subtle (and very very unlikely to trigger)
AB-BA deadlock.
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ba169c30
...@@ -242,9 +242,8 @@ void reparent_to_init(void) ...@@ -242,9 +242,8 @@ void reparent_to_init(void)
memcpy(current->signal->rlim, init_task.signal->rlim, memcpy(current->signal->rlim, init_task.signal->rlim,
sizeof(current->signal->rlim)); sizeof(current->signal->rlim));
atomic_inc(&(INIT_USER->__count)); atomic_inc(&(INIT_USER->__count));
switch_uid(INIT_USER);
write_unlock_irq(&tasklist_lock); write_unlock_irq(&tasklist_lock);
switch_uid(INIT_USER);
} }
void __set_special_pids(pid_t session, pid_t pgrp) void __set_special_pids(pid_t session, pid_t pgrp)
......
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