zstd: declare __asan_*_memory_region() for user space builds

ZSTD_ASAN_POISON() and ZSTD_ASAN_UNPOISON() call
__asan_poison_memory_region() and __asan_unpoison_memory_region()
directly, but nothing declares them in the user space build. The kernel
block just above declares both -- and stubs them out, since KASAN does
not provide them -- while the user space block was left with only the
macros.

That builds where an implicit function declaration is a warning, since
the real symbols come from libasan at link time, but fails on compilers
that make it an error, as GCC 14 and newer do by default:

    zfs_zstd.c:278:34: error: implicit declaration of function
    '__asan_poison_memory_region' [-Wimplicit-function-declaration]

Declare both in the user space block, mirroring the kernel block.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Alexander Moch <[email protected]>
Closes #19017
This commit is contained in:
Alexander Moch authored and GitHub committed 2026-09-02 15:13:51 -07:00
1 parent b1fac4b7c6
commit b824f3116d
1 file changed
+2
+2
View File
@@ -275,6 +275,8 @@ void __asan_poison_memory_region(void const volatile *addr, size_t size) {};
/* User space. */
#if defined(ADDRESS_SANITIZER) && !defined(_KERNEL)
void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
void __asan_poison_memory_region(void const volatile *addr, size_t size);
#define ZSTD_ASAN_POISON(p, n) __asan_poison_memory_region((p), (n))
#define ZSTD_ASAN_UNPOISON(p, n) __asan_unpoison_memory_region((p), (n))
#else