mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
cfa1d74495
Arnd reports that with Kees's latest VLA patches applied, the HMAC handling in the QAT driver uses a worst case estimate of 160 bytes for the SHA blocksize, allowing the compiler to determine the size of the stack frame at compile time and throw a warning: drivers/crypto/qat/qat_common/qat_algs.c: In function 'qat_alg_do_precomputes': drivers/crypto/qat/qat_common/qat_algs.c:257:1: error: the frame size of 1112 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] Given that this worst case estimate is only 32 bytes larger than the actual block size of SHA-512, the use of a VLA here was hiding the excessive size of the stack frame from the compiler, and so we should try to move these buffers off the stack. So move the ipad/opad buffers and the various SHA state descriptors into the tfm context struct. Since qat_alg_do_precomputes() is only called in the context of a setkey() operation, this should be safe. Using SHA512_BLOCK_SIZE for the size of the ipad/opad buffers allows them to be used by SHA-1/SHA-256 as well. Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> |
||
---|---|---|
.. | ||
adf_accel_devices.h | ||
adf_accel_engine.c | ||
adf_admin.c | ||
adf_aer.c | ||
adf_cfg_common.h | ||
adf_cfg_strings.h | ||
adf_cfg_user.h | ||
adf_cfg.c | ||
adf_cfg.h | ||
adf_common_drv.h | ||
adf_ctl_drv.c | ||
adf_dev_mgr.c | ||
adf_hw_arbiter.c | ||
adf_init.c | ||
adf_isr.c | ||
adf_pf2vf_msg.c | ||
adf_pf2vf_msg.h | ||
adf_sriov.c | ||
adf_transport_access_macros.h | ||
adf_transport_debug.c | ||
adf_transport_internal.h | ||
adf_transport.c | ||
adf_transport.h | ||
adf_vf2pf_msg.c | ||
adf_vf_isr.c | ||
icp_qat_fw_init_admin.h | ||
icp_qat_fw_la.h | ||
icp_qat_fw_loader_handle.h | ||
icp_qat_fw_pke.h | ||
icp_qat_fw.h | ||
icp_qat_hal.h | ||
icp_qat_hw.h | ||
icp_qat_uclo.h | ||
Makefile | ||
qat_algs.c | ||
qat_asym_algs.c | ||
qat_crypto.c | ||
qat_crypto.h | ||
qat_hal.c | ||
qat_uclo.c |