linux/drivers/char/hw_random
Greg Kurz 24c65bc703 hwrng: pseries - port to new read API and fix stack corruption
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.

Cc: stable@vger.kernel.org
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2014-11-06 23:10:22 +08:00
..
amd-rng.c hwrng: printk replacement 2014-10-02 14:35:00 +08:00
atmel-rng.c hwrng: atmel - Use devm_clk_get() 2014-03-10 20:13:35 +08:00
bcm63xx-rng.c
bcm2835-rng.c hwrng: bcm2835 - fix oops when rng h/w is accessed during registration 2014-04-11 11:31:13 +08:00
core.c Cheers, 2014-08-10 21:31:04 -07:00
exynos-rng.c drivers/char: delete non-required instances of include <linux/init.h> 2014-02-07 15:10:19 -08:00
geode-rng.c hwrng: printk replacement 2014-10-02 14:35:00 +08:00
intel-rng.c hwrng: printk replacement 2014-10-02 14:35:00 +08:00
ixp4xx-rng.c
Kconfig hwrng: xgene - add support for APM X-Gene SoC RNG support 2014-08-29 21:46:38 +08:00
Makefile hwrng: xgene - add support for APM X-Gene SoC RNG support 2014-08-29 21:46:38 +08:00
msm-rng.c hwrng: msm - Add PRNG support for MSM SoC's 2013-10-30 12:02:56 +08:00
mxc-rnga.c
n2-asm.S
n2-drv.c hwrng: n2-drv - Introduce the use of the managed version of kzalloc 2014-05-13 19:43:48 +08:00
n2rng.h
nomadik-rng.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2014-04-03 09:28:16 -07:00
octeon-rng.c drivers/char: delete non-required instances of include <linux/init.h> 2014-02-07 15:10:19 -08:00
omap3-rom-rng.c hwrng: omap3-rom - Use devm_clk_get() 2014-03-10 20:13:36 +08:00
omap-rng.c hwrng: omap - remove unnecessary OOM messages 2014-05-08 21:58:16 +08:00
pasemi-rng.c hwrng: printk replacement 2014-10-02 14:35:00 +08:00
powernv-rng.c hwrng: Add a driver for the hwrng found in power7+ systems 2013-10-11 16:50:20 +11:00
ppc4xx-rng.c powerpc: add missing explicit OF includes for ppc 2013-11-11 09:10:50 -06:00
pseries-rng.c hwrng: pseries - port to new read API and fix stack corruption 2014-11-06 23:10:22 +08:00
timeriomem-rng.c hwrng: timeriomem - remove unnecessary OOM messages 2014-05-08 21:58:16 +08:00
tpm-rng.c
tx4939-rng.c
via-rng.c hwrng: printk replacement 2014-10-02 14:35:00 +08:00
virtio-rng.c One cc: stable commit, the rest are a series of minor cleanups which have 2014-10-18 10:25:09 -07:00
xgene-rng.c hwrng: xgene - add support for APM X-Gene SoC RNG support 2014-08-29 21:46:38 +08:00