crypto: drbg - wait for crypto op not signal safe
authorGilad Ben-Yossef <gilad@benyossef.com>
Thu, 18 May 2017 13:29:24 +0000 (16:29 +0300)
committerRaspbian kernel package updater <root@raspbian.org>
Sun, 23 Jul 2017 02:54:45 +0000 (02:54 +0000)
commit4f16ec4ead4b0314436160ff32a0f3469412671e
tree6c7c1d31cf839c10715afee1910ef0d84a520f01
parent886ade4cbfd7869d5d05561888830ce1a808bc6b
crypto: drbg - wait for crypto op not signal safe

commit a5dfefb1c3f3db81662556393fd9283511e08430 upstream.

drbg_kcapi_sym_ctr() was using wait_for_completion_interruptible() to
wait for completion of async crypto op but if a signal occurs it
may return before DMA ops of HW crypto provider finish, thus
corrupting the output buffer.

Resolve this by using wait_for_completion() instead.

Reported-by: Eric Biggers <ebiggers3@gmail.com>
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
crypto/drbg.c