aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/hw_random/pseries-rng.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-11-21hwrng: Make explicit that max >= 32 alwaysPrasannaKumar Muralidharan1-3/+2
As hw_random core calls ->read with max > 32 or more, make it explicit. Also remove checks involving 'max' being less than 8. Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2015-03-12hwrng: pseries - remove incorrect __init/__exit markupsDmitry Torokhov1-2/+2
Even if bus is not hot-pluggable, the devices can be unbound from the driver via sysfs, so we should not be using __exit annotations on remove() methods. The only exception is drivers registered with platform_driver_probe() which specifically disables sysfs bind/unbind attributes. Similarly probe() methods should not be marked __init unless platform_driver_probe() is used. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2014-11-06hwrng: pseries - port to new read API and fix stack corruptionGreg Kurz1-4/+7
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 d3cc7996473a7bdd33256029988ea690754e4e2a 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-10-02hwrng: printk replacementSudip Mukherjee1-1/+1
as pr_* macros are more preffered over printk, so printk replaced with corresponding pr_* macros Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-10-07hwrng: pseries - Return errors to upper levels in pseries-rng.cMichael Ellerman1-3/+11
We don't expect to get errors from the hypervisor when reading the rng, but if we do we should pass the error up to the hwrng driver. Otherwise the hwrng driver will continue calling us forever. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-10-07hwrng: pseries - Use KBUILD_MODNAME in pseries-rng.cMichael Ellerman1-3/+2
Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2012-05-14powerpc/pseries/hwrng: PFO-based hwrng driverKent Yoder1-0/+96
Adds support for the Platform Facilities Option (PFO)-based hardware random number generator for POWER hardware. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com> Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>