提交 85575112 编写于 作者: S Suresh Siddha 提交者: David S. Miller

[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: NSuresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 7ea49ed7
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册