aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/hw_random/pseries-rng.c
Commit message (Collapse)AuthorAge
* hwrng: pseries - port to new read API and fix stack corruptionGreg Kurz2014-11-06
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* hwrng: printk replacementSudip Mukherjee2014-10-02
| | | | | | | 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>
* hwrng: pseries - Return errors to upper levels in pseries-rng.cMichael Ellerman2013-10-07
| | | | | | | | | 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>
* hwrng: pseries - Use KBUILD_MODNAME in pseries-rng.cMichael Ellerman2013-10-07
| | | | | Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* powerpc/pseries/hwrng: PFO-based hwrng driverKent Yoder2012-05-13
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>