]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
crypto: api - Add scaffolding to change completion function signature
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 31 Jan 2023 08:01:45 +0000 (16:01 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 9 Aug 2023 09:37:43 +0000 (11:37 +0200)
commitc8353331dd58a002d9515c52e0483b464f5a8545
treeee2bf1d89bae91c525a3d492c148db211f38c5e5
parent399a6a9bd54dc8eba0abdc4d7fb400933a99c815
crypto: api - Add scaffolding to change completion function signature

BugLink: https://bugs.launchpad.net/bugs/2028580
[ Upstream commit c35e03eaece71101ff6cbf776b86403860ac8cc3 ]

The crypto completion function currently takes a pointer to a
struct crypto_async_request object.  However, in reality the API
does not allow the use of any part of the object apart from the
data field.  For example, ahash/shash will create a fake object
on the stack to pass along a different data field.

This leads to potential bugs where the user may try to dereference
or otherwise use the crypto_async_request object.

This patch adds some temporary scaffolding so that the completion
function can take a void * instead.  Once affected users have been
converted this can be removed.

The helper crypto_request_complete will remain even after the
conversion is complete.  It should be used instead of calling
the completion function directly.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Stable-dep-of: 4140aafcff16 ("crypto: engine - fix crypto_queue backlog handling")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
include/crypto/algapi.h
include/linux/crypto.h