random: fix locking dependency with the tasklist_lock
authorTheodore Ts'o <tytso@mit.edu>
Mon, 4 Mar 2013 16:59:12 +0000 (11:59 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 4 Mar 2013 17:05:15 +0000 (12:05 -0500)
Commit 6133705494bb introduced a circular lock dependency because
posix_cpu_timers_exit() is called by release_task(), which is holding
a writer lock on tasklist_lock, and this can cause a deadlock since
kill_fasync() gets called with nonblocking_pool.lock taken.

There's no reason why kill_fasync() needs to be taken while the random
pool is locked, so move it out to fix this locking dependency.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reported-by: Russ Dill <Russ.Dill@gmail.com>
Cc: stable@kernel.org

No differences found