Skip to content

Commit

Permalink
[PATCH] uml: use get_random_bytes() after random pool is seeded
Browse files Browse the repository at this point in the history
When the UML network driver generates random MACs for its devices, it was
possible for a number of UMLs to get the same MACs because the ethernet
initialization was done before the random pool was properly seeded.

This patch moves the initialization later so that it gets better randomness.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed Dec 7, 2006
1 parent e46962f commit 8210fd2
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion arch/um/drivers/daemon_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ static int register_daemon(void)
return 0;
}

__initcall(register_daemon);
late_initcall(register_daemon);
2 changes: 1 addition & 1 deletion arch/um/drivers/mcast_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,4 @@ static int register_mcast(void)
return 0;
}

__initcall(register_mcast);
late_initcall(register_mcast);
2 changes: 1 addition & 1 deletion arch/um/drivers/pcap_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ static int register_pcap(void)
return 0;
}

__initcall(register_pcap);
late_initcall(register_pcap);
2 changes: 1 addition & 1 deletion arch/um/drivers/slip_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ static int register_slip(void)
return 0;
}

__initcall(register_slip);
late_initcall(register_slip);
2 changes: 1 addition & 1 deletion arch/um/drivers/slirp_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ static int register_slirp(void)
return 0;
}

__initcall(register_slirp);
late_initcall(register_slirp);
2 changes: 1 addition & 1 deletion arch/um/os-Linux/drivers/ethertap_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ static int register_ethertap(void)
return 0;
}

__initcall(register_ethertap);
late_initcall(register_ethertap);
2 changes: 1 addition & 1 deletion arch/um/os-Linux/drivers/tuntap_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ static int register_tuntap(void)
return 0;
}

__initcall(register_tuntap);
late_initcall(register_tuntap);

0 comments on commit 8210fd2

Please sign in to comment.