alistair23-linux/drivers/char
Jiri Kosina 10b3a32d29 random: fix accounting race condition with lockless irq entropy_count update
Commit 902c098a36 ("random: use lockless techniques in the interrupt
path") turned IRQ path from being spinlock protected into lockless
cmpxchg-retry update.

That commit removed r->lock serialization between crediting entropy bits
from IRQ context and accounting when extracting entropy on userspace
read path, but didn't turn the r->entropy_count reads/updates in
account() to use cmpxchg as well.

It has been observed, that under certain circumstances this leads to
read() on /dev/urandom to return 0 (EOF), as r->entropy_count gets
corrupted and becomes negative, which in turn results in propagating 0
all the way from account() to the actual read() call.

Convert the accounting code to be the proper lockless counterpart of
what has been partially done by 902c098a36.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Greg KH <greg@kroah.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-05-24 16:22:52 -07:00
..
agp
hw_random drivers/char/hw_random: don't check resource with devm_ioremap_resource 2013-05-12 15:19:46 +02:00
ipmi ipmi: ipmi_devintf: compat_ioctl method fails to take ipmi_mutex 2013-05-16 13:49:25 -07:00
mwave
pcmcia
tpm
xilinx_hwicap
apm-emulation.c
applicom.c
applicom.h
bfin-otp.c
bsr.c
ds1302.c
ds1620.c ds1620: single_open() leak 2013-05-05 00:11:29 -04:00
dsp56k.c
dtlk.c
efirtc.c rtc: single_open() leaks 2013-05-05 00:12:29 -04:00
generic_nvram.c
genrtc.c rtc: single_open() leaks 2013-05-05 00:12:29 -04:00
hangcheck-timer.c
hpet.c
i8k.c
Kconfig
lp.c Char: lp, protect LPGETSTATUS with port_mutex 2013-05-16 18:08:58 -07:00
Makefile
mbcs.c
mbcs.h
mem.c aio: don't include aio.h in sched.h 2013-05-07 20:16:25 -07:00
misc.c
mmtimer.c
msm_smd_pkt.c
mspec.c
nsc_gpio.c
nvram.c
nwbutton.c
nwbutton.h
nwflash.c
pc8736x_gpio.c
ppdev.c
ps3flash.c
random.c random: fix accounting race condition with lockless irq entropy_count update 2013-05-24 16:22:52 -07:00
raw.c
rtc.c
scx200_gpio.c
snsc.c
snsc.h
snsc_event.c
sonypi.c
tb0219.c
tile-srom.c
tlclk.c
toshiba.c
ttyprintk.c ttyprintk: Fix NULL pointer deref by setting tty_port ops after initializing port 2013-05-21 10:13:23 -07:00
uv_mmtimer.c
virtio_console.c Lots of virtio work which wasn't quite ready for last merge window. Plus 2013-05-02 14:14:04 -07:00