]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: api - Fix larval relookup type and mask
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 14 Feb 2025 02:31:25 +0000 (10:31 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:39:20 +0000 (14:39 +0200)
commit6d4e56e4c5817bb50d003b3079526768deab6999
tree27cbd8866068556a6a9f5cf0b0602221160ea517
parenteae034cdcee923875b005c412eedacef5e22be96
crypto: api - Fix larval relookup type and mask

[ Upstream commit 7505436e2925d89a13706a295a6734d6cabb4b43 ]

When the lookup is retried after instance construction, it uses
the type and mask from the larval, which may not match the values
used by the caller.  For example, if the caller is requesting for
a !NEEDS_FALLBACK algorithm, it may end up getting an algorithm
that needs fallbacks.

Fix this by making the caller supply the type/mask and using that
for the lookup.

Reported-by: Coiby Xu <coxu@redhat.com>
Fixes: 96ad59552059 ("crypto: api - Remove instance larval fulfilment")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
crypto/api.c