Description : pid1: don't return any error in manager_dispatch_notify_fd()
authorwchang kim <wchang.kim@samsung.com>
Mon, 31 Oct 2016 23:08:26 +0000 (08:08 +0900)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Fri, 26 Jan 2024 16:49:49 +0000 (17:49 +0100)
If manager_dispatch_notify_fd() fails and returns an error then the handling of
service notifications will be disabled entirely leading to a compromised system.

For example pid1 won't be able to receive the WATCHDOG messages anymore and
will kill all services supposed to send such messages.

This patch is related to CVE-2016-7795 and CVE-2016-7796.

Back-ported fbuihuu's committed on 29 Sep, commit
f1e852245a30b60d5e6e0a487d049a04a40772fe

Change-Id: I27b6b78cff23c774f6fbcc59dacefcdcc45e7326
Signed-off-by: Woochang Kim <wchang.kim@samsung.com>
src/core/manager.c

index 4d84a0b..8cce909 100644 (file)
@@ -1669,7 +1669,8 @@ static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t
                 r = fdset_new_array(&fds, fd_array, n_fds);
                 if (r < 0) {
                         close_many(fd_array, n_fds);
-                        return log_oom();
+                        log_oom();
+                        return 0;
                 }
         }