Skip to content

Commit

Permalink
kmsan: random: prevent boot-time reports in _mix_pool_bytes
Browse files Browse the repository at this point in the history
Maybe it's better to zero-fill the buffer instead?

Signed-off-by: Alexander Potapenko <glider@google.com>
  • Loading branch information
ramosian-glider committed Nov 16, 2020
1 parent 492c54f commit 73d62e8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/char/hw_random/core.c
Expand Up @@ -623,6 +623,11 @@ static int __init hwrng_modinit(void)
kfree(rng_buffer);
return -ENOMEM;
}
/*
* Prevent KMSAN reporting bugs when passing uninitialized data from
* rng_fillbuf to mix_pool_bytes().
*/
kmsan_unpoison_shadow(rng_fillbuf, rng_buffer_size());

ret = register_miscdev();
if (ret) {
Expand Down

0 comments on commit 73d62e8

Please sign in to comment.