Re: drivers/char/random.c line 728 BUG

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Aaron Straus <aaron@...>
Cc: <mpm@...>, <linux-kernel@...>, <tytso@...>, <stable@...>
Date: Friday, August 29, 2008 - 6:42 pm

On Fri, 29 Aug 2008 15:31:55 -0700
Aaron Straus wrote:

> > - if (r == &input_pool &&

Probably it doesn't matter because of the coverage of the lock but yes,
let's do the assignment first.

--- a/drivers/char/random.c~drivers-char-randomc-fix-a-race-which-can-lead-to-a-bogus-bug-fix-fix
+++ a/drivers/char/random.c
@@ -535,13 +535,13 @@ static void credit_entropy_bits(struct e
entropy_count = 0;
} else if (entropy_count > r->poolinfo->POOLBITS)
entropy_count = r->poolinfo->POOLBITS;
+ r->entropy_count = entropy_count;

/* should we wake readers? */
if (r == &input_pool && entropy_count >= random_read_wakeup_thresh) {
wake_up_interruptible(&random_read_wait);
kill_fasync(&fasync, SIGIO, POLL_IN);
}
- r->entropy_count = entropy_count;
spin_unlock_irqrestore(&r->lock, flags);
}

_

--

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
drivers/char/random.c line 728 BUG, Aaron Straus, (Tue Aug 26, 6:59 pm)
Re: drivers/char/random.c line 728 BUG, Aaron Straus, (Thu Aug 28, 6:59 pm)
Re: drivers/char/random.c line 728 BUG, Andrew Morton, (Fri Aug 29, 3:48 pm)
Re: drivers/char/random.c line 728 BUG, Matt Mackall, (Wed Sep 3, 2:18 pm)
Re: drivers/char/random.c line 728 BUG, Aaron Straus, (Wed Sep 3, 2:28 pm)
Re: drivers/char/random.c line 728 BUG, Matt Mackall, (Wed Sep 3, 6:12 pm)
Re: drivers/char/random.c line 728 BUG, Andrew Morton, (Wed Sep 3, 6:32 pm)
Re: drivers/char/random.c line 728 BUG, Matt Mackall, (Wed Sep 3, 6:51 pm)
Re: drivers/char/random.c line 728 BUG, Andrew Morton, (Wed Sep 3, 7:12 pm)
Re: drivers/char/random.c line 728 BUG, Aaron Straus, (Fri Aug 29, 6:31 pm)
Re: drivers/char/random.c line 728 BUG, Andrew Morton, (Fri Aug 29, 6:42 pm)
Re: drivers/char/random.c line 728 BUG, Andrew Morton, (Fri Aug 29, 3:54 pm)