Skip to content

Commit 91cd0e9

Browse files
authored
Merge pull request wolfSSL#8680 from douzzer/20250416-WC_SANITIZE_DISABLE
20250416-WC_SANITIZE_DISABLE
2 parents 5e8d018 + 049c4a8 commit 91cd0e9

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed

.wolfssl_known_macro_extras

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ CONFIG_IDF_TARGET_ESP32S2
9494
CONFIG_IDF_TARGET_ESP32S3
9595
CONFIG_IDF_TARGET_ESP8266
9696
CONFIG_IDF_TARGET_ESP8684
97+
CONFIG_KASAN
9798
CONFIG_MAIN_TASK_STACK_SIZE
9899
CONFIG_MBEDTLS_CERTIFICATE_BUNDLE
99100
CONFIG_MBEDTLS_PSA_CRYPTO_C
@@ -803,7 +804,6 @@ WOLFSSL_SILABS_TRNG
803804
WOLFSSL_SM4_EBC
804805
WOLFSSL_SNIFFER_NO_RECOVERY
805806
WOLFSSL_SP_ARM32_UDIV
806-
WOLFSSL_SP_DH
807807
WOLFSSL_SP_FAST_NCT_EXPTMOD
808808
WOLFSSL_SP_INT_SQR_VOLATILE
809809
WOLFSSL_STACK_CHECK

linuxkm/module_hooks.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ static int updateFipsHash(void)
755755
goto out;
756756
}
757757

758+
WC_SANITIZE_DISABLE();
759+
758760
ret = crypto_shash_update(desc, (byte *)(wc_ptr_t)first, (word32)code_sz);
759761
if (ret) {
760762
pr_err("crypto_shash_update failed: err %d\n", ret);
@@ -781,6 +783,8 @@ static int updateFipsHash(void)
781783
goto out;
782784
}
783785

786+
WC_SANITIZE_ENABLE();
787+
784788
ret = crypto_shash_final(desc, hash);
785789
if (ret) {
786790
pr_err("crypto_shash_final failed: err %d\n", ret);

wolfssl/wolfcrypt/settings.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3673,6 +3673,15 @@ extern void uITRON4_free(void *p) ;
36733673
#endif
36743674
#undef WOLFSSL_MIN_AUTH_TAG_SZ
36753675
#define WOLFSSL_MIN_AUTH_TAG_SZ 4
3676+
3677+
#ifdef CONFIG_KASAN
3678+
#ifndef WC_SANITIZE_DISABLE
3679+
#define WC_SANITIZE_DISABLE() kasan_disable_current()
3680+
#endif
3681+
#ifndef WC_SANITIZE_ENABLE
3682+
#define WC_SANITIZE_ENABLE() kasan_enable_current()
3683+
#endif
3684+
#endif
36763685
#endif
36773686

36783687

wolfssl/wolfcrypt/types.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,6 +1886,13 @@ typedef struct w64wrapper {
18861886
#define RESTORE_VECTOR_REGISTERS() WC_DO_NOTHING
18871887
#endif
18881888

1889+
#ifndef WC_SANITIZE_DISABLE
1890+
#define WC_SANITIZE_DISABLE() WC_DO_NOTHING
1891+
#endif
1892+
#ifndef WC_SANITIZE_ENABLE
1893+
#define WC_SANITIZE_ENABLE() WC_DO_NOTHING
1894+
#endif
1895+
18891896
#if FIPS_VERSION_GE(5,1)
18901897
#define WC_SPKRE_F(x,y) wolfCrypt_SetPrivateKeyReadEnable_fips((x),(y))
18911898
#define PRIVATE_KEY_LOCK() WC_SPKRE_F(0,WC_KEYTYPE_ALL)

0 commit comments

Comments
 (0)