]> 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)
commite0cfeebdda464ee9c34a0551a4fb34c7d5b41a6c
tree4470c1ccd9ade767d3c3928ebb2432e9c9d32546
parent53e5313673903082e1a4b63bd6c576867a14921f
random: fix BUG_ON caused by accounting simplification

Commit a637dec56bf19a ("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