Added no_sanitize_hwaddress attribute for PyObject_Free 32/263832/1 accepted/tizen_6.5_base accepted/tizen_6.5_base_tool accepted/tizen_7.0_base accepted/tizen_7.0_base_hotfix accepted/tizen_7.0_base_tool accepted/tizen_7.0_base_tool_hotfix tizen_6.5_base tizen_7.0_base tizen_7.0_base_hotfix accepted/tizen/6.5/base/20230714.002641 accepted/tizen/6.5/base/tool/20211027.120703 accepted/tizen/7.0/base/20230714.003049 accepted/tizen/7.0/base/hotfix/20230714.003900 accepted/tizen/7.0/base/tool/20221028.122045 accepted/tizen/7.0/base/tool/hotfix/20221115.090627 accepted/tizen/base/tool/20210913.002645 submit/tizen_6.5_base/20211026.180901 submit/tizen_6.5_base/20211027.183101 submit/tizen_6.5_base/20211027.201001 submit/tizen_7.0_base/20221028.201101 submit/tizen_7.0_base_hotfix/20221115.161601 submit/tizen_base/20210910.123310 tizen_6.5.m2_release tizen_7.0_m2_release
authorAndrey Kazmin <a.kazmin@partner.samsung.com>
Wed, 31 Mar 2021 12:37:23 +0000 (15:37 +0300)
committerAndrey Kazmin <a.kazmin@partner.samsung.com>
Fri, 10 Sep 2021 11:32:12 +0000 (14:32 +0300)
Change-Id: I52dc2e8c405064463d84201ee3fb8f5291d47c9b
Signed-off-by: Andrey Kazmin <a.kazmin@partner.samsung.com>
Objects/obmalloc.c

index 2067cf5..99b577a 100644 (file)
@@ -8,6 +8,12 @@
  #else
   #define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
  #endif
+ #if __has_feature(hwaddress_sanitizer) /* is HWASAN enabled? */
+  #define ATTRIBUTE_NO_SANITIZE_HWADDRESS \
+        __attribute__((no_sanitize("hwaddress")))
+ #else
+  #define ATTRIBUTE_NO_SANITIZE_HWADDRESS
+ #endif
 #else
  #if defined(__SANITIZE_ADDRESS__)  /* GCC 4.8.x, is ASAN enabled? */
   #define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS \
  #else
   #define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
  #endif
+ #if defined(__SANITIZE_HWADDRESS__) /* is HWASAN enabled? */
+  #define ATTRIBUTE_NO_SANITIZE_HWADDRESS \
+        __attribute__((no_sanitize_hwaddress))
+ #else
+  #define ATTRIBUTE_NO_SANITIZE_HWADDRESS
+ #endif
 #endif
 
 #ifdef WITH_PYMALLOC
@@ -996,6 +1008,7 @@ redirect:
 
 #undef PyObject_Free
 ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
+ATTRIBUTE_NO_SANITIZE_HWADDRESS
 void
 PyObject_Free(void *p)
 {
@@ -1227,6 +1240,7 @@ redirect:
 
 #undef PyObject_Realloc
 ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
+ATTRIBUTE_NO_SANITIZE_HWADDRESS
 void *
 PyObject_Realloc(void *p, size_t nbytes)
 {