[compiler-rt] [compiler-rt] adding __sanitizer_sockaddr definition for freebsd. (PR #85870)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 19 14:54:11 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-compiler-rt-sanitizer
Author: David CARLIER (devnexen)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/85870.diff
2 Files Affected:
- (modified) compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.cpp (+1)
- (modified) compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h (+10-4)
``````````diff
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.cpp
index 4940062eeae47f..f5451a9d0b5b1c 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.cpp
@@ -476,6 +476,7 @@ CHECK_TYPE_SIZE(sigset_t);
COMPILER_CHECK(sizeof(__sanitizer_sigaction) == sizeof(struct sigaction));
COMPILER_CHECK(sizeof(__sanitizer_siginfo) == sizeof(siginfo_t));
+COMPILER_CHECK(sizeof(__sanitizer_sockaddr) == sizeof(struct sockaddr));
CHECK_SIZE_AND_OFFSET(siginfo_t, si_value);
// Can't write checks for sa_handler and sa_sigaction due to them being
// preprocessor macros.
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h
index 8ce73f206fd88d..62b37098bc68d7 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h
@@ -154,14 +154,20 @@ struct __sanitizer_iovec {
uptr iov_len;
};
+struct __sanitizer_sockaddr {
+ unsigned char sa_len;
+ unsigned char sa_family;
+ char sa_data[14];
+};
+
struct __sanitizer_ifaddrs {
struct __sanitizer_ifaddrs *ifa_next;
char *ifa_name;
unsigned int ifa_flags;
- void *ifa_addr; // (struct sockaddr *)
- void *ifa_netmask; // (struct sockaddr *)
+ __sanitizer_sockaddr *ifa_addr;
+ __sanitizer_sockaddr *ifa_netmask;
# undef ifa_dstaddr
- void *ifa_dstaddr; // (struct sockaddr *)
+ __sanitizer_sockaddr *ifa_dstaddr; // (struct sockaddr *)
void *ifa_data;
};
@@ -367,7 +373,7 @@ struct __sanitizer_addrinfo {
int ai_protocol;
unsigned ai_addrlen;
char *ai_canonname;
- void *ai_addr;
+ __sanitizer_sockaddr *ai_addr;
struct __sanitizer_addrinfo *ai_next;
};
``````````
</details>
https://github.com/llvm/llvm-project/pull/85870
More information about the llvm-commits
mailing list