public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russ Dill <russ.dill@gmail.com>
To: stable@kernel.org, linux-kernel <linux-kernel@vger.kernel.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	Nick Kossifidis <mickflemm@gmail.com>,
	"Theodore Ts'o" <tytso@mit.edu>
Subject: [PATCH] Revert "random: Mix cputime from each thread that exits to the pool"
Date: Mon,  4 Mar 2013 00:03:28 -0800	[thread overview]
Message-ID: <1362384208-6687-1-git-send-email-Russ.Dill@gmail.com> (raw)
In-Reply-To: <20130304073908.GA982@kroah.com>

This reverts commit 6133705494bb02953e1e2cc3018a4373981b3c97.

The above commit introduces a circular locking dependacy. Existing code
takes nonblocking_port.lock and then tasklist_lock. The code in this
commit takes nonblocking_port.lock while talklist_lock is already held
leading to a potential deadlock. For now, simply revert the commit.

Existing lock order:

send_sigio /* takes read lock on tasklist_lock */
kill_fasync_rcu
kill_fasync
account /* takes nonblocking_pool.lock */
extract_entropy
get_random_bytes
create_elf_tables
load_elf_binary
load_elf_library
search_binary_handler

New code:

mix_pool_bytes /* takes nonblocking_pool.lock */
add_device_randomness
posix_cpu_timers_exit
__exit_signal
release_task /* takes write lock on tasklist_lock */
do_exit
__module_put_and_exit
cryptomgr_test

Signed-off-by: Russ Dill <Russ.Dill@gmail.com>
---
 kernel/posix-cpu-timers.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
index 942ca27..1f2ef3d 100644
--- a/kernel/posix-cpu-timers.c
+++ b/kernel/posix-cpu-timers.c
@@ -9,7 +9,6 @@
 #include <asm/uaccess.h>
 #include <linux/kernel_stat.h>
 #include <trace/events/timer.h>
-#include <linux/random.h>
 
 /*
  * Called after updating RLIMIT_CPU to run cpu timer and update
@@ -471,8 +470,6 @@ static void cleanup_timers(struct list_head *head,
  */
 void posix_cpu_timers_exit(struct task_struct *tsk)
 {
-	add_device_randomness((const void*) &tsk->se.sum_exec_runtime,
-						sizeof(unsigned long long));
 	cleanup_timers(tsk->cpu_timers,
 		       tsk->utime, tsk->stime, tsk->se.sum_exec_runtime);
 
-- 
1.8.1.2


  reply	other threads:[~2013-03-04  8:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-02 11:00 fasync race in fs/fcntl.c Russ Dill
2013-03-02 17:54 ` Al Viro
2013-03-02 18:42 ` Al Viro
2013-03-02 19:25   ` Al Viro
2013-03-02 19:49 ` Al Viro
2013-03-03  0:09   ` Russ Dill
2013-03-04  6:16     ` Russ Dill
2013-03-04  7:39       ` Greg KH
2013-03-04  8:03         ` Russ Dill [this message]
2013-03-04 17:05           ` [PATCH] Revert "random: Mix cputime from each thread that exits to the pool" Theodore Ts'o
2013-03-04 19:33             ` Russ Dill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1362384208-6687-1-git-send-email-Russ.Dill@gmail.com \
    --to=russ.dill@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mickflemm@gmail.com \
    --cc=stable@kernel.org \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox