]> git.baikalelectronics.ru Git - kernel.git/commit
random: fix BUG_ON caused by accounting simplification
authorTheodore Ts'o <tytso@mit.edu>
Sat, 17 May 2014 01:40:41 +0000 (21:40 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 17 May 2014 02:18:22 +0000 (22:18 -0400)
commit42d0e295bbc46b9a40f55d863888be2596f2e6b8
tree4470c1ccd9ade767d3c3928ebb2432e9c9d32546
parent992383c95ec7ad652d78c0258f849d6a422720f4
random: fix BUG_ON caused by accounting simplification

Commit fb22bbb0fe28f2 ("random: simplify accounting logic") simplified
things too much, in that it allows the following to trigger an
overflow that results in a BUG_ON crash:

dd if=/dev/urandom of=/dev/zero bs=67108707 count=1

Thanks to Peter Zihlstra for discovering the crash, and Hannes
Frederic for analyizing the root cause.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reported-by: Peter Zijlstra <peterz@infradead.org>
Reported-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: Greg Price <price@mit.edu>
drivers/char/random.c