Skip to content

Commit

Permalink
Revert "[msan] Don't intercept LFS prlimit64/getrlimit64 on musl"
Browse files Browse the repository at this point in the history
This reverts commit b297fd7.

Reverting to investigate buildbot failures.
  • Loading branch information
thesamesam committed May 21, 2023
1 parent cbd2c68 commit fda76c4
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions compiler-rt/lib/msan/msan_interceptors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ INTERCEPTOR(int, fstat, int fd, void *buf) {
#define MSAN_MAYBE_INTERCEPT_FSTAT
#endif

#if SANITIZER_GLIBC
#if SANITIZER_STAT_LINUX
INTERCEPTOR(int, fstat64, int fd, void *buf) {
ENSURE_MSAN_INITED();
int res = REAL(fstat64)(fd, buf);
Expand Down Expand Up @@ -825,17 +825,13 @@ INTERCEPTOR(int, __getrlimit, int resource, void *rlim) {
INTERCEPTOR_GETRLIMIT_BODY(__getrlimit, resource, rlim);
}

#if SANITIZER_GLIBC
INTERCEPTOR(int, getrlimit64, int resource, void *rlim) {
if (msan_init_is_running) return REAL(getrlimit64)(resource, rlim);
ENSURE_MSAN_INITED();
int res = REAL(getrlimit64)(resource, rlim);
if (!res) __msan_unpoison(rlim, __sanitizer::struct_rlimit64_sz);
return res;
}
#else
#define MSAN_MAYBE_INTERCEPT_GETRLIMIT64 INTERCEPT_FUNCTION(getrlimit64)
#endif

INTERCEPTOR(int, prlimit, int pid, int resource, void *new_rlimit,
void *old_rlimit) {
Expand All @@ -848,7 +844,6 @@ INTERCEPTOR(int, prlimit, int pid, int resource, void *new_rlimit,
return res;
}

#if SANITIZER_GLIBC
INTERCEPTOR(int, prlimit64, int pid, int resource, void *new_rlimit,
void *old_rlimit) {
if (msan_init_is_running)
Expand All @@ -859,9 +854,6 @@ INTERCEPTOR(int, prlimit64, int pid, int resource, void *new_rlimit,
if (!res) __msan_unpoison(old_rlimit, __sanitizer::struct_rlimit64_sz);
return res;
}
#else
#define MSAN_MAYBE_INTERCEPT_PRLIMIT64 INTERCEPT_FUNCTION(prlimit64)
#endif

#define MSAN_MAYBE_INTERCEPT___GETRLIMIT INTERCEPT_FUNCTION(__getrlimit)
#define MSAN_MAYBE_INTERCEPT_GETRLIMIT64 INTERCEPT_FUNCTION(getrlimit64)
Expand Down Expand Up @@ -1785,13 +1777,9 @@ void InitializeInterceptors() {
MSAN_MAYBE_INTERCEPT_FGETS_UNLOCKED;
INTERCEPT_FUNCTION(getrlimit);
MSAN_MAYBE_INTERCEPT___GETRLIMIT;
#if SANITIZER_GLIBC
MSAN_MAYBE_INTERCEPT_GETRLIMIT64;
#endif
MSAN_MAYBE_INTERCEPT_PRLIMIT;
#if SANITIZER_GLIBC
MSAN_MAYBE_INTERCEPT_PRLIMIT64;
#endif
INTERCEPT_FUNCTION(gethostname);
MSAN_MAYBE_INTERCEPT_EPOLL_WAIT;
MSAN_MAYBE_INTERCEPT_EPOLL_PWAIT;
Expand Down

0 comments on commit fda76c4

Please sign in to comment.