]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: hisilicon/sec2 - fix for aead invalid authsize
authorWenkai Lin <linwenkai6@hisilicon.com>
Fri, 13 Dec 2024 09:13:35 +0000 (17:13 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:50:01 +0000 (12:50 +0100)
commit778a73f8d38dee4151ed72fcc83ef339dabf3934
tree54df86a7a9be19527f4c4ee2d1ac7031487fd32c
parent37e032978e55e37156c2dc35c15efdeefc784097
crypto: hisilicon/sec2 - fix for aead invalid authsize

[ Upstream commit a5a9d959936499a3106a1bf3b9070875d0d3dec4 ]

When the digest alg is HMAC-SHAx or another, the authsize may be less
than 4 bytes and mac_len of the BD is set to zero, the hardware considers
it a BD configuration error and reports a ras error, so the sec driver
needs to switch to software calculation in this case, this patch add a
check for it and remove unnecessary check that has been done by crypto.

Fixes: 2f072d75d1ab ("crypto: hisilicon - Add aead support on SEC2")
Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com>
Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/hisilicon/sec2/sec.h
drivers/crypto/hisilicon/sec2/sec_crypto.c