Thread (9 messages) flat view 9 messages, 6 authors, 2022-12-14

Re: [PATCH 1/5] Renaming weak prng invocations - prandom_bytes_state, prandom_u32_state

From: "Theodore Ts'o" <tytso@mit.edu>
Date: 2022-12-14 18:29:05
Also in: bpf, dri-devel, intel-gfx, linux-mm, linux-scsi, lkml

On Wed, Dec 14, 2022 at 05:21:17PM +0100, Stanislaw Gruszka wrote:
On Wed, Dec 14, 2022 at 04:15:49PM +0100, Eric Dumazet wrote:
quoted
On Wed, Dec 14, 2022 at 1:34 PM Stanislaw Gruszka
[off-list ref] wrote:
quoted
On Mon, Dec 12, 2022 at 03:35:20PM +0100, Jason A. Donenfeld wrote:
quoted
Please CC me on future revisions.

As of 6.2, the prandom namespace is *only* for predictable randomness.
There's no need to rename anything. So nack on this patch 1/5.
It is not obvious (for casual developers like me) that p in prandom
stands for predictable. Some renaming would be useful IMHO.
I disagree.  pseudo-random has *always* menat "predictable".  And the
'p' in prandom was originally "pseudo-random".  In userspace,
random(3) is also pseudo-random, and is ***utterly*** predictable.  So
the original use of prandom() was a bit more of an explicit nod to the
fact that prandom is something which is inherently predictable.

So I don't think it's needed to rename it, whether it's to
"predictable_rng_prandom_u32", or "no_you_idiot_dont_you_dare_use_it_for_cryptographi_purposes_prandom_u32".

I think we need to assume a certain base level of competence,
especially for someone who is messing with security psensitive kernel
code.  If a developer doesn't know that a prng is predictable, that's
probably the *least* of the sort of mistakes that they might make.

					- Ted
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help