[PATCH] crypto/ecc: increase frame warning limit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Peng Hao <flyingpeng@xxxxxxxxxxx>

When building kernel with clang, which will typically
have sanitizers enabled, there is a warning about a large stack frame.

crypto/ecc.c:1129:13: error: stack frame size (2136) exceeds limit (2048) in 'ecc_point_double_jacobian' [-Werror,-Wframe-larger-than]
static void ecc_point_double_jacobian(u64 *x1, u64 *y1, u64 *z1,
            ^

Since many arrays are defined in ecc_point_double_jacobian, they occupy a
lot of stack space, but are difficult to adjust. just increase the limit
for configurations that have KASAN or KCSAN enabled.

Signed-off-by: Peng Hao <flyingpeng@xxxxxxxxxxx>
---
 crypto/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/crypto/Makefile b/crypto/Makefile
index edbbaa3ffef5..ab7bebaa7218 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -190,6 +190,12 @@ obj-$(CONFIG_CRYPTO_ECC) += ecc.o
 obj-$(CONFIG_CRYPTO_ESSIV) += essiv.o
 obj-$(CONFIG_CRYPTO_CURVE25519) += curve25519-generic.o
 
+ifneq ($(CONFIG_FRAME_WARN),0)
+ifeq ($(filter y,$(CONFIG_KASAN)$(CONFIG_KCSAN)),y)
+CFLAGS_ecc.o = -Wframe-larger-than=2776
+endif
+endif
+
 ecdh_generic-y += ecdh.o
 ecdh_generic-y += ecdh_helper.o
 obj-$(CONFIG_CRYPTO_ECDH) += ecdh_generic.o
-- 
2.27.0





[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux