@@ -933,7 +933,7 @@ INTERCEPTOR(int, recvmmsg, int socket, struct mmsghdr *message,
933
933
#else
934
934
INTERCEPTOR (int , recvmmsg, int socket, struct mmsghdr *message,
935
935
unsigned int len, int flags, struct timespec *timeout) {
936
- #endif
936
+ #endif // defined(__GLIBC_MINOR) && __GLIBC_MINOR__ < 21
937
937
__rtsan_notify_intercepted_call (" recvmmsg" );
938
938
return REAL (recvmmsg)(socket, message, len, flags, timeout);
939
939
}
@@ -1098,6 +1098,30 @@ INTERCEPTOR(int, execve, const char *filename, char *const argv[],
1098
1098
return REAL (execve )(filename, argv, envp);
1099
1099
}
1100
1100
1101
+ #if SANITIZER_INTERCEPT_PROCESS_VM_READV
1102
+ INTERCEPTOR (ssize_t , process_vm_readv, const struct iovec *local_iov,
1103
+ unsigned long liovcnt, const struct iovec *remote_iov,
1104
+ unsigned long riovcnt, unsigned long flags) {
1105
+ __rtsan_notify_intercepted_call (" process_vm_readv" );
1106
+ return REAL (process_vm_readv)(local_iov, liovcnt, remote_iov, riovcnt, flags);
1107
+ }
1108
+
1109
+ INTERCEPTOR (ssize_t , process_vm_writev, const struct iovec *local_iov,
1110
+ unsigned long liovcnt, const struct iovec *remote_iov,
1111
+ unsigned long riovcnt, unsigned long flags) {
1112
+ __rtsan_notify_intercepted_call (" process_vm_writev" );
1113
+ return REAL (process_vm_writev)(local_iov, liovcnt, remote_iov, riovcnt,
1114
+ flags);
1115
+ }
1116
+ #define RTSAN_MAYBE_INTERCEPT_PROCESS_VM_READV \
1117
+ INTERCEPT_FUNCTION (process_vm_readv)
1118
+ #define RTSAN_MAYBE_INTERCEPT_PROCESS_VM_WRITEV \
1119
+ INTERCEPT_FUNCTION (process_vm_writev)
1120
+ #else
1121
+ #define RTSAN_MAYBE_INTERCEPT_PROCESS_VM_READV
1122
+ #define RTSAN_MAYBE_INTERCEPT_PROCESS_VM_WRITEV
1123
+ #endif
1124
+
1101
1125
// TODO: the `wait` family of functions is an oddity. In testing, if you
1102
1126
// intercept them, Darwin seemingly ignores them, and linux never returns from
1103
1127
// the test. Revisit this in the future, but hopefully intercepting fork/exec is
@@ -1277,6 +1301,9 @@ void __rtsan::InitializeInterceptors() {
1277
1301
INTERCEPT_FUNCTION (fork );
1278
1302
INTERCEPT_FUNCTION (execve );
1279
1303
1304
+ RTSAN_MAYBE_INTERCEPT_PROCESS_VM_READV;
1305
+ RTSAN_MAYBE_INTERCEPT_PROCESS_VM_WRITEV;
1306
+
1280
1307
INTERCEPT_FUNCTION (syscall );
1281
1308
}
1282
1309
0 commit comments