[compiler-rt] 6617778 - sanitizer: enable getentropy interception on Linux/GLIBC 2.25 and onwards

David CARLIER via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 26 00:04:18 PDT 2023


Author: David CARLIER
Date: 2023-06-26T08:04:08+01:00
New Revision: 6617778a784fdacbc4cc6078e0826d9818a4dbe1

URL: https://github.com/llvm/llvm-project/commit/6617778a784fdacbc4cc6078e0826d9818a4dbe1
DIFF: https://github.com/llvm/llvm-project/commit/6617778a784fdacbc4cc6078e0826d9818a4dbe1.diff

LOG: sanitizer: enable getentropy interception on Linux/GLIBC 2.25 and onwards

https://man7.org/linux/man-pages/man3/getentropy.3.html

Reviewers: melver

Reviewed-By: melver

Differential Revision: https://reviews.llvm.org/D153723

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
index ec67e255b1d4c..c740778b6228f 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -579,7 +579,8 @@
 #define SANITIZER_INTERCEPT___CXA_ATEXIT SI_NETBSD
 #define SANITIZER_INTERCEPT_ATEXIT SI_NETBSD
 #define SANITIZER_INTERCEPT_PTHREAD_ATFORK SI_NETBSD
-#define SANITIZER_INTERCEPT_GETENTROPY SI_FREEBSD
+#define SANITIZER_INTERCEPT_GETENTROPY \
+  ((SI_LINUX && __GLIBC_PREREQ(2, 25)) || SI_FREEBSD)
 #define SANITIZER_INTERCEPT_QSORT \
   (SI_POSIX && !SI_IOSSIM && !SI_WATCHOS && !SI_TVOS && !SI_ANDROID)
 #define SANITIZER_INTERCEPT_QSORT_R SI_GLIBC


        


More information about the llvm-commits mailing list