summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2019-06-19 21:16:15 +0900
committerLennart Poettering <lennart@poettering.net>2019-06-19 15:48:36 +0200
commitf9dc94408d70dd2f44915f4c6d67dc498c1c6243 (patch)
tree50dab4205c3f0bfb2dfe4b4d10d4eb9911693018
parent23ebb4dda9d56a24093f0cd0057cd0bb1b8ee28b (diff)
downloadsystemd-f9dc94408d70dd2f44915f4c6d67dc498c1c6243.tar.gz
systemd-f9dc94408d70dd2f44915f4c6d67dc498c1c6243.tar.bz2
systemd-f9dc94408d70dd2f44915f4c6d67dc498c1c6243.zip
sd-resolve: suppress false positive MSan warnings
MSan dislikes structured initializers for nested structures.
-rw-r--r--src/libsystemd/sd-resolve/sd-resolve.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libsystemd/sd-resolve/sd-resolve.c b/src/libsystemd/sd-resolve/sd-resolve.c
index 868cc023b1..00a6464e2d 100644
--- a/src/libsystemd/sd-resolve/sd-resolve.c
+++ b/src/libsystemd/sd-resolve/sd-resolve.c
@@ -248,6 +248,8 @@ static int send_addrinfo_reply(
._h_errno = _h_errno,
};
+ msan_unpoison(&resp, sizeof(resp));
+
if (ret == 0 && ai) {
void *p = &buffer;
struct addrinfo *k;
@@ -308,6 +310,8 @@ static int send_nameinfo_reply(
._h_errno = _h_errno,
};
+ msan_unpoison(&resp, sizeof(resp));
+
iov[0] = IOVEC_MAKE(&resp, sizeof(NameInfoResponse));
iov[1] = IOVEC_MAKE((void*) host, hl);
iov[2] = IOVEC_MAKE((void*) serv, sl);
@@ -352,6 +356,8 @@ static int handle_request(int out_fd, const Packet *packet, size_t length) {
.ai_protocol = ai_req->ai_protocol,
};
+ msan_unpoison(&hints, sizeof(hints));
+
node = ai_req->node_len ? (const char*) ai_req + sizeof(AddrInfoRequest) : NULL;
service = ai_req->service_len ? (const char*) ai_req + sizeof(AddrInfoRequest) + ai_req->node_len : NULL;
@@ -960,6 +966,8 @@ int resolve_getaddrinfo_with_destroy_callback(
.ai_protocol = hints ? hints->ai_protocol : 0,
};
+ msan_unpoison(&req, sizeof(req));
+
iov[mh.msg_iovlen++] = IOVEC_MAKE(&req, sizeof(AddrInfoRequest));
if (node)
iov[mh.msg_iovlen++] = IOVEC_MAKE((void*) node, req.node_len);
@@ -1046,6 +1054,8 @@ int resolve_getnameinfo_with_destroy_callback(
.getserv = !!(get & SD_RESOLVE_GET_SERVICE),
};
+ msan_unpoison(&req, sizeof(req));
+
iov[0] = IOVEC_MAKE(&req, sizeof(NameInfoRequest));
iov[1] = IOVEC_MAKE((void*) sa, salen);