[llvm-branch-commits] [compiler-rt] abc0cf9 - [sanitizer] Intercept lstat on Linux

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Dec 21 10:19:16 PST 2021


Author: Vitaly Buka
Date: 2021-12-21T10:18:50-08:00
New Revision: abc0cf92bb14e1cf5a7f682dc5d3179e168ac145

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

LOG: [sanitizer] Intercept lstat on Linux

It's availible from GLIBC 2.33
Fixes use-of-uninitialized-value llvm/lib/Support/Unix/Path.inc:467:29 in llvm::sys::fs::remove(llvm::Twine const&, bool)

(cherry picked from commit 39ead64e3f73045c7e0c72aed08c14b277828fb4)

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 586cae946ae2f..b0e01930a379d 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -461,9 +461,9 @@
 #define SANITIZER_INTERCEPT_STAT                                        \
   (SI_FREEBSD || SI_MAC || SI_ANDROID || SI_NETBSD || SI_SOLARIS ||     \
    SI_STAT_LINUX)
-#define SANITIZER_INTERCEPT_LSTAT (SI_NETBSD || SI_FREEBSD)
-#define SANITIZER_INTERCEPT___XSTAT                             \
-  (!SANITIZER_INTERCEPT_STAT && SI_POSIX) || SI_STAT_LINUX
+#define SANITIZER_INTERCEPT_LSTAT (SI_NETBSD || SI_FREEBSD || SI_STAT_LINUX)
+#define SANITIZER_INTERCEPT___XSTAT \
+  ((!SANITIZER_INTERCEPT_STAT && SI_POSIX) || SI_STAT_LINUX)
 #define SANITIZER_INTERCEPT___XSTAT64 SI_LINUX_NOT_ANDROID
 #define SANITIZER_INTERCEPT___LXSTAT SANITIZER_INTERCEPT___XSTAT
 #define SANITIZER_INTERCEPT___LXSTAT64 SI_LINUX_NOT_ANDROID


        


More information about the llvm-branch-commits mailing list