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 mwave: fix info leak in mwave_ioctl() 2013-07-09 10:33:28 -07:00
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 char: hwicap: Remove unnecessary dev_set_drvdata() 2013-10-03 16:03:31 -07: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 drivers: clean-up prom.h implicit includes 2013-10-09 20:04:04 -05:00
ds1302.c
ds1620.c ds1620: single_open() leak 2013-05-05 00:11:29 -04:00
dsp56k.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
dtlk.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
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 ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
i8k.c i8k: Fix non-SMP operation 2014-07-17 16:21:03 -07:00
Kconfig raw: set range for MAX_RAW_DEVS 2014-02-07 08:29:46 -08:00
lp.c char: Int overflow in lp_do_ioctl(). 2013-12-18 16:39:54 -08:00
Makefile Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2014-01-29 20:49:12 -08:00
mbcs.c char: remove use of __devinitconst 2012-11-21 12:55:19 -08:00
mbcs.h
mem.c mm/memblock: remove unnecessary inclusions of bootmem.h 2014-01-21 16:19:46 -08:00
misc.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-11-13 15:34:18 +09:00
mmtimer.c
msm_smd_pkt.c treewide: Fix typos in printk 2013-12-19 15:10:49 +01:00
mspec.c char: Use vma_pages() to replace (vm_end - vm_start) >> PAGE_SHIFT 2013-05-21 10:07:54 -07:00
nsc_gpio.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
nvram.c
nwbutton.c char: nwbutton: open-code interruptible_sleep_on 2014-01-08 15:29:52 -08:00
nwbutton.h
nwflash.c Merge branch 'late/fixes' into fixes 2012-10-07 07:22:32 -07:00
pc8736x_gpio.c pc8736x_gpio: use platform_device_unregister in pc8736x_gpio_cleanup() 2012-10-24 15:52:29 -07:00
ppdev.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
ps3flash.c ps3flash: switch to generic_file_llseek_size() 2013-06-29 12:57:33 +04:00
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 various char drivers: remove deprecated IRQF_DISABLED 2013-10-16 12:36:10 -07:00
scx200_gpio.c
snsc_event.c various char drivers: remove deprecated IRQF_DISABLED 2013-10-16 12:36:10 -07:00
snsc.c various char drivers: remove deprecated IRQF_DISABLED 2013-10-16 12:36:10 -07:00
snsc.h
sonypi.c ACPI: Remove the old /proc/acpi/event interface 2013-07-15 13:56:36 +02:00
tb0219.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
tile-srom.c PTR_RET() is a weird name, and led to some confusing usage. We ended 2013-09-04 17:31:11 -07:00
tlclk.c tlclk: remove deprecated IRQF_DISABLED 2013-10-16 12:36:10 -07:00
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