Thread (4 messages) flat view 4 messages, 2 authors, 2012-11-13

Re: [PATCH v3 00/11] rename random32 to prandom and introduce prandom_bytes()

From: Andrew Morton <akpm@linux-foundation.org>
Date: 2012-11-13 19:56:00
Also in: lkml

On Tue, 13 Nov 2012 22:36:59 +0900
Akinobu Mita [off-list ref] wrote:
This patchset introduces new functions into random32 library for
getting the requested number of pseudo-random bytes.

Before introducing these new functions into random32 library,
rename all random32 functions to have 'prandom_' prefix.  As a result
the function prototypes are as follows:

void prandom_seed(u32 seed);	/* rename from srandom32() */
u32 prandom_u32(void);		/* rename from random32() */
void prandom_bytes(void *buf, int nbytes);

void prandom_seed_state(struct rnd_state *state, u64 seed);
				/* rename from prandom32_seed() */
u32 prandom_u32_state(struct rnd_state *state);
				/* rename from prandom32() */
void prandom_bytes_state(struct rnd_state *state, void *buf, int nbytes);

The purpose of this renaming is to prevent some kernel developers
from assuming that prandom32() and random32() might imply that only
prandom32() was the one using a pseudo-random number generator by
prandom32's "p", and the result may be a very embarassing security
exposure.  This concern was expressed by Theodore Ts'o.
There were a large number of rejects in MTD code, due to pending
changes in linux-next.  It's all quite mechanical stuff which I
fixed up.  Please check the result.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help