mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
random32: rename random32 to prandom
This renames all random32 functions to have 'prandom_' prefix as follows: void prandom_seed(u32 seed); /* rename from srandom32() */ u32 prandom_u32(void); /* rename from random32() */ 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() */ 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. And furthermore, I'm going to introduce new functions for getting the requested number of pseudo-random bytes. If I continue to use both prandom32 and random32 prefixes for these functions, the confusion is getting worse. As a result of this renaming, "prandom_" is the common prefix for pseudo-random number library. Currently, srandom32() and random32() are preserved because it is difficult to rename too many users at once. Signed-off-by: Akinobu Mita <[email protected]> Cc: "Theodore Ts'o" <[email protected]> Cc: Robert Love <[email protected]> Cc: Michel Lespinasse <[email protected]> Cc: Valdis Kletnieks <[email protected]> Cc: David Laight <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Artem Bityutskiy <[email protected]> Cc: David Woodhouse <[email protected]> Cc: Eilon Greenstein <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
31279b1457
commit
496f2f93b1
5 changed files with 45 additions and 37 deletions
|
|
@ -2144,7 +2144,7 @@ static void fcoe_ctlr_vn_restart(struct fcoe_ctlr *fip)
|
|||
*/
|
||||
port_id = fip->port_id;
|
||||
if (fip->probe_tries)
|
||||
port_id = prandom32(&fip->rnd_state) & 0xffff;
|
||||
port_id = prandom_u32_state(&fip->rnd_state) & 0xffff;
|
||||
else if (!port_id)
|
||||
port_id = fip->lp->wwpn & 0xffff;
|
||||
if (!port_id || port_id == 0xffff)
|
||||
|
|
@ -2169,7 +2169,7 @@ static void fcoe_ctlr_vn_restart(struct fcoe_ctlr *fip)
|
|||
static void fcoe_ctlr_vn_start(struct fcoe_ctlr *fip)
|
||||
{
|
||||
fip->probe_tries = 0;
|
||||
prandom32_seed(&fip->rnd_state, fip->lp->wwpn);
|
||||
prandom_seed_state(&fip->rnd_state, fip->lp->wwpn);
|
||||
fcoe_ctlr_vn_restart(fip);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue