linux/drivers/char
Greg Kurz fe658f8700 hwrng: pseries - port to new read API and fix stack corruption
commit 24c65bc703 upstream.

The add_early_randomness() function in drivers/char/hw_random/core.c passes
a 16-byte buffer to pseries_rng_data_read(). Unfortunately, plpar_hcall()
returns four 64-bit values and trashes 16 bytes on the stack.

This bug has been lying around for a long time. It got unveiled by:

commit d3cc799647
Author: Amit Shah <amit.shah@redhat.com>
Date:   Thu Jul 10 15:42:34 2014 +0530

    hwrng: fetch randomness only after device init

It may trig a oops while loading or unloading the pseries-rng module for both
PowerVM and PowerKVM guests.

This patch does two things:
- pass an intermediate well sized buffer to plpar_hcall(). This is acceptalbe
  since we're not on a hot path.
- move to the new read API so that we know the return buffer size for sure.

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-21 09:23:01 -08:00
..
agp Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2014-01-29 20:49:12 -08:00
hw_random hwrng: pseries - port to new read API and fix stack corruption 2014-11-21 09:23:01 -08:00
ipmi ipmi: Reset the KCS timeout when starting error recovery 2014-06-07 10:28:10 -07:00
mwave
pcmcia tty: synclink: avoid sleep_on race 2014-01-07 17:05:21 -08:00
tpm tpm: Properly clean sysfs entries in error path 2014-09-17 09:19:08 -07:00
xilinx_hwicap
Kconfig raw: set range for MAX_RAW_DEVS 2014-02-07 08:29:46 -08:00
Makefile Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2014-01-29 20:49:12 -08:00
apm-emulation.c apm-emulation: add hibernation APM events to support suspend2disk 2014-01-07 13:50:28 +01:00
applicom.c applicom: dereferencing NULL on error path 2014-06-30 20:11:52 -07:00
applicom.h
bfin-otp.c
bsr.c
ds1302.c
ds1620.c
dsp56k.c
dtlk.c
efirtc.c
generic_nvram.c
genrtc.c
hangcheck-timer.c
hpet.c
i8k.c i8k: Fix non-SMP operation 2014-07-17 16:21:03 -07:00
lp.c
mbcs.c
mbcs.h
mem.c mm/memblock: remove unnecessary inclusions of bootmem.h 2014-01-21 16:19:46 -08:00
misc.c
mmtimer.c
msm_smd_pkt.c treewide: Fix typos in printk 2013-12-19 15:10:49 +01:00
mspec.c
nsc_gpio.c
nvram.c
nwbutton.c char: nwbutton: open-code interruptible_sleep_on 2014-01-08 15:29:52 -08:00
nwbutton.h
nwflash.c
pc8736x_gpio.c
ppdev.c
ps3flash.c
random.c random: add and use memzero_explicit() for clearing data 2014-11-14 08:59:49 -08:00
raw.c raw: test against runtime value of max_raw_minors 2014-02-07 08:29:46 -08:00
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 drivers/char: don't use module_init in non-modular ttyprintk.c 2014-01-13 14:57:20 -08:00
uv_mmtimer.c
virtio_console.c fix a kmap leak in virtio_console 2014-02-09 15:21:16 -05:00