Lines 678-684
INTERCEPTOR(int, fstat, int fd, void *buf) {
Link Here
|
678 |
#define MSAN_MAYBE_INTERCEPT_FSTAT |
678 |
#define MSAN_MAYBE_INTERCEPT_FSTAT |
679 |
#endif |
679 |
#endif |
680 |
|
680 |
|
681 |
#if SANITIZER_STAT_LINUX |
681 |
#if SANITIZER_GLIBC |
682 |
INTERCEPTOR(int, fstat64, int fd, void *buf) { |
682 |
INTERCEPTOR(int, fstat64, int fd, void *buf) { |
683 |
ENSURE_MSAN_INITED(); |
683 |
ENSURE_MSAN_INITED(); |
684 |
int res = REAL(fstat64)(fd, buf); |
684 |
int res = REAL(fstat64)(fd, buf); |
Lines 825-830
INTERCEPTOR(int, __getrlimit, int resource, void *rlim) {
Link Here
|
825 |
INTERCEPTOR_GETRLIMIT_BODY(__getrlimit, resource, rlim); |
825 |
INTERCEPTOR_GETRLIMIT_BODY(__getrlimit, resource, rlim); |
826 |
} |
826 |
} |
827 |
|
827 |
|
|
|
828 |
#if SANITIZER_GLIBC |
828 |
INTERCEPTOR(int, getrlimit64, int resource, void *rlim) { |
829 |
INTERCEPTOR(int, getrlimit64, int resource, void *rlim) { |
829 |
if (msan_init_is_running) return REAL(getrlimit64)(resource, rlim); |
830 |
if (msan_init_is_running) return REAL(getrlimit64)(resource, rlim); |
830 |
ENSURE_MSAN_INITED(); |
831 |
ENSURE_MSAN_INITED(); |
Lines 832-837
INTERCEPTOR(int, getrlimit64, int resource, void *rlim) {
Link Here
|
832 |
if (!res) __msan_unpoison(rlim, __sanitizer::struct_rlimit64_sz); |
833 |
if (!res) __msan_unpoison(rlim, __sanitizer::struct_rlimit64_sz); |
833 |
return res; |
834 |
return res; |
834 |
} |
835 |
} |
|
|
836 |
#else |
837 |
#define MSAN_MAYBE_INTERCEPT_GETRLIMIT64 INTERCEPT_FUNCTION(getrlimit64) |
838 |
#endif |
835 |
|
839 |
|
836 |
INTERCEPTOR(int, prlimit, int pid, int resource, void *new_rlimit, |
840 |
INTERCEPTOR(int, prlimit, int pid, int resource, void *new_rlimit, |
837 |
void *old_rlimit) { |
841 |
void *old_rlimit) { |
Lines 844-849
INTERCEPTOR(int, prlimit, int pid, int resource, void *new_rlimit,
Link Here
|
844 |
return res; |
848 |
return res; |
845 |
} |
849 |
} |
846 |
|
850 |
|
|
|
851 |
#if SANITIZER_GLIBC |
847 |
INTERCEPTOR(int, prlimit64, int pid, int resource, void *new_rlimit, |
852 |
INTERCEPTOR(int, prlimit64, int pid, int resource, void *new_rlimit, |
848 |
void *old_rlimit) { |
853 |
void *old_rlimit) { |
849 |
if (msan_init_is_running) |
854 |
if (msan_init_is_running) |
Lines 854-859
INTERCEPTOR(int, prlimit64, int pid, int resource, void *new_rlimit,
Link Here
|
854 |
if (!res) __msan_unpoison(old_rlimit, __sanitizer::struct_rlimit64_sz); |
859 |
if (!res) __msan_unpoison(old_rlimit, __sanitizer::struct_rlimit64_sz); |
855 |
return res; |
860 |
return res; |
856 |
} |
861 |
} |
|
|
862 |
#else |
863 |
#define MSAN_MAYBE_INTERCEPT_PRLIMIT64 INTERCEPT_FUNCTION(prlimit64) |
864 |
#endif |
857 |
|
865 |
|
858 |
#define MSAN_MAYBE_INTERCEPT___GETRLIMIT INTERCEPT_FUNCTION(__getrlimit) |
866 |
#define MSAN_MAYBE_INTERCEPT___GETRLIMIT INTERCEPT_FUNCTION(__getrlimit) |
859 |
#define MSAN_MAYBE_INTERCEPT_GETRLIMIT64 INTERCEPT_FUNCTION(getrlimit64) |
867 |
#define MSAN_MAYBE_INTERCEPT_GETRLIMIT64 INTERCEPT_FUNCTION(getrlimit64) |
Lines 1777-1785
void InitializeInterceptors() {
Link Here
|
1777 |
MSAN_MAYBE_INTERCEPT_FGETS_UNLOCKED; |
1785 |
MSAN_MAYBE_INTERCEPT_FGETS_UNLOCKED; |
1778 |
INTERCEPT_FUNCTION(getrlimit); |
1786 |
INTERCEPT_FUNCTION(getrlimit); |
1779 |
MSAN_MAYBE_INTERCEPT___GETRLIMIT; |
1787 |
MSAN_MAYBE_INTERCEPT___GETRLIMIT; |
|
|
1788 |
#if SANITIZER_GLIBC |
1780 |
MSAN_MAYBE_INTERCEPT_GETRLIMIT64; |
1789 |
MSAN_MAYBE_INTERCEPT_GETRLIMIT64; |
|
|
1790 |
#endif |
1781 |
MSAN_MAYBE_INTERCEPT_PRLIMIT; |
1791 |
MSAN_MAYBE_INTERCEPT_PRLIMIT; |
|
|
1792 |
#if SANITIZER_GLIBC |
1782 |
MSAN_MAYBE_INTERCEPT_PRLIMIT64; |
1793 |
MSAN_MAYBE_INTERCEPT_PRLIMIT64; |
|
|
1794 |
#endif |
1783 |
INTERCEPT_FUNCTION(gethostname); |
1795 |
INTERCEPT_FUNCTION(gethostname); |
1784 |
MSAN_MAYBE_INTERCEPT_EPOLL_WAIT; |
1796 |
MSAN_MAYBE_INTERCEPT_EPOLL_WAIT; |
1785 |
MSAN_MAYBE_INTERCEPT_EPOLL_PWAIT; |
1797 |
MSAN_MAYBE_INTERCEPT_EPOLL_PWAIT; |
1786 |
- |
|
|