From: Shaun Tancheff Date: Wed, 18 Oct 2023 07:17:29 +0000 (-0500) Subject: LU-17161 build: Avoid fortify_memset in OBD_FREE_PTR X-Git-Tag: 2.15.62~199 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=58cc8cf98e37e9d8149d5f605a75d56f2cd4eb70;p=fs%2Flustre-release.git LU-17161 build: Avoid fortify_memset in OBD_FREE_PTR OBD_FREE_PTR will optionally clear the about to be free()d memory. Unfortunately fortify_memset_chk() hits some false positives. We can use __underlying_memset() if it is defined, to avoid the fortify_memset_chk. Test-Parameters: trivial Signed-off-by: Shaun Tancheff Change-Id: Iced53f22b97ed90e0970625c4fcbaa404054c54a Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52559 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Petros Koutoupis Reviewed-by: Oleg Drokin --- diff --git a/lustre/include/obd_support.h b/lustre/include/obd_support.h index 574d907..a2e593e 100644 --- a/lustre/include/obd_support.h +++ b/lustre/include/obd_support.h @@ -918,7 +918,11 @@ do { \ #define POISON(ptr, c, s) do {} while (0) #define POISON_PTR(ptr) ((void)0) #else +#ifdef __underlying_memset +#define POISON(ptr, c, s) __underlying_memset(ptr, c, s) +#else #define POISON(ptr, c, s) memset(ptr, c, s) +#endif #define POISON_PTR(ptr) (ptr) = (void *)0xdeadbeef #endif