[PATCH] D68178: compiler-rt: use __GLIBC_PREREQ for SANITIZER_INTERCEPT_GETRANDOM

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 27 19:26:40 PDT 2019


vitalybuka created this revision.
vitalybuka added a reviewer: eugenis.
Herald added subscribers: llvm-commits, Sanitizers, dberris.
Herald added projects: Sanitizers, LLVM.

Fixes https://github.com/google/oss-fuzz/issues/2836


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D68178

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


Index: compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
+++ compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -14,6 +14,7 @@
 #define SANITIZER_PLATFORM_INTERCEPTORS_H
 
 #include "sanitizer_internal_defs.h"
+#include "sanitizer_glibc_version.h"
 
 #if SANITIZER_POSIX
 # define SI_POSIX 1
@@ -566,10 +567,9 @@
 #define SANITIZER_INTERCEPT_GETUSERSHELL (SI_POSIX && !SI_ANDROID)
 #define SANITIZER_INTERCEPT_SL_INIT (SI_FREEBSD || SI_NETBSD)
 
-#define SANITIZER_INTERCEPT_GETRANDOM SI_LINUX
+#define SANITIZER_INTERCEPT_GETRANDOM (SI_LINUX && __GLIBC_PREREQ(2, 25))
 #define SANITIZER_INTERCEPT___CXA_ATEXIT SI_NETBSD
 #define SANITIZER_INTERCEPT_ATEXIT SI_NETBSD
 #define SANITIZER_INTERCEPT_PTHREAD_ATFORK SI_NETBSD
 
-
 #endif  // #ifndef SANITIZER_PLATFORM_INTERCEPTORS_H


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68178.222279.patch
Type: text/x-patch
Size: 954 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190928/0db03b5e/attachment.bin>


More information about the llvm-commits mailing list