pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
compiler-rt-netbsd: Sync with local patches
Module Name: pkgsrc-wip
Committed By: Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By: kamil
Date: Tue Jan 23 13:46:44 2018 +0100
Changeset: a67f6aaef1929c0dda3b2e7b56cb563326251319
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
compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h
Log Message:
compiler-rt-netbsd: Sync with local patches
1. Adapt sysctl(2)-like interceptors with reality.
2. Implement getnetent(3)-like interceptors.
This corrects execution of netstat(1) with more (all?) possible options.
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=a67f6aaef1929c0dda3b2e7b56cb563326251319
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
compiler-rt-netbsd/distinfo | 6 +-
...zer__common_sanitizer__common__interceptors.inc | 123 ++++++++++++++++++---
...zer__common_sanitizer__platform__interceptors.h | 3 +-
...r__common_sanitizer__platform__limits__netbsd.h | 23 ++--
4 files changed, 127 insertions(+), 28 deletions(-)
diffs:
diff --git a/compiler-rt-netbsd/distinfo b/compiler-rt-netbsd/distinfo
index b8fd9c8918..3b9c416096 100644
--- a/compiler-rt-netbsd/distinfo
+++ b/compiler-rt-netbsd/distinfo
@@ -10,15 +10,15 @@ SHA1 (patch-lib_hwasan_hwasan__interceptors.cc) = c49ab3759728bbd3e27580a3d0d3e2
SHA1 (patch-lib_msan_msan__interceptors.cc) = 42f9f0416e1b30f15fb0f104d70d4b0ead83519f
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) = 796ff484686594e426d45bac5b4c736811aa090c
+SHA1 (patch-lib_sanitizer__common_sanitizer__common__interceptors.inc) = 052071b28d6852e3111910d207d7c40b3acc676d
SHA1 (patch-lib_sanitizer__common_sanitizer__common__interceptors__ioctl.inc) = 231f519a0564aa69d746a7f0bbee1b1aeed927a7
SHA1 (patch-lib_sanitizer__common_sanitizer__internal__defs.h) = 2ff74de8be0825ca4162969cb2ed367654934a17
SHA1 (patch-lib_sanitizer__common_sanitizer__linux.cc) = b1057f01ae2f03498613eb1a02501c8a65d16fed
SHA1 (patch-lib_sanitizer__common_sanitizer__netbsd__interceptors__ioctl.inc) = 501876c2593058c94e443dc1c6bddfc86a7b989a
SHA1 (patch-lib_sanitizer__common_sanitizer__netbsd__syscalls.inc) = 47b0815e355eba0b3c6b5e56c35568a435c8d7a6
-SHA1 (patch-lib_sanitizer__common_sanitizer__platform__interceptors.h) = e5d15e59469e927344fb4bb956d8ec350cb9454e
+SHA1 (patch-lib_sanitizer__common_sanitizer__platform__interceptors.h) = 9c8de18fa1661df511575a69ffdc2ff4746cd9de
SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc) = 47236661e37673d66a52e80c3f55be13029014ca
-SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h) = f4bd9da33ad0f9702b80d99d49451ca7f15ee2b7
+SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h) = c58d9a09feaad37b02fa6490b9b3588a56663a76
SHA1 (patch-lib_sanitizer__common_sanitizer__procmaps__freebsd.cc) = 7e0deaeeada33bd13575251e5d8fb4a0ee4c53e8
SHA1 (patch-lib_scudo_scudo__platform.h) = d44bd094136dd0381db87344fbbcad1dcfd44dc1
SHA1 (patch-lib_tsan_rtl_tsan__interceptors.cc) = 4fbaa64e3f8d28cdbab6783c296dfd31cecb45a5
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 488dd0fff9..48e3fd64d9 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
@@ -166,7 +166,7 @@ $NetBSD$
return res;
}
-@@ -6608,6 +6658,667 @@ INTERCEPTOR(int, getgroupmembership, con
+@@ -6608,6 +6658,757 @@ INTERCEPTOR(int, getgroupmembership, con
#define INIT_GETGROUPLIST
#endif
@@ -532,9 +532,11 @@ $NetBSD$
+ if (newp)
+ COMMON_INTERCEPTOR_READ_RANGE(ctx, newp, newlen);
+ res = REAL(sysctl)(name, namelen, oldp, oldlenp, newp, newlen);
-+ if (!res && oldp && oldlenp) {
-+ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, oldlenp, sizeof(*oldlenp));
-+ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, oldp, *oldlenp);
++ if (!res) {
++ if (oldlenp)
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, oldlenp, sizeof(*oldlenp));
++ if (oldp && oldlenp)
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, oldp, *oldlenp);
+ }
+ return res;
+}
@@ -549,8 +551,10 @@ $NetBSD$
+ COMMON_INTERCEPTOR_READ_RANGE(ctx, sname, REAL(strlen)(sname) + 1);
+ res = REAL(sysctlbyname)(sname, oldp, oldlenp, newp, newlen);
+ if (!res) {
-+ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, oldlenp, sizeof(*oldlenp));
-+ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, oldp, *oldlenp);
++ if (oldlenp)
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, oldlenp, sizeof(*oldlenp));
++ if (oldp && oldlenp)
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, oldp, *oldlenp);
+ }
+ return res;
+}
@@ -566,8 +570,10 @@ $NetBSD$
+ // It's also used mostly internally
+ res = REAL(sysctlgetmibinfo)(sname, name, namelenp, cname, csz, rnode, v);
+ if (!res) {
-+ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, namelenp, sizeof(*namelenp));
-+ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, name, *namelenp);
++ if (namelenp)
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, namelenp, sizeof(*namelenp));
++ if (name && namelenp)
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, name, *namelenp);
+ }
+ if (cname && csz) {
+ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, csz, sizeof(*csz));
@@ -584,8 +590,10 @@ $NetBSD$
+ COMMON_INTERCEPTOR_READ_RANGE(ctx, sname, REAL(strlen)(sname) + 1);
+ res = REAL(sysctlnametomib)(sname, name, namelenp);
+ if (!res) {
-+ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, namelenp, sizeof(*namelenp));
-+ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, name, *namelenp);
++ if (namelenp)
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, namelenp, sizeof(*namelenp));
++ if (name && namelenp)
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, name, *namelenp);
+ }
+ return res;
+}
@@ -597,10 +605,10 @@ $NetBSD$
+ if (name)
+ COMMON_INTERCEPTOR_READ_RANGE(ctx, name, sizeof(*name) * namelen);
+ res = REAL(asysctl)(name, namelen, len);
-+ if (res && len) {
++ if (len)
+ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, len, sizeof(*len));
++ if (res && len)
+ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, *len);
-+ }
+ return res;
+}
+
@@ -611,10 +619,10 @@ $NetBSD$
+ if (sname)
+ COMMON_INTERCEPTOR_READ_RANGE(ctx, sname, REAL(strlen)(sname) + 1);
+ res = REAL(asysctlbyname)(sname, len);
-+ if (res && len) {
++ if (len)
+ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, len, sizeof(*len));
++ if (res && len)
+ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, *len);
-+ }
+ return res;
+}
+#define INIT_SYSCTL \
@@ -830,11 +838,93 @@ $NetBSD$
+#else
+#define INIT_GETPROTOENT
+#endif
++
++#if SANITIZER_INTERCEPT_GETNETENT
++INTERCEPTOR(struct __sanitizer_netent *, getnetent) {
++ void *ctx;
++ struct __sanitizer_netent *n;
++ COMMON_INTERCEPTOR_ENTER(ctx, getnetent);
++ n = REAL(getnetent)();
++ if (n) {
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, n, sizeof(*n));
++
++ char **nn = n->n_aliases;
++
++ while (*nn) {
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, nn, sizeof(char **));
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *nn, REAL(strlen)(*nn) + 1);
++ nn++;
++ }
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, nn, sizeof(char **));
++ }
++ return n;
++}
++
++INTERCEPTOR(struct __sanitizer_netent *, getnetbyname, const char *name) {
++ void *ctx;
++ struct __sanitizer_netent *n;
++ COMMON_INTERCEPTOR_ENTER(ctx, getnetbyname, name);
++ n = REAL(getnetbyname)(name);
++ if (n) {
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, n, sizeof(*n));
++
++ char **nn = n->n_aliases;
++
++ while (*nn) {
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, nn, sizeof(char **));
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *nn, REAL(strlen)(*nn) + 1);
++ nn++;
++ }
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, nn, sizeof(char **));
++ }
++ return n;
++}
++
++INTERCEPTOR(struct __sanitizer_netent *, getnetbyaddr, u32 net, int type) {
++ void *ctx;
++ struct __sanitizer_netent *n;
++ COMMON_INTERCEPTOR_ENTER(ctx, getnetbyaddr, net, type);
++ n = REAL(getnetbyaddr)(net, type);
++ if (n) {
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, n, sizeof(*n));
++
++ char **nn = n->n_aliases;
++
++ while (*nn) {
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, nn, sizeof(char **));
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, *nn, REAL(strlen)(*nn) + 1);
++ nn++;
++ }
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, nn, sizeof(char **));
++ }
++ return n;
++}
++
++INTERCEPTOR(void, setnetent, int stayopen) {
++ void *ctx;
++ COMMON_INTERCEPTOR_ENTER(ctx, setnetent, stayopen);
++ return REAL(setnetent)(stayopen);
++}
++
++INTERCEPTOR(void, endnetent) {
++ void *ctx;
++ COMMON_INTERCEPTOR_ENTER(ctx, endnetent);
++ return REAL(endnetent)();
++}
++#define INIT_GETNETENT \
++ COMMON_INTERCEPT_FUNCTION(getnetent); \
++ COMMON_INTERCEPT_FUNCTION(getnetbyname); \
++ COMMON_INTERCEPT_FUNCTION(getnetbyaddr); \
++ COMMON_INTERCEPT_FUNCTION(setnetent); \
++ COMMON_INTERCEPT_FUNCTION(endnetent);
++#else
++#define INIT_GETNETENT
++#endif
+
static void InitializeCommonInterceptors() {
static u64 metadata_mem[sizeof(MetadataHashMap) / sizeof(u64) + 1];
interceptor_metadata_map = new((void *)&metadata_mem) MetadataHashMap();
-@@ -6687,6 +7398,7 @@ static void InitializeCommonInterceptors
+@@ -6687,6 +7488,7 @@ static void InitializeCommonInterceptors
INIT_GETSOCKOPT;
INIT_ACCEPT;
INIT_ACCEPT4;
@@ -842,7 +932,7 @@ $NetBSD$
INIT_MODF;
INIT_RECVMSG;
INIT_SENDMSG;
-@@ -6827,6 +7539,14 @@ static void InitializeCommonInterceptors
+@@ -6827,6 +7629,15 @@ static void InitializeCommonInterceptors
INIT_ACCESS;
INIT_FACCESSAT;
INIT_GETGROUPLIST;
@@ -854,6 +944,7 @@ $NetBSD$
+ INIT_GETTTYENT;
+ INIT_FGETLN;
+ INIT_GETPROTOENT;
++ INIT_GETNETENT;
#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 911702e483..a9c291206c 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
@@ -10,7 +10,7 @@ $NetBSD$
#define SANITIZER_INTERCEPT_MODF SI_POSIX
#define SANITIZER_INTERCEPT_RECVMSG SI_POSIX
#define SANITIZER_INTERCEPT_SENDMSG SI_POSIX
-@@ -440,5 +441,13 @@
+@@ -440,5 +441,14 @@
#define SANITIZER_INTERCEPT_ACCESS SI_NETBSD
#define SANITIZER_INTERCEPT_FACCESSAT SI_NETBSD
#define SANITIZER_INTERCEPT_GETGROUPLIST SI_NETBSD
@@ -22,5 +22,6 @@ $NetBSD$
+#define SANITIZER_INTERCEPT_GETTTYENT SI_NETBSD
+#define SANITIZER_INTERCEPT_FGETLN SI_NETBSD
+#define SANITIZER_INTERCEPT_GETPROTOENT SI_NETBSD
++#define SANITIZER_INTERCEPT_GETNETENT SI_NETBSD
#endif // #ifndef SANITIZER_PLATFORM_INTERCEPTORS_H
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h
index 6bdca6f7db..9d1e3517bb 100644
--- a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h
@@ -60,7 +60,7 @@ $NetBSD$
struct __sanitizer_sem_t {
uptr data[5];
};
-@@ -110,6 +113,12 @@ struct __sanitizer_shmid_ds {
+@@ -110,6 +113,19 @@ struct __sanitizer_shmid_ds {
void *_shm_internal;
};
@@ -69,11 +69,18 @@ $NetBSD$
+ char **p_aliases;
+ int p_proto;
+};
++
++struct __sanitizer_netent {
++ char *n_name;
++ char **n_aliases;
++ int n_addrtype;
++ u32 n_net;
++};
+
extern unsigned struct_msqid_ds_sz;
extern unsigned struct_mq_attr_sz;
extern unsigned struct_timex_sz;
-@@ -131,6 +140,8 @@ struct __sanitizer_ifaddrs {
+@@ -131,6 +147,8 @@ struct __sanitizer_ifaddrs {
unsigned int ifa_addrflags;
};
@@ -82,7 +89,7 @@ $NetBSD$
typedef unsigned __sanitizer_pthread_key_t;
typedef long long __sanitizer_time_t;
-@@ -200,6 +211,12 @@ struct __sanitizer_msghdr {
+@@ -200,6 +218,12 @@ struct __sanitizer_msghdr {
unsigned msg_controllen;
int msg_flags;
};
@@ -95,7 +102,7 @@ $NetBSD$
struct __sanitizer_cmsghdr {
unsigned cmsg_len;
int cmsg_level;
-@@ -252,6 +269,22 @@ struct __sanitizer_sigaction {
+@@ -252,6 +276,22 @@ struct __sanitizer_sigaction {
int sa_flags;
};
@@ -118,7 +125,7 @@ $NetBSD$
typedef __sanitizer_sigset_t __sanitizer_kernel_sigset_t;
struct __sanitizer_kernel_sigaction_t {
-@@ -309,6 +342,8 @@ struct __sanitizer_pollfd {
+@@ -309,6 +349,8 @@ struct __sanitizer_pollfd {
typedef unsigned __sanitizer_nfds_t;
@@ -127,7 +134,7 @@ $NetBSD$
struct __sanitizer_glob_t {
uptr gl_pathc;
uptr gl_matchc;
-@@ -328,6 +363,54 @@ extern int glob_altdirfunc;
+@@ -328,6 +370,54 @@ extern int glob_altdirfunc;
extern unsigned path_max;
@@ -182,7 +189,7 @@ $NetBSD$
struct __sanitizer_wordexp_t {
uptr we_wordc;
char **we_wordv;
-@@ -361,6 +444,53 @@ struct __sanitizer_ifconf {
+@@ -361,6 +451,53 @@ struct __sanitizer_ifconf {
} ifc_ifcu;
};
@@ -236,7 +243,7 @@ $NetBSD$
#define IOC_NRBITS 8
#define IOC_TYPEBITS 8
#define IOC_SIZEBITS 14
-@@ -385,185 +515,1712 @@ struct __sanitizer_ifconf {
+@@ -385,185 +522,1712 @@ struct __sanitizer_ifconf {
#define IOC_NR(nr) (((nr) >> IOC_NRSHIFT) & IOC_NRMASK)
#define IOC_SIZE(nr) (((nr) >> IOC_SIZESHIFT) & IOC_SIZEMASK)
Home |
Main Index |
Thread Index |
Old Index