Mathieu Desnoyers 44e4360fa3 drivers/char/random.c: fix boot id uniqueness race
/proc/sys/kernel/random/boot_id can be read concurrently by userspace
processes.  If two (or more) user-space processes concurrently read
boot_id when sysctl_bootid is not yet assigned, a race can occur making
boot_id differ between the reads.  Because the whole point of the boot id
is to be unique across a kernel execution, fix this by protecting this
operation with a spinlock.

Given that this operation is not frequently used, hitting the spinlock
on each call should not be an issue.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Matt Mackall <mpm@selenic.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Greg Kroah-Hartman <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-04-12 13:12:12 -07:00
..
2012-03-27 16:03:32 -07:00
2012-03-28 18:30:03 +01:00
2012-03-08 10:45:55 -08:00
2012-03-08 10:45:55 -08:00
2012-03-28 18:30:03 +01:00
2011-03-31 11:26:23 -03:00
2011-02-02 15:28:19 +01:00
2012-03-28 18:30:03 +01:00
2012-03-28 18:30:03 +01:00
2011-03-31 11:26:23 -03:00
2012-03-28 18:30:03 +01:00
2011-01-10 08:51:44 -08:00
2010-10-15 15:53:27 +02:00
2012-02-09 23:09:37 +01:00