android_kernel_samsung_univ.../drivers/crypto
Horia Geantă 7b66838321 crypto: caam - fix endless loop when DECO acquire fails
commit 225ece3e7dad4cfc44cca38ce7a3a80f255ea8f1 upstream.

In case DECO0 cannot be acquired - i.e. run_descriptor_deco0() fails
with -ENODEV, caam_probe() enters an endless loop:

run_descriptor_deco0
	ret -ENODEV
	-> instantiate_rng
		-ENODEV, overwritten by -EAGAIN
		ret -EAGAIN
		-> caam_probe
			-EAGAIN results in endless loop

It turns out the error path in instantiate_rng() is incorrect,
the checks are done in the wrong order.

Fixes: 1005bccd7a ("crypto: caam - enable instantiation of all RNG4 state handles")
Reported-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
Suggested-by: Auer Lukas <lukas.auer@aisec.fraunhofer.de>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-16 20:09:45 +01:00
..
amcc crypto: crypto4xx - increase context and scatter ring buffer elements 2017-12-25 14:22:14 +01:00
caam crypto: caam - fix endless loop when DECO acquire fails 2018-02-16 20:09:45 +01:00
ccp
marvell
nx
qat
qce
sunxi-ss
ux500
vmx crypto: vmx - disable preemption to enable vsx in aes_ctr.c 2017-11-15 17:13:10 +01:00
atmel-aes-regs.h
atmel-aes.c
atmel-sha-regs.h
atmel-sha.c
atmel-tdes-regs.h
atmel-tdes.c
bfin_crc.c
bfin_crc.h
geode-aes.c
geode-aes.h
hifn_795x.c
img-hash.c
ixp4xx_crypto.c
Kconfig
Makefile
mv_cesa.c
mv_cesa.h
mxs-dcp.c
n2_asm.S
n2_core.c crypto: n2 - cure use after free 2018-01-10 09:27:08 +01:00
n2_core.h
omap-aes.c
omap-des.c
omap-sham.c
padlock-aes.c
padlock-sha.c
picoxcell_crypto_regs.h
picoxcell_crypto.c
s5p-sss.c crypto: s5p-sss - Fix completing crypto request in IRQ handler 2017-12-16 10:33:53 +01:00
sahara.c
talitos.c crypto: talitos - fix sha224 2017-10-05 09:41:45 +02:00
talitos.h