]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: hisilicon: Wipe entire pool on error
authorKees Cook <keescook@chromium.org>
Fri, 6 Jan 2023 04:19:48 +0000 (20:19 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:33:50 +0000 (09:33 +0100)
commit4bf7654cf3199ca59ff68c657c772aadc24983e8
tree9be0f025a35075bfe1ebd19d62fa8c40f69f52cb
parentcd054377c05211581d5fd1df778dec200ff11ca1
crypto: hisilicon: Wipe entire pool on error

[ Upstream commit f1ef6dcb3baac3766a373494d4e63204e4ba0470 ]

To work around a Clang __builtin_object_size bug that shows up under
CONFIG_FORTIFY_SOURCE and UBSAN_BOUNDS, move the per-loop-iteration
mem_block wipe into a single wipe of the entire pool structure after
the loop.

Reported-by: Nathan Chancellor <nathan@kernel.org>
Link: https://github.com/ClangBuiltLinux/linux/issues/1780
Cc: Weili Qian <qianweili@huawei.com>
Cc: Zhou Wang <wangzhou1@hisilicon.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-crypto@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Tested-by: Nathan Chancellor <nathan@kernel.org> # build
Link: https://lore.kernel.org/r/20230106041945.never.831-kees@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/hisilicon/sgl.c