diff options
author | Suresh Siddha <suresh.b.siddha@intel.com> | 2006-08-15 00:03:01 -0700 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-08-17 16:29:47 -0700 |
commit | 855751125093f758871b70da2951d8b92b6368cc (patch) | |
tree | 6c9e71da19a4fa164380c25c0d443f4eb965c917 /net/core | |
parent | 7ea49ed73c8d0d0bdf7c11fc18c61572d2d22176 (diff) | |
download | op-kernel-dev-855751125093f758871b70da2951d8b92b6368cc.zip op-kernel-dev-855751125093f758871b70da2951d8b92b6368cc.tar.gz |
[NET]: Fix potential stack overflow in net/core/utils.c
On High end systems (1024 or so cpus) this can potentially cause stack
overflow. Fix the stack usage.
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/utils.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/core/utils.c b/net/core/utils.c index 4f96f38..e31c90e 100644 --- a/net/core/utils.c +++ b/net/core/utils.c @@ -130,12 +130,13 @@ void __init net_random_init(void) static int net_random_reseed(void) { int i; - unsigned long seed[NR_CPUS]; + unsigned long seed; - get_random_bytes(seed, sizeof(seed)); for_each_possible_cpu(i) { struct nrnd_state *state = &per_cpu(net_rand_state,i); - __net_srandom(state, seed[i]); + + get_random_bytes(&seed, sizeof(seed)); + __net_srandom(state, seed); } return 0; } |