diff options
author | John Denker <jsd@av8n.com> | 2013-10-09 17:14:46 -0700 |
---|---|---|
committer | John Denker <jsd@av8n.com> | 2013-10-18 05:33:22 -0700 |
commit | 8dc7be5e5db5532dfe28aa5329a91939c823e37a (patch) | |
tree | e358c647b6a22fb26d5c1f417de99192bd74d319 | |
parent | 67c471f7fd31c53073b5c04c9555a882a1c5a7e9 (diff) |
zero-byte read
-rw-r--r-- | drivers/char/random.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c index 157a0b3..254407b 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -1292,8 +1292,13 @@ random_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) { ssize_t n, retval = 0, count = 0; - if (nbytes == 0) +/* + * Kludge: zero-byte read: Fill the pool from upstream sources. + */ + if (nbytes == 0){ + fill_pool(&blocking_pool, 0); return 0; + } while (nbytes > 0) { n = nbytes; |