pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
compiler-rt-netbsd: Intercept getgrouplist(3)/getgroupmembership(3)
Module Name: pkgsrc-wip
Committed By: Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By: kamil
Date: Wed Jan 10 07:01:37 2018 +0100
Changeset: 98c31085f11e90153f025ef812d27a045e758ee2
Modified Files:
compiler-rt-netbsd/distinfo
compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__common__interceptors.inc
compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__interceptors.h
Log Message:
compiler-rt-netbsd: Intercept getgrouplist(3)/getgroupmembership(3)
id(1) now runs under MSan.
Sponsored by <The NetBSD Foundation>
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=98c31085f11e90153f025ef812d27a045e758ee2
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
compiler-rt-netbsd/distinfo | 4 +--
...zer__common_sanitizer__common__interceptors.inc | 38 ++++++++++++++++++++--
...zer__common_sanitizer__platform__interceptors.h | 3 +-
3 files changed, 40 insertions(+), 5 deletions(-)
diffs:
diff --git a/compiler-rt-netbsd/distinfo b/compiler-rt-netbsd/distinfo
index 6650edef19..437b80a586 100644
--- a/compiler-rt-netbsd/distinfo
+++ b/compiler-rt-netbsd/distinfo
@@ -10,13 +10,13 @@ SHA1 (patch-lib_hwasan_hwasan__interceptors.cc) = 45fd48ae7bb21878432f925dea7af8
SHA1 (patch-lib_msan_msan__interceptors.cc) = 92ed308e84b0845f15110e0167f265ed5cea2580
SHA1 (patch-lib_msan_msan__linux.cc) = d75d7587071a9e7a3f6a08a3008af55319e62cab
SHA1 (patch-lib_sanitizer__common_CMakeLists.txt) = fcbf2987ccab5258fe760aef6ef47bd97e0e0b2c
-SHA1 (patch-lib_sanitizer__common_sanitizer__common__interceptors.inc) = ca08a1f6bae8fa092afccee97eac22dc75c13f36
+SHA1 (patch-lib_sanitizer__common_sanitizer__common__interceptors.inc) = 39d91bb5e412fb38a1571af595471b35e70045ed
SHA1 (patch-lib_sanitizer__common_sanitizer__common__interceptors__ioctl.inc) = 231f519a0564aa69d746a7f0bbee1b1aeed927a7
SHA1 (patch-lib_sanitizer__common_sanitizer__internal__defs.h) = 126424635f89439e89371a57754232082e2290c6
SHA1 (patch-lib_sanitizer__common_sanitizer__linux.cc) = 77b7e2d6b177166c4f83bbd550d0e5bacf9a4cc0
SHA1 (patch-lib_sanitizer__common_sanitizer__netbsd__interceptors__ioctl.inc) = 0ed3a4a6467c73247e646e2f7ac8f5ea9e3f4da7
SHA1 (patch-lib_sanitizer__common_sanitizer__netbsd__syscalls.inc) = 6d94bc705f62aeeda363f19a6f073738d3bae3b0
-SHA1 (patch-lib_sanitizer__common_sanitizer__platform__interceptors.h) = 1706f836831956e690963178591c3f6737d495cc
+SHA1 (patch-lib_sanitizer__common_sanitizer__platform__interceptors.h) = 0a9f204d785e88bcb8f6468fb7aa93efebb8ef80
SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc) = ae99697d5331e6b05f26f74c48119f5cacd4c4e0
SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h) = 19490197ac6d275d777f5b79b96c25aa6d4e3d71
SHA1 (patch-lib_sanitizer__common_sanitizer__procmaps__freebsd.cc) = c34f35173466e8fd6d65c550f303fdede9e47bec
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__common__interceptors.inc b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__common__interceptors.inc
index aa9972e9d6..6f09403238 100644
--- a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__common__interceptors.inc
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__common__interceptors.inc
@@ -18,7 +18,7 @@ $NetBSD$
INTERCEPTOR(int, ioctl, int d, unsigned long request, ...) {
// We need a frame pointer, because we call into ioctl_common_[pre|post] which
// can trigger a report and we need to be able to unwind through this
-@@ -6452,6 +6454,374 @@ INTERCEPTOR(wchar_t *, wcsncat, wchar_t
+@@ -6452,6 +6454,407 @@ INTERCEPTOR(wchar_t *, wcsncat, wchar_t
#define INIT_WCSCAT
#endif
@@ -389,11 +389,44 @@ $NetBSD$
+#else
+#define INIT_STRLCPY
+#endif
++
++#if SANITIZER_INTERCEPT_GETGROUPLIST
++INTERCEPTOR(int, getgrouplist, char *name, u32 basegid, u32 *groups, int *ngroups) {
++ void *ctx;
++ int res;
++ COMMON_INTERCEPTOR_ENTER(ctx, getgrouplist, name, basegid, groups, ngroups);
++ if (name) {
++ COMMON_INTERCEPTOR_READ_RANGE(ctx, name, REAL(strlen)(name) + 1);
++ }
++ res = REAL(getgrouplist)(name, basegid, groups, ngroups);
++ if (groups && ngroups)
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, groups, sizeof(*groups) * (*ngroups));
++ return res;
++}
++INTERCEPTOR(int, getgroupmembership, char *name, u32 basegid, u32 *groups, int maxgrp, int *ngroups) {
++ void *ctx;
++ int res;
++ COMMON_INTERCEPTOR_ENTER(ctx, getgroupmembership, name, basegid, groups, maxgrp, ngroups);
++ if (name) {
++ COMMON_INTERCEPTOR_READ_RANGE(ctx, name, REAL(strlen)(name) + 1);
++ }
++ res = REAL(getgroupmembership)(name, basegid, groups, maxgrp, ngroups);
++ if (groups && ngroups)
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, groups, sizeof(*groups) * (*ngroups));
++ return res;
++}
++
++#define INIT_GETGROUPLIST \
++ COMMON_INTERCEPT_FUNCTION(getgrouplist); \
++ COMMON_INTERCEPT_FUNCTION(getgroupmembership)
++#else
++#define INIT_GETGROUPLIST
++#endif
+
static void InitializeCommonInterceptors() {
static u64 metadata_mem[sizeof(MetadataHashMap) / sizeof(u64) + 1];
interceptor_metadata_map = new((void *)&metadata_mem) MetadataHashMap();
-@@ -6663,6 +7033,10 @@ static void InitializeCommonInterceptors
+@@ -6663,6 +7066,11 @@ static void InitializeCommonInterceptors
INIT_GETLOADAVG;
INIT_WCSLEN;
INIT_WCSCAT;
@@ -401,6 +434,7 @@ $NetBSD$
+ INIT_DEVNAME;
+ INIT_SYSCTL;
+ INIT_STRLCPY;
++ INIT_GETGROUPLIST;
#if SANITIZER_NETBSD
COMMON_INTERCEPT_FUNCTION(__libc_mutex_lock);
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__interceptors.h b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__interceptors.h
index 7c037078c0..67898c013a 100644
--- a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__interceptors.h
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__interceptors.h
@@ -2,7 +2,7 @@ $NetBSD$
--- lib/sanitizer_common/sanitizer_platform_interceptors.h.orig 2018-01-08 15:33:13.000000000 +0000
+++ lib/sanitizer_common/sanitizer_platform_interceptors.h
-@@ -432,4 +432,9 @@
+@@ -432,4 +432,10 @@
#define SANITIZER_INTERCEPT_SIGNAL_AND_SIGACTION (!SI_WINDOWS && SI_NOT_FUCHSIA)
#define SANITIZER_INTERCEPT_BSD_SIGNAL SI_ANDROID
@@ -10,5 +10,6 @@ $NetBSD$
+#define SANITIZER_INTERCEPT_DEVNAME SI_NETBSD
+#define SANITIZER_INTERCEPT_SYSCTL SI_NETBSD
+#define SANITIZER_INTERCEPT_STRLCPY SI_NETBSD
++#define SANITIZER_INTERCEPT_GETGROUPLIST SI_NETBSD
+
#endif // #ifndef SANITIZER_PLATFORM_INTERCEPTORS_H
Home |
Main Index |
Thread Index |
Old Index