Revision 44e4360fa3384850d65dd36fb4e6e5f2f112709b authored by Mathieu Desnoyers on 12 April 2012, 19:49:12 UTC, committed by Linus Torvalds on 12 April 2012, 20:12:12 UTC
/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>
1 parent d833049
History
File Mode Size
Kconfig -rw-r--r-- 1.7 KB
Makefile -rw-r--r-- 380 bytes
acl.c -rw-r--r-- 9.0 KB
acl.h -rw-r--r-- 1.5 KB
balloc.c -rw-r--r-- 44.8 KB
dir.c -rw-r--r-- 17.8 KB
ext2.h -rw-r--r-- 27.5 KB
file.c -rw-r--r-- 2.8 KB
ialloc.c -rw-r--r-- 18.3 KB
inode.c -rw-r--r-- 44.3 KB
ioctl.c -rw-r--r-- 4.4 KB
namei.c -rw-r--r-- 9.3 KB
super.c -rw-r--r-- 40.9 KB
symlink.c -rw-r--r-- 1.3 KB
xattr.c -rw-r--r-- 27.9 KB
xattr.h -rw-r--r-- 3.4 KB
xattr_security.c -rw-r--r-- 1.9 KB
xattr_trusted.c -rw-r--r-- 1.4 KB
xattr_user.c -rw-r--r-- 1.5 KB
xip.c -rw-r--r-- 2.0 KB
xip.h -rw-r--r-- 759 bytes

back to top