linux/drivers/char/hw_random
Herbert Xu 55db8387a5 hwrng: via_rng - Fix memory scribbling on some CPUs
It has been reported that on at least one Nano CPU the xstore
instruction will write as many as 16 bytes of data to the output
buffer.

This causes memory corruption as we use rng->priv which is only
4-8 bytes long.

This patch fixes this by using an intermediate buffer on the stack
with at least 16 bytes and aligned to a 16-byte boundary.

The problem was observed on the following processor:

processor	: 0
vendor_id	: CentaurHauls
cpu family	: 6
model		: 15
model name	: VIA Nano processor U2250 (1.6GHz Capable)
stepping	: 3
cpu MHz		: 1600.000
cache size	: 1024 KB
fdiv_bug	: no
hlt_bug		: no
f00f_bug	: no
coma_bug	: no
fpu		: yes
fpu_exception	: yes
cpuid level	: 10
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush acpi mmx fxsr sse sse2 ss tm syscall nx lm constant_tsc up rep_good pni monitor vmx est tm2 ssse3 cx16 xtpr rng rng_en ace ace_en ace2 phe phe_en lahf_lm
bogomips	: 3192.08
clflush size	: 64
cache_alignment	: 128
address sizes	: 36 bits physical, 48 bits virtual
power management:

Tested-by: Mario 'BitKoenig' Holbe <Mario.Holbe@TU-Ilmenau.DE>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2011-01-07 14:55:06 +11:00
..
amd-rng.c hwrng: Use PCI_VDEVICE 2009-06-25 13:50:53 +08:00
core.c llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00
geode-rng.c hwrng: Use PCI_VDEVICE 2009-06-25 13:50:53 +08:00
intel-rng.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ixp4xx-rng.c [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
Kconfig Merge with mainline to remove plat-omap/Kconfig conflict 2010-03-01 14:19:05 -08:00
Makefile hwrng: nomadik - Add hardware RNG driver 2009-12-19 19:45:43 +08:00
mxc-rnga.c i.MX31: Add hw-random for RNGA 2009-05-07 16:17:16 +02:00
n2-asm.S sparc64: Add Niagara2 RNG driver. 2008-07-18 00:46:09 -07:00
n2-drv.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2010-09-07 14:35:16 -07:00
n2rng.h of/device: Replace struct of_device with struct platform_device 2010-08-06 09:25:50 -06:00
nomadik-rng.c ARM: 6137/1: nomadik hwrng: Add clock support 2010-05-20 23:51:07 +01:00
octeon-rng.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
omap-rng.c omap: rng: Use resource_size instead of manual calculation 2009-09-24 16:23:18 -07:00
pasemi-rng.c of/device: Replace struct of_device with struct platform_device 2010-08-06 09:25:50 -06:00
timeriomem-rng.c hwrng: timeriomem - Fix potential oops (request_mem_region/__devinit) 2009-06-03 19:28:03 +10:00
tx4939-rng.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
via-rng.c hwrng: via_rng - Fix memory scribbling on some CPUs 2011-01-07 14:55:06 +11:00
virtio-rng.c virtio-rng: use virtqueue_xxx wrappers 2010-05-19 22:15:45 +09:30