+ random32-seeding-improvement-v2.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     random32: seeding improvement (v2)
has been added to the -mm tree.  Its filename is
     random32-seeding-improvement-v2.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: random32: seeding improvement (v2)
From: Stephen Hemminger <shemminger@xxxxxxxxxxxxxxxxxxxx>

Please consider this patch instead for fixing the seeding issue with random32.
The rationale is:
   * use u32 consistently
   * no need to do LCG on values from (better) get_random_bytes
   * use more data from get_random_bytes for secondary seeding
   * don't reduce state space on srandom32()
   * enforce state variable initialization restrictions

Note: the second paper has a version of random32() with even longer period
and a version of random64() if needed.

Signed-off-by: Stephen Hemminger <shemminger@xxxxxxxxxx>
Cc: Jack Lloyd <lloyd@xxxxxxxxxxxxx>
Cc: Theodore Ts'o <tytso@xxxxxxx>
Cc: Matt Mackall <mpm@xxxxxxxxxxx>
Cc: David S. Miller <davem@xxxxxxxxxxxxx>
Cc: Andi Kleen <ak@xxxxxxx>
Cc: Benoit Boissinot <bboissin@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 lib/random32.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN lib/random32.c~random32-seeding-improvement-v2 lib/random32.c
--- a/lib/random32.c~random32-seeding-improvement-v2
+++ a/lib/random32.c
@@ -112,7 +112,7 @@ static int __init random32_init(void)
 	for_each_possible_cpu(i) {
 		struct rnd_state *state = &per_cpu(net_rand_state,i);
 
-#define LCG(x)	(x * 69069)	/* super-duper LCG */
+#define LCG(x)	((x) * 69069)	/* super-duper LCG */
 		state->s1 = __seed(LCG(i + jiffies), 1);
 		state->s2 = __seed(LCG(state->s1), 7);
 		state->s3 = __seed(LCG(state->s2), 15);
_

Patches currently in -mm which might be from shemminger@xxxxxxxxxxxxxxxxxxxx are

random32-seeding-improvement.patch
random32-seeding-improvement-v2.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux