Skip to content

Commit dec0fb3

Browse files
arndbherbertx
authored andcommitted
crypto: jitterentropy - build without sanitizer
Recent clang-9 snapshots double the kernel stack usage when building this file with -O0 -fsanitize=kernel-hwaddress, compared to clang-8 and older snapshots, this changed between commits svn364966 and svn366056: crypto/jitterentropy.c:516:5: error: stack frame size of 2640 bytes in function 'jent_entropy_init' [-Werror,-Wframe-larger-than=] int jent_entropy_init(void) ^ crypto/jitterentropy.c:185:14: error: stack frame size of 2224 bytes in function 'jent_lfsr_time' [-Werror,-Wframe-larger-than=] static __u64 jent_lfsr_time(struct rand_data *ec, __u64 time, __u64 loop_cnt) ^ I prepared a reduced test case in case any clang developers want to take a closer look, but from looking at the earlier output it seems that even with clang-8, something was very wrong here. Turn off any KASAN and UBSAN sanitizing for this file, as that likely clashes with -O0 anyway. Turning off just KASAN avoids the warning already, but I suspect both of these have undesired side-effects for jitterentropy. Link: https://godbolt.org/z/fDcwZ5 Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 3bd4952 commit dec0fb3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

crypto/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ obj-$(CONFIG_CRYPTO_ANSI_CPRNG) += ansi_cprng.o
132132
obj-$(CONFIG_CRYPTO_DRBG) += drbg.o
133133
obj-$(CONFIG_CRYPTO_JITTERENTROPY) += jitterentropy_rng.o
134134
CFLAGS_jitterentropy.o = -O0
135+
KASAN_SANITIZE_jitterentropy.o = n
136+
UBSAN_SANITIZE_jitterentropy.o = n
135137
jitterentropy_rng-y := jitterentropy.o jitterentropy-kcapi.o
136138
obj-$(CONFIG_CRYPTO_TEST) += tcrypt.o
137139
obj-$(CONFIG_CRYPTO_GHASH) += ghash-generic.o

0 commit comments

Comments
 (0)