From 789f5c6f706383442d85a9aedc6396a1a7877057 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 13 Apr 2023 18:02:48 +0900 Subject: tree-wide: copy timestamp data from cmsg On RISCV32, time_t is 64bit and size_t is 32bit, hence the timestamp data in message header may not be aligned. Fixes #27241. --- src/timesync/timesyncd-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/timesync') diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c index e024fa9715..569389b9d4 100644 --- a/src/timesync/timesyncd-manager.c +++ b/src/timesync/timesyncd-manager.c @@ -446,7 +446,7 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re return 0; } - recv_time = CMSG_FIND_DATA(&msghdr, SOL_SOCKET, SCM_TIMESTAMPNS, struct timespec); + recv_time = CMSG_FIND_AND_COPY_DATA(&msghdr, SOL_SOCKET, SCM_TIMESTAMPNS, struct timespec); if (!recv_time) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Packet timestamp missing."); -- cgit v1.2.1