Skip to contentSkip to conversation

random number generator fixes for 5.18-rc3

GIT PULL Merged Jason A. Donenfeld 2 participants 2 messages Apr 16, 2022 – Apr 17, 2022

lore
Share & tools
lore
#0 lore raw

Hi Linus,

Please pull the following three fixes to the RNG for 5.18-rc3:

- Per your suggestion, random reads now won't fail if there's a page fault after some non-zero amount of data has been read, which makes the behavior consistent with all other reads in the kernel.

- Rather than an inconsistent mix of random_get_entropy() returning an unsigned long or a cycles_t, now it just returns an unsigned long.

- A memcpy() was replaced with an memmove(), because the addresses are sometimes overlapping. In practice the destination is always before the source, so not really an issue, but better to be correct than not.

Thanks,
Jason

The following changes since commit a19944809fe9942e6a96292490717904d0690c21:

Merge tag 'hardening-v5.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux (2022-04-12 14:29:40 -1000)

are available in the Git repository at:

https://git.kernel.org/pub/scm/linux/kernel/git/crng/random.git tags/random-5.18-rc3-for-linus

for you to fetch changes up to 35a33ff3807d3adb9daaf937f5bca002ffa9f84e:

random: use memmove instead of memcpy for remaining 32 bytes (2022-04-16 12:53:31 +0200)

----------------------------------------------------------------
Random number generator fixes for Linux 5.18-rc3.
----------------------------------------------------------------

Jason A. Donenfeld (3):
random: allow partial reads if later user copies fail
random: make random_get_entropy() return an unsigned long
random: use memmove instead of memcpy for remaining 32 bytes

 drivers/char/random.c | 44 ++++++++++++++++++++------------------------
 include/linux/timex.h |  2 +-
 2 files changed, 21 insertions(+), 25 deletions(-)
merge bot Merged
#1 lore raw
The pull request you sent on Sat, 16 Apr 2022 15:13:18 +0200:

The pull request you sent on Sat, 16 Apr 2022 15:13:18 +0200:

Quoted 1 line

https://git.kernel.org/pub/scm/linux/kernel/git/crng/random.git tags/random-5.18-rc3-for-linus

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/92edbe32e3822f7b66e471c7e0bd5ee5d63bf4b8

Thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html