mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-03 01:17:45 +03:00
journal,network,timesync: fix segfault on 32bit timeval/timespec systems
Fixes #20741.
(cherry picked from commit f782eee68a
)
This commit is contained in:
parent
69e624bc05
commit
a2bf5ad6b4
@ -1271,11 +1271,14 @@ int server_process_datagram(
|
||||
/* We use NAME_MAX space for the SELinux label here. The kernel currently enforces no limit, but
|
||||
* according to suggestions from the SELinux people this will change and it will probably be
|
||||
* identical to NAME_MAX. For now we use that, but this should be updated one day when the final
|
||||
* limit is known. */
|
||||
* limit is known.
|
||||
*
|
||||
* Here, we need to explicitly initialize the buffer with zero, as glibc has a bug in
|
||||
* __convert_scm_timestamps(), which assumes the buffer is initialized. See #20741. */
|
||||
CMSG_BUFFER_TYPE(CMSG_SPACE(sizeof(struct ucred)) +
|
||||
CMSG_SPACE_TIMEVAL +
|
||||
CMSG_SPACE(sizeof(int)) + /* fd */
|
||||
CMSG_SPACE(NAME_MAX) /* selinux label */) control;
|
||||
CMSG_SPACE(NAME_MAX) /* selinux label */) control = {};
|
||||
|
||||
union sockaddr_union sa = {};
|
||||
|
||||
|
@ -148,8 +148,9 @@ int icmp6_send_router_solicitation(int s, const struct ether_addr *ether_addr) {
|
||||
int icmp6_receive(int fd, void *buffer, size_t size, struct in6_addr *dst,
|
||||
triple_timestamp *timestamp) {
|
||||
|
||||
/* This needs to be initialized with zero. See #20741. */
|
||||
CMSG_BUFFER_TYPE(CMSG_SPACE(sizeof(int)) + /* ttl */
|
||||
CMSG_SPACE_TIMEVAL) control;
|
||||
CMSG_SPACE_TIMEVAL) control = {};
|
||||
struct iovec iov = {};
|
||||
union sockaddr_union sa = {};
|
||||
struct msghdr msg = {
|
||||
|
@ -413,7 +413,8 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re
|
||||
.iov_base = &ntpmsg,
|
||||
.iov_len = sizeof(ntpmsg),
|
||||
};
|
||||
CMSG_BUFFER_TYPE(CMSG_SPACE_TIMESPEC) control;
|
||||
/* This needs to be initialized with zero. See #20741. */
|
||||
CMSG_BUFFER_TYPE(CMSG_SPACE_TIMESPEC) control = {};
|
||||
union sockaddr_union server_addr;
|
||||
struct msghdr msghdr = {
|
||||
.msg_iov = &iov,
|
||||
|
Loading…
Reference in New Issue
Block a user