From: Lasse Collin Date: Thu, 14 Sep 2023 13:34:07 +0000 (+0300) Subject: liblzma: Mark crc64_clmul() with __attribute__((__no_sanitize_address__)). X-Git-Tag: v5.5.1alpha~200 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f44ef86758a41a8ec814096f4cb6ee6de04c82e;p=thirdparty%2Fxz.git liblzma: Mark crc64_clmul() with __attribute__((__no_sanitize_address__)). Thanks to Agostino Sarubbo. Fixes: https://github.com/tukaani-project/xz/issues/62 --- diff --git a/src/liblzma/check/crc64_fast.c b/src/liblzma/check/crc64_fast.c index f6e872ed..62c2c9bb 100644 --- a/src/liblzma/check/crc64_fast.c +++ b/src/liblzma/check/crc64_fast.c @@ -206,6 +206,14 @@ calc_hi(uint64_t poly, uint64_t a) #if (defined(__GNUC__) || defined(__clang__)) && !defined(__EDG__) __attribute__((__target__("ssse3,sse4.1,pclmul"))) #endif +// The intrinsics use 16-byte-aligned reads from buf, thus they may read +// up to 15 bytes before or after the buffer (depending on the alignment +// of the buf argument). The values of the extra bytes are ignored. +// This unavoidably trips -fsanitize=address so address sanitizier has +// to be disabled for this function. +#if lzma_has_attribute(__no_sanitize_address__) +__attribute__((__no_sanitize_address__)) +#endif static uint64_t crc64_clmul(const uint8_t *buf, size_t size, uint64_t crc) {