Fix for the empty notify message fuckup

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2016-09-29 05:42:52 -04:00
parent 8a9b24f9e9
commit bc76c3b9de
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,31 @@
From 1f74d99193e7d2b0546e641aba25259d9a646e5d Mon Sep 17 00:00:00 2001
From: Jorge Niedbalski <jorge.niedbalski@canonical.com>
Date: Wed, 28 Sep 2016 18:25:50 -0300
Subject: [PATCH] If the notification message length is 0, ignore the message
(#4237)
Fixes #4234.
Signed-off-by: Jorge Niedbalski <jnr@metaklass.org>
---
src/core/manager.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/core/manager.c b/src/core/manager.c
index f36cf5e320..6bd32ed920 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1557,6 +1557,10 @@ static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t
return -errno;
}
+ if (n == 0) {
+ log_debug("Got zero-length notification message. Ignoring.");
+ return 0;
+ }
CMSG_FOREACH(cmsg, &msghdr) {
if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) {
--
2.9.0

View File

@ -12,7 +12,7 @@
Name: systemd
Url: http://www.freedesktop.org/wiki/Software/systemd
Version: 229
Release: 13%{?gitcommit:.git%{gitcommitshort}}%{?dist}
Release: 14%{?gitcommit:.git%{gitcommitshort}}%{?dist}
# For a breakdown of the licensing, see README
License: LGPLv2+ and MIT and GPLv2+
Summary: A System and Service Manager
@ -80,6 +80,7 @@ Patch0044: 0044-networkd-add-route-expiration-handler-3242.patch
Patch0045: 0045-coredump-ignore-RLIMIT_CORE.patch
Patch0046: 0046-networkd-link-fix-handler-typo-for-route_remove-3433.patch
Patch0047: 0047-macros.systemd.in-add-systemd_ordering-3776.patch
Patch0048: If-the-notification-message-length-is-0-ignore-the-m.patch
Patch0999: 0999-resolved-create-etc-resolv.conf-symlink-at-runtime.patch
@ -964,6 +965,9 @@ getent passwd systemd-journal-upload >/dev/null 2>&1 || useradd -r -l -g systemd
/usr/lib/firewalld/services/*
%changelog
* Thu Sep 29 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 229-14
- Denial-of-service bug against pid1 (#1380286)
* Wed Aug 17 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 229-13
- Add %%systemd_ordering macro