[compiler-rt] b8f6c1f - [Sanitizers] intercept getgrouplist on Linux and FreeBSD.

David Carlier via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 13 10:43:34 PDT 2021


Author: David Carlier
Date: 2021-09-13T18:42:43+01:00
New Revision: b8f6c1fd967a583f2565ba2b16f9ab5f0d304dbc

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

LOG: [Sanitizers] intercept getgrouplist on Linux and FreeBSD.

Reviewed By: vitalyb

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

Added: 
    compiler-rt/test/sanitizer_common/TestCases/Linux/getgrouplist.cpp

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

Removed: 
    compiler-rt/test/sanitizer_common/TestCases/NetBSD/getgrouplist.cpp


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
index 535f1e3a0d410..ba70cd9b5bde0 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -498,7 +498,8 @@
 #define SANITIZER_INTERCEPT_GID_FROM_GROUP SI_NETBSD
 #define SANITIZER_INTERCEPT_ACCESS (SI_NETBSD || SI_FREEBSD)
 #define SANITIZER_INTERCEPT_FACCESSAT (SI_NETBSD || SI_FREEBSD)
-#define SANITIZER_INTERCEPT_GETGROUPLIST SI_NETBSD
+#define SANITIZER_INTERCEPT_GETGROUPLIST \
+  (SI_NETBSD || SI_FREEBSD || SI_LINUX)
 #define SANITIZER_INTERCEPT_STRLCPY \
   (SI_NETBSD || SI_FREEBSD || SI_MAC || SI_ANDROID)
 

diff  --git a/compiler-rt/test/sanitizer_common/TestCases/NetBSD/getgrouplist.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/getgrouplist.cpp
similarity index 92%
rename from compiler-rt/test/sanitizer_common/TestCases/NetBSD/getgrouplist.cpp
rename to compiler-rt/test/sanitizer_common/TestCases/Linux/getgrouplist.cpp
index 49655542ec6dc..475740fd2ff76 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/NetBSD/getgrouplist.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/getgrouplist.cpp
@@ -1,4 +1,6 @@
 // RUN: %clangxx -O0 -g %s -o %t && %run %t
+//
+// REQUIRES: linux, freebsd, netbsd
 
 #include <stdlib.h>
 #include <unistd.h>


        


More information about the llvm-commits mailing list