android_kernel_lge_bullhead/drivers/crypto/caam
Horia Geantă 7fb443fa86 crypto: caam - fix signals handling
commit 7459e1d25ffefa2b1be799477fcc1f6c62f6cec7 upstream.

Driver does not properly handle the case when signals interrupt
wait_for_completion_interruptible():
-it does not check for return value
-completion structure is allocated on stack; in case a signal interrupts
the sleep, it will go out of scope, causing the worker thread
(caam_jr_dequeue) to fail when it accesses it

wait_for_completion_interruptible() is replaced with uninterruptable
wait_for_completion().
We choose to block all signals while waiting for I/O (device executing
the split key generation job descriptor) since the alternative - in
order to have a deterministic device state - would be to flush the job
ring (aborting *all* in-progress jobs).

Cc: <stable@vger.kernel.org>
Fixes: 045e36780f ("crypto: caam - ahash hmac support")
Fixes: 4c1ec1f930 ("crypto: caam - refactor key_gen, sg")
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Willy Tarreau <w@1wt.eu>
2017-11-02 10:45:57 +01:00
..
Kconfig crypto: caam - fix typo "CRYPTO_AHASH" 2013-03-10 18:16:36 +08:00
Makefile crypto: caam - hwrng support 2012-06-27 14:42:06 +08:00
caamalg.c crypto: caam - fix AEAD givenc descriptors 2017-06-08 00:46:48 +02:00
caamhash.c crypto: caam - fix signals handling 2017-11-02 10:45:57 +01:00
caamrng.c crypto: caam - fix RNG buffer cache alignment 2015-06-29 12:08:34 -07:00
compat.h Revert "crypto: caam - add IPsec ESN support" 2013-03-21 17:36:03 +08:00
ctrl.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2013-05-02 14:53:12 -07:00
ctrl.h crypto: caam - ERA retrieval and printing for SEC device 2012-07-11 11:06:11 +08:00
desc.h crypto: caam - add support for SEC v5.x RNG4 2012-06-27 14:42:06 +08:00
desc_constr.h crypto: caam - support external seq in/out lengths 2012-06-27 14:42:04 +08:00
error.c crypto: caam - add allocation failure handling in SPRINTFCAT macro 2014-06-07 13:25:39 -07:00
error.h crypto: caam - fix printk recursion for long error texts 2011-05-04 15:15:06 +10:00
intern.h crypto: caam - fix job ring cleanup code 2013-04-25 21:09:07 +08:00
jr.c crypto: caam - fix job ring cleanup code 2013-04-25 21:09:07 +08:00
jr.h
key_gen.c crypto: caam - fix signals handling 2017-11-02 10:45:57 +01:00
key_gen.h crypto: caam - change key gen functions to return signed int 2013-04-25 21:01:43 +08:00
pdb.h crypto: caam - add PDB (Protocol Descriptor Block) definitions 2012-06-27 14:42:04 +08:00
regs.h crypto: caam - set RDB bit in security configuration register 2013-03-22 18:13:54 +08:00
sg_sw_sec4.h crypto: caam - chaining support 2012-06-27 14:42:05 +08:00