diff -Nru systemd-204/debian/changelog systemd-204/debian/changelog --- systemd-204/debian/changelog 2018-02-01 12:53:08.000000000 +0000 +++ systemd-204/debian/changelog 2018-03-02 18:15:21.000000000 +0000 @@ -1,3 +1,10 @@ +systemd (204-5ubuntu20.27) trusty; urgency=medium + + * logind: fix session not added to gc and other memleaks (LP: #1750013) + - Added cgmanager as dependency (it was a suggestion) as part of the fix + + -- Guilherme G. Piccoli Wed, 28 Feb 2018 13:22:00 +0000 + systemd (204-5ubuntu20.26) trusty-security; urgency=medium * SECURITY UPDATE: access to automounted volumes can lock up diff -Nru systemd-204/debian/control systemd-204/debian/control --- systemd-204/debian/control 2017-01-16 13:51:03.000000000 +0000 +++ systemd-204/debian/control 2018-03-02 18:15:21.000000000 +0000 @@ -101,11 +101,11 @@ udev (>= 175-0ubuntu23), dbus, systemd-shim (>= 3), + cgmanager Replaces: systemd (<< 198-1), logind, ubuntu-system-service Breaks: systemd (<< 198-1) Conflicts: logind Provides: logind -Suggests: cgmanager Multi-Arch: foreign Description: systemd runtime services This package contains the logind and D-BUS services (localed, hostname, diff -Nru systemd-204/debian/patches/logind-fix-memleaks.patch systemd-204/debian/patches/logind-fix-memleaks.patch --- systemd-204/debian/patches/logind-fix-memleaks.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/logind-fix-memleaks.patch 2018-03-02 18:17:01.000000000 +0000 @@ -0,0 +1,73 @@ +Description: logind: fix session not added to gc and other memleaks + 1) Proactively add session to gc on its Release event in order to prevent + entire session's leaks in logind due to not adding closing sessions to gc; + + 2) Fix small leak in session_free(), by freeing the reset_controllers ptr; + + 3) Fix small leak in cgmanager glue code. + +Author: Guilherme G. Piccoli +Bug-Ubuntu: https://launchpad.net/bugs/1750013 +Forwarded: not-needed +Reviewed-By: Guilherme G. Piccoli +Last-Update: 2018-02-16 + +Index: systemd-204/src/login/logind-session.c +=================================================================== +--- systemd-204.orig/src/login/logind-session.c 2018-03-02 18:15:32.000417853 +0000 ++++ systemd-204/src/login/logind-session.c 2018-03-02 18:16:00.504417495 +0000 +@@ -93,6 +93,7 @@ + + free(s->cgroup_path); + strv_free(s->controllers); ++ strv_free(s->reset_controllers); + + free(s->tty); + free(s->display); +Index: systemd-204/src/login/logind.c +=================================================================== +--- systemd-204.orig/src/login/logind.c 2018-03-02 18:15:32.000417853 +0000 ++++ systemd-204/src/login/logind.c 2018-03-02 18:15:31.996417853 +0000 +@@ -1503,6 +1503,8 @@ + if (session_check_gc(session, drop_not_started) == 0) { + session_stop(session); + session_free(session); ++ } else if (session_get_state(session) == SESSION_CLOSING) { ++ session_add_to_gc_queue(session); + } + } + +Index: systemd-204/src/shared/cgroup-util.c +=================================================================== +--- systemd-204.orig/src/shared/cgroup-util.c 2018-03-02 18:15:32.000417853 +0000 ++++ systemd-204/src/shared/cgroup-util.c 2018-03-02 18:15:31.996417853 +0000 +@@ -44,7 +44,7 @@ + _cleanup_free_ char *fs = NULL; + FILE *f; + int r; +- char *value = NULL; ++ _cleanup_free_ char *value = NULL; + char *template = NULL; + int fd; + +@@ -111,7 +111,7 @@ + _cleanup_free_ char *fs = NULL; + FILE *f; + int r; +- char *value = NULL; ++ _cleanup_free_ char *value = NULL; + char *template = NULL; + int fd; + +Index: systemd-204/src/login/logind-dbus.c +=================================================================== +--- systemd-204.orig/src/login/logind-dbus.c 2013-05-06 22:12:03.922372308 +0000 ++++ systemd-204/src/login/logind-dbus.c 2018-03-02 18:16:29.520417130 +0000 +@@ -1781,6 +1781,7 @@ + this call explicitly turn off the FIFO logic, so that + the PAM code can finish clean up on its own */ + session_remove_fifo(session); ++ session_add_to_gc_queue(session); + + reply = dbus_message_new_method_return(message); + if (!reply) diff -Nru systemd-204/debian/patches/series systemd-204/debian/patches/series --- systemd-204/debian/patches/series 2018-02-01 12:45:35.000000000 +0000 +++ systemd-204/debian/patches/series 2018-03-02 18:15:21.000000000 +0000 @@ -40,3 +40,4 @@ deputy_cgroup.patch do-not-create-run-nologin.patch CVE-2018-1049.patch +logind-fix-memleaks.patch