]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: caam - Pad SG length when allocating hash edesc
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 12 Sep 2024 09:57:13 +0000 (17:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:33:14 +0000 (16:33 +0200)
commite52bab5f2b40fca6c27f097bce7d43c65500bff6
tree15895222e9e6e1ac622deab1e19831dddc6089ab
parent3a1bb47f24106a7b0b044839114c5f900ae84798
crypto: caam - Pad SG length when allocating hash edesc

[ Upstream commit 5124bc96162667766f6120b19f57a640c2eccb2a ]

Because hardware will read in multiples of 4 SG entries, ensure
the allocated length is always padded.  This was already done
by some callers of ahash_edesc_alloc, but ahash_digest was conspicuously
missing.

In any case, doing it in the allocation function ensures that the
memory is always there.

Reported-by: Guangwu Zhang <guazhang@redhat.com>
Fixes: a5e5c13398f3 ("crypto: caam - fix S/G table passing page boundary")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/caam/caamhash.c