aboutsummaryrefslogtreecommitdiffstats
path: root/module/zstd
diff options
context:
space:
mode:
Diffstat (limited to 'module/zstd')
-rw-r--r--module/zstd/lib/zstd.c7
-rw-r--r--module/zstd/zfs_zstd.c6
2 files changed, 3 insertions, 10 deletions
diff --git a/module/zstd/lib/zstd.c b/module/zstd/lib/zstd.c
index 2766e5b74..b57a9ef40 100644
--- a/module/zstd/lib/zstd.c
+++ b/module/zstd/lib/zstd.c
@@ -279,12 +279,9 @@ intptr_t __msan_test_shadow(const volatile void *x, size_t size);
#endif
/* detects whether we are being compiled under asan */
-#if defined (__has_feature)
-# if __has_feature(address_sanitizer)
-# define ADDRESS_SANITIZER 1
-# endif
-#elif defined(__SANITIZE_ADDRESS__)
+#if defined (ZFS_ASAN_ENABLED)
# define ADDRESS_SANITIZER 1
+# define ZSTD_ASAN_DONT_POISON_WORKSPACE
#endif
#if defined (ADDRESS_SANITIZER)
diff --git a/module/zstd/zfs_zstd.c b/module/zstd/zfs_zstd.c
index 2c698716c..9ff9ec3ec 100644
--- a/module/zstd/zfs_zstd.c
+++ b/module/zstd/zfs_zstd.c
@@ -207,11 +207,7 @@ static struct zstd_pool *zstd_mempool_dctx;
* and while ASAN does this, KASAN defines that and does not. So to avoid
* changing the external code, we do this.
*/
-#if defined(__has_feature)
-#if __has_feature(address_sanitizer)
-#define ADDRESS_SANITIZER 1
-#endif
-#elif defined(__SANITIZE_ADDRESS__)
+#if defined(ZFS_ASAN_ENABLED)
#define ADDRESS_SANITIZER 1
#endif
#if defined(_KERNEL) && defined(ADDRESS_SANITIZER)