From: Mike Yuan Date: Mon, 2 Sep 2024 21:43:53 +0000 (+0200) Subject: core/manager: close all cmsg fds where none is expected X-Git-Tag: v257-rc1~558^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8b9767f515a3bbd7d3a951c74eca44707913681;p=thirdparty%2Fsystemd.git core/manager: close all cmsg fds where none is expected --- diff --git a/src/core/manager.c b/src/core/manager.c index 22417082974..3f6cb3944a7 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -4942,6 +4942,8 @@ static int manager_dispatch_handoff_timestamp_fd(sd_event_source *source, int fd if (n < 0) return log_error_errno(n, "Failed to receive handoff timestamp message: %m"); + cmsg_close_all(&msghdr); + if (msghdr.msg_flags & MSG_TRUNC) { log_warning("Got truncated handoff timestamp message, ignoring."); return 0;