crypto: algif_skcipher - Fixed blocking recvmsg
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 27 Nov 2014 14:38:12 +0000 (22:38 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 28 Nov 2014 15:33:18 +0000 (23:33 +0800)
As most (all?) users of algif_skcipher are single-threaded and
therefore always write before reading from an algif_skcipher
socket, they never block and exercise that code-path.

It turns out that code path doesn't even work because we never
reload ctx->used after waking up so we never even see the new
data and immediately return an error (and a loud WARN_ON).

This patch fixes this by always reloading ctx->used.

Reported-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Stephan Mueller <smueller@chronox.de>

No differences found