SourceForge has been redesigned. Learn more.

Commit [f9c6d4]  Maximize  Restore  History

random: fix BUG_ON caused by accounting simplification

Commit ee1de406ba6eb1 ("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" <>
Reported-by: Peter Zijlstra <>
Reported-by: Hannes Frederic Sowa <>
Cc: Greg Price <>

Theodore Ts'o Theodore Ts'o 2014-05-17

changed drivers/char/random.c
drivers/char/random.c Diff Switch to side-by-side view