Skip to contentSkip to conversation

random number generator fixes for 6.11-rc6

GIT PULL Merged Jason A. Donenfeld 2 participants 2 messages Aug 29, 2024

lore
Share & tools
lore
#0 lore raw

Hi Linus,

This pull has one small fix:

- Reject invalid flags passed to vgetrandom() in the same way that getrandom() does, so that the behavior is the same, from Yann.

The flags argument to getrandom() only has a behavioral effect on the function if the RNG isn't initialized yet, so vgetrandom() falls back to the syscall in that case. But if the RNG is initialized, all of the flags behave the same way, so vgetrandom() didn't bother checking them, and just ignored them entirely. But that doesn't account for invalid flags passed in, which need to be rejected so we can use them later.

Please pull.

Side note: there are now enablements of vgetrandom() in review for arm64, ppc, and loongarch, and hopefully they'll be ready for 6.12. In the process of getting this wired up on several archs, various build, selftest, header, and other bureaucratic-style gotchas have been found and fixed. Originally my plan was to send you a pull containing those fixes, for 6.11, so that the actual new arch code could then go in via each respective arch tree for 6.12. But these little fixes have started to pile up, and some of the build ones deserve a bit of care and testing under different circumstances, so I'd like to actually let these cook in linux-next for a while longer and send them for 6.12 instead. And it's not like they actually fix any _current_ issue, as the x86 codegen is the same; they just fix bugs in order to enable other archs later. So now my current plan is to send these to you for 6.12, alongside the new arch enablements in that same pull, after receiving acks from the arch maintainers to do that. If you are curious or do want these build fixes now for some reason, though, they're all sitting in my tree.

Thanks,
Jason

The following changes since commit dc1c8034e31b14a2e5e212104ec508aec44ce1b9:

minmax: simplify min()/max()/clamp() implementation (2024-07-28 20:24:12 -0700)

are available in the Git repository at:

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

for you to fetch changes up to 28f5df210d06beb5920cf80446f1c27456c14b92:

random: vDSO: reject unknown getrandom() flags (2024-08-26 09:58:52 +0200)

----------------------------------------------------------------
Random number generator fixes for Linux 6.11-rc6.
----------------------------------------------------------------

Yann Droneaud (1):
random: vDSO: reject unknown getrandom() flags

 lib/vdso/getrandom.c | 4 ++++
 1 file changed, 4 insertions(+)
merge bot Merged
#1 lore raw
The pull request you sent on Thu, 29 Aug 2024 02:42:46 +0200:

The pull request you sent on Thu, 29 Aug 2024 02:42:46 +0200:

Quoted 1 line

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

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

Thank you!

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