-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Fix sendmmsg and recvmmsg rtsan interceptor for MUSL #123907
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Yi Kong (kongy) ChangesMUSL have different signatures for sendmmsg and recvmmsg. Full diff: https://github.com/llvm/llvm-project/pull/123907.diff 1 Files Affected:
diff --git a/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp b/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
index 112191f52648e7..008cc676a6ae55 100644
--- a/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
+++ b/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
@@ -894,8 +894,13 @@ INTERCEPTOR(ssize_t, sendmsg, int socket, const struct msghdr *message,
}
#if SANITIZER_INTERCEPT_SENDMMSG
+#if SANITIZER_MUSL
+INTERCEPTOR(int, sendmmsg, int socket, struct mmsghdr *message,
+ unsigned int len, unsigned int flags) {
+#else
INTERCEPTOR(int, sendmmsg, int socket, struct mmsghdr *message,
unsigned int len, int flags) {
+#endif
__rtsan_notify_intercepted_call("sendmmsg");
return REAL(sendmmsg)(socket, message, len, flags);
}
@@ -927,7 +932,10 @@ INTERCEPTOR(ssize_t, recvmsg, int socket, struct msghdr *message, int flags) {
}
#if SANITIZER_INTERCEPT_RECVMMSG
-#if defined(__GLIBC_MINOR__) && __GLIBC_MINOR__ < 21
+#if SANITIZER_MUSL
+INTERCEPTOR(int, recvmmsg, int socket, struct mmsghdr *message,
+ unsigned int len, unsigned int flags, struct timespec *timeout) {
+#elif defined(__GLIBC_MINOR__) && __GLIBC_MINOR__ < 21
INTERCEPTOR(int, recvmmsg, int socket, struct mmsghdr *message,
unsigned int len, int flags, const struct timespec *timeout) {
#else
|
|
What a mess :) thanks for fixing it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but waiting @cjappl
cjappl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thank you!!
This is just musings doesn't affect this review - I wonder if there is a better way to organize all the differences of signatures across versions/libcs/OSs. One that is more readable or maintainable.
As we continue adding interceptors we may want to re-organize in some way
|
Fixes #123689 |
MUSL have different signatures for sendmmsg and recvmmsg.
This fixes build breakage from #123484.