Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1451699

Re: [BUG -next] "random: make /dev/urandom scalable for silly userspace programs" causes crash

From Theodore Ts'o <tytso@mit.edu>
Newsgroups linux.kernel
Subject Re: [BUG -next] "random: make /dev/urandom scalable for silly userspace programs" causes crash
Date 2016-07-28 05:50 +0200
Message-ID <rZKuB-vE-1@gated-at.bofh.it> (permalink)
References <rZrih-4IM-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Jul 27, 2016 at 09:14:00AM +0200, Heiko Carstens wrote:
> it looks like your patch "random: make /dev/urandom scalable for silly
> userspace programs" within linux-next seems to be a bit broken:
> 
> It causes this allocation failure and subsequent crash on s390 with fake
> NUMA enabled

Thanks for reporting this.  This patch fixes things for you, yes?

       	   	     	    	       	     	    - Ted

commit 59b8d4f1f5d26e4ca92172ff6dcd1492cdb39613
Author: Theodore Ts'o <tytso@mit.edu>
Date:   Wed Jul 27 23:30:25 2016 -0400

    random: use for_each_online_node() to iterate over NUMA nodes
    
    This fixes a crash on s390 with fake NUMA enabled.
    
    Reported-by: Heiko Carstens <heiko.carstens@de.ibm.com>
    Fixes: 1e7f583af67b ("random: make /dev/urandom scalable for silly userspace programs")
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>

diff --git a/drivers/char/random.c b/drivers/char/random.c
index 8d0af74..7f06224 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1668,13 +1668,12 @@ static int rand_initialize(void)
 #ifdef CONFIG_NUMA
 	pool = kmalloc(num_nodes * sizeof(void *),
 		       GFP_KERNEL|__GFP_NOFAIL|__GFP_ZERO);
-	for (i=0; i < num_nodes; i++) {
+	for_each_online_node(i) {
 		crng = kmalloc_node(sizeof(struct crng_state),
 				    GFP_KERNEL | __GFP_NOFAIL, i);
 		spin_lock_init(&crng->lock);
 		crng_initialize(crng);
 		pool[i] = crng;
-
 	}
 	mb();
 	crng_node_pool = pool;

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[BUG -next] "random: make /dev/urandom scalable for silly userspace  programs" causes crash Heiko Carstens <heiko.carstens@de.ibm.com> - 2016-07-27 09:20 +0200
  Re: [BUG -next] "random: make /dev/urandom scalable for silly  userspace programs" causes crash Theodore Ts'o <tytso@mit.edu> - 2016-07-28 05:50 +0200
    Re: [BUG -next] "random: make /dev/urandom scalable for silly  userspace programs" causes crash Heiko Carstens <heiko.carstens@de.ibm.com> - 2016-07-28 08:00 +0200
      Re: [BUG -next] "random: make /dev/urandom scalable for silly  userspace programs" causes crash Heiko Carstens <heiko.carstens@de.ibm.com> - 2016-07-28 09:30 +0200
        Re: [BUG -next] "random: make /dev/urandom scalable for silly  userspace programs" causes crash Theodore Ts'o <tytso@mit.edu> - 2016-07-28 15:50 +0200
          Re: [BUG -next] "random: make /dev/urandom scalable for silly  userspace programs" causes crash Tony Luck <tony.luck@gmail.com> - 2016-07-29 02:00 +0200
    Re: [BUG -next] "random: make /dev/urandom scalable for silly  userspace programs" causes crash Joe Perches <joe@perches.com> - 2016-07-28 20:20 +0200

csiph-web