]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
crypto: ahash - Fix EINPROGRESS notification callback
authorHerbert Xu <herbert@gondor.apana.org.au>
Mon, 10 Apr 2017 09:27:57 +0000 (17:27 +0800)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Wed, 17 May 2017 16:37:51 +0000 (13:37 -0300)
commit78acc12f8d2fe4c6916baadd0b49348576cc3b67
tree4e49a0dfcb0bd72564a2cdba9f9652432216d881
parentc074a2f15d30b578a2b0cdd86351db55f94dad0f
crypto: ahash - Fix EINPROGRESS notification callback

BugLink: http://bugs.launchpad.net/bugs/1687045
commit ef0579b64e93188710d48667cb5e014926af9f1b upstream.

The ahash API modifies the request's callback function in order
to clean up after itself in some corner cases (unaligned final
and missing finup).

When the request is complete ahash will restore the original
callback and everything is fine.  However, when the request gets
an EBUSY on a full queue, an EINPROGRESS callback is made while
the request is still ongoing.

In this case the ahash API will incorrectly call its own callback.

This patch fixes the problem by creating a temporary request
object on the stack which is used to relay EINPROGRESS back to
the original completion function.

This patch also adds code to preserve the original flags value.

Fixes: ab6bf4e5e5e4 ("crypto: hash - Fix the pointer voodoo in...")
Reported-by: Sabrina Dubroca <sd@queasysnail.net>
Tested-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
crypto/ahash.c
include/crypto/internal/hash.h