Merge ~halves/ubuntu/+source/systemd:lp1876600-xenial into ubuntu/+source/systemd:ubuntu/xenial-devel

Proposed by Heitor Alves de Siqueira
Status: Needs review
Proposed branch: ~halves/ubuntu/+source/systemd:lp1876600-xenial
Merge into: ubuntu/+source/systemd:ubuntu/xenial-devel
Diff against target: 123 lines (+101/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/lp1876600-sd-bus-deal-with-cookie-overruns.patch (+93/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
git-ubuntu developers Pending
Review via email: mp+383418@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Heitor Alves de Siqueira (halves) wrote :

Similar to the bionic merge proposal, I had to change the use of FLAGS_SET() due to Xenial missing commit [0]. Besides that, in Xenial sd_bus_message_seal() is still called bus_message_seal(), and didn't have the 'r' variable declared.

[0] https://github.com/systemd/systemd/commit/d94a24ca2ea7

Unmerged commits

99d6a9c... by Heitor Alves de Siqueira

Update debian/changelog

5d8f4a0... by Heitor Alves de Siqueira

LP: #1876600

083b9a8... by Dan Streetman

Import patches-unapplied version 229-4ubuntu21.28 to ubuntu/xenial-proposed

Imported using git-ubuntu import.

Changelog parent: 91016422ce2d3c0496359e2349910da8c7d08197

New changelog entries:
  * d/t/logind: skip if nonexistent /sys/power/state (LP: #1862657)
  * d/p/lp1839290-Change-job-mode-of-manager-triggered-restarts-to-JOB.patch:
    - when restarting service after failure, replace existing queued jobs
      (LP: #1839290)
  * d/t/storage:
    - fix buggy test (LP: #1831459)
    - without scsi_debug, skip test (LP: #1847816)
  * d/p/lp1867421-70-mouse.hwdb-Set-DPI-for-MS-Classic-IntelliMouse.patch:
    - fix resolution of IntelliMouse (LP: #1867421)
  * d/p/lp1858412-journalctl-allow-running-vacuum-on-remote-journals-t.patch:
    - allow vacuuming journal 'root' dir (LP: #1858412)
  * d/p/lp1862232-network-DHCP-ignore-error-in-setting-hostname-when-i.patch:
    - do not let invalid hostname break dhcpv4 (LP: #1862232)
  * d/t/systemd-fsckd: Skip test on arm64 (LP: #1870194)
  * d/p/lp1837914-journal-do-not-trigger-assertion-when-journal_file_c.patch:
    - do not crash if NULL passted to journal destructor (LP: #1837914)
  * d/e/initramfs-tools/hooks/udev:
    - Follow symlinks when finding link files to copy into initramfs
      (LP: #1868892)

9101642... by Marc Deslauriers

Import patches-unapplied version 229-4ubuntu21.27 to ubuntu/xenial-security

Imported using git-ubuntu import.

Changelog parent: 451eb0e3f0938df74d11779e31a9866075cce4bc

New changelog entries:
  * SECURITY UPDATE: incorrect PIDFile verification
    - debian/patches/CVE-2018-16888.patch: be stricter when handling PID
      files and MAINPID sd_notify() messages in man/systemd.service.xml,
      src/core/manager.c, src/core/service.c, src/core/unit.h,
      test/TEST-20-MAINPIDGAMES/Makefile,
      test/TEST-20-MAINPIDGAMES/test.sh,
      test/TEST-20-MAINPIDGAMES/testsuite.sh, test/test-functions.
    - debian/patches/CVE-2018-16888-2.patch: relax PID file symlink chain
      checks a bit in src/core/service.c.
    - CVE-2018-16888
  * SECURITY UPDATE: memory leak in button_open
    - debian/patches/CVE-2019-20386.patch: fix event in
      src/login/logind-button.c.
    - CVE-2019-20386
  * SECURITY UPDATE: heap use-after-free with async polkit queries
    - debian/patches/CVE-2020-1712-1.patch: on async pk requests,
      re-validate action/details in src/shared/bus-util.c.
    - debian/patches/CVE-2020-1712-2.patch: introduce API for re-enqueuing
      incoming messages in src/libsystemd/libsystemd.sym,
      src/libsystemd/sd-bus/sd-bus.c, src/systemd/sd-bus.h.
    - debian/patches/CVE-2020-1712-3.patch: when authorizing via PK
      re-resolve callback/userdata instead of caching it in
      src/shared/bus-util.c.
    - debian/patches/CVE-2020-1712-4.patch: fix typo in function name in
      src/libsystemd/libsystemd.sym, src/libsystemd/sd-bus/sd-bus.c,
      src/systemd/sd-bus.h, src/shared/bus-util.c.
    - debian/libsystemd0.symbols: added new symbols.
    - CVE-2020-1712

451eb0e... by Heitor Alves de Siqueira

Import patches-unapplied version 229-4ubuntu21.23 to ubuntu/xenial-proposed

Imported using git-ubuntu import.

Changelog parent: 5013344ccfdf8057f159c39952ad00e8958f24d0

New changelog entries:
  * d/p/core-use-an-AF_UNIX-SOCK_DGRAM-socket-for-cgroup-age.patch:
    - prevent logind from leaking session files (LP: #1846787)

5013344... by Dan Streetman

Import patches-unapplied version 229-4ubuntu21.22 to ubuntu/xenial-proposed

Imported using git-ubuntu import.

Changelog parent: 5f3bdd14a699874136e47a40a11a97b8bbdf6916

New changelog entries:
  [ Dan Streetman ]
  * d/t/systemd-fsckd, d/t/cmdline-upstart-boot:
    - skip on s390x; requires grub (LP: #1830477)
  * d/p/ask-password-prevent-buffer-overrow-when-reading-fro.patch:
    - prevent buffer overflow when reading keyring (LP: #1814373)
  [ Dimitri John Ledkov ]
  * Specify Ubuntu's Vcs-Git
  [ Balint Reczey ]
  * Append /snap/bin to default PATH.
    Snapd ships snapd-env-generator, but systemd does not not support
    environment generators. Hard-coding /snap/bin is less risky than
    backporting environment generator support and since snaps are considered
    to be first class packages on Ubuntu /snap/bin can safely added to
    the default PATH. (LP: #1771858)
  [ Ioanna Alifieraki ]
  * d/p/systemctl-Replace-check_one_unit-by-get_state_one_un.patch
    - Backport upstream PR#2768 needed for next patch
  * d/p/systemctl-load-unit-if-needed-in-systemctl-is-active.patch
    - Backport upstream PR#7997 to fix alias service reports inactive while
      aliased is active (LP: #1828892)

5f3bdd1... by Chris Coulson

Import patches-unapplied version 229-4ubuntu21.21 to ubuntu/xenial-security

Imported using git-ubuntu import.

Changelog parent: 383721c2eb82cc811fece13266f5a8167e022441

New changelog entries:
  * SECURITY UDPATE: Unsafe environment usage in pam_systemd.so leads to
    incorrect Policykit authorization
    - debian/patches/CVE-2019-3842.patch: Use secure_getenv() rather than
      getenv() in pam_systemd.c
    - CVE-2019-3842

383721c... by Michael Vogt

Import patches-unapplied version 229-4ubuntu21.19 to ubuntu/xenial-proposed

Imported using git-ubuntu import.

Changelog parent: f9563868e937e2417cafc3338d8020f07009c827

New changelog entries:
  [ Michael Vogt ]
  * d/p/fix-race-daemon-reload-11121.patch:
    - backport systemd upstream PR#8803 and PR#11121 to fix race
      when doing systemctl and systemctl daemon-reload at the
      same time LP: #1819728
  [ Balint Reczey ]
  * d/p/virt-detect-WSL-environment-as-a-container.patch:
    - virt: detect WSL environment as a container (LP: #1816753)

f956386... by Michael Vogt

Import patches-unapplied version 229-4ubuntu21.18 to ubuntu/xenial-proposed

Imported using git-ubuntu import.

Changelog parent: 3a318b024df96498c00dcfa0a26f78be7472fabf

New changelog entries:
  * d/p/fix-race-daemon-reload-8803.patch:
    - backport systemd upstream PR#8803 to fix race when doing
      systemctl and systemctl daemon-reload at the same time
      LP: #1819728

3a318b0... by Dan Streetman

Import patches-unapplied version 229-4ubuntu21.17 to ubuntu/xenial-proposed

Imported using git-ubuntu import.

Changelog parent: 8ab24848a3836b66bb6323fdf70f765496d6e4cb

New changelog entries:
  [ Victor Tapia ]
  * d/p/stop-mount-error-propagation.patch:
    keep mount errors local to the failing mount point instead of blocking
    the processing of all mounts (LP: #1755863)
  [ Eric Desrochers ]
  * d/p/fix-egde-case-when-processing-proc-self-mountinfo.patch:
    Mounting any file system to a mount point in a directory
    that is bind mounted to itself will create an inactive
    mount unit. (LP: #1795764)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index a24b382..0cac875 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+systemd (229-4ubuntu21.29) xenial; urgency=medium
7+
8+ * d/p/lp1876600-sd-bus-deal-with-cookie-overruns.patch:
9+ - deal with dbus cookie overruns (LP: #1876600)
10+
11+ -- Heitor Alves de Siqueira <halves@canonical.com> Tue, 05 May 2020 12:52:34 +0000
12+
13 systemd (229-4ubuntu21.28) xenial; urgency=medium
14
15 * d/t/logind: skip if nonexistent /sys/power/state (LP: #1862657)
16diff --git a/debian/patches/lp1876600-sd-bus-deal-with-cookie-overruns.patch b/debian/patches/lp1876600-sd-bus-deal-with-cookie-overruns.patch
17new file mode 100644
18index 0000000..93addce
19--- /dev/null
20+++ b/debian/patches/lp1876600-sd-bus-deal-with-cookie-overruns.patch
21@@ -0,0 +1,93 @@
22+From 33aa4f57f12d37a6acdbc51bb0b4b917691721f4 Mon Sep 17 00:00:00 2001
23+From: Lennart Poettering <lennart@poettering.net>
24+Date: Mon, 25 Feb 2019 11:02:46 +0100
25+Subject: [PATCH] sd-bus: deal with cookie overruns
26+
27+Apparently this happens IRL. Let's carefully deal with issues like this:
28+when we overrun, let's not go back to zero but instead leave the highest
29+cookie bit set. We use that as indication that we are in "overrun
30+territory", and then are particularly careful with checking cookies,
31+i.e. that they haven't been used for still outstanding replies yet. This
32+should retain the quick cookie generation behaviour we used to have, but
33+permits dealing with overruns.
34+
35+Replaces: #11804
36+Fixes: #11809
37+
38+Origin: backport, https://github.com/systemd/systemd/commit/1f82f5bb4237
39+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1876600
40+---
41+ src/libsystemd/sd-bus/sd-bus.c | 49 +++++++++++++++++++++++++++++++++-
42+ 1 file changed, 48 insertions(+), 1 deletion(-)
43+
44+diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
45+index b3e844a64c63..07ba48e451d2 100644
46+--- a/src/libsystemd/sd-bus/sd-bus.c
47++++ b/src/libsystemd/sd-bus/sd-bus.c
48+@@ -1548,7 +1548,50 @@ _public_ int sd_bus_get_bus_id(sd_bus *bus, sd_id128_t *id) {
49+ return 0;
50+ }
51+
52++#define COOKIE_CYCLED (UINT32_C(1) << 31)
53++
54++static uint64_t cookie_inc(uint64_t cookie) {
55++
56++ /* Stay within the 32bit range, since classic D-Bus can't deal with more */
57++ if (cookie >= UINT32_MAX)
58++ return COOKIE_CYCLED; /* Don't go back to zero, but use the highest bit for checking
59++ * whether we are looping. */
60++
61++ return cookie + 1;
62++}
63++
64++static int next_cookie(sd_bus *b) {
65++ uint64_t new_cookie;
66++
67++ assert(b);
68++
69++ new_cookie = cookie_inc(b->cookie);
70++
71++ /* Small optimization: don't bother with checking for cookie reuse until we overran cookiespace at
72++ * least once, but then do it thorougly. */
73++ if ((new_cookie & COOKIE_CYCLED) == COOKIE_CYCLED) {
74++ uint32_t i;
75++
76++ /* Check if the cookie is currently in use. If so, pick the next one */
77++ for (i = 0; i < COOKIE_CYCLED; i++) {
78++ if (!ordered_hashmap_contains(b->reply_callbacks, &new_cookie))
79++ goto good;
80++
81++ new_cookie = cookie_inc(new_cookie);
82++ }
83++
84++ /* Can't fulfill request */
85++ return -EBUSY;
86++ }
87++
88++good:
89++ b->cookie = new_cookie;
90++ return 0;
91++}
92++
93+ static int bus_seal_message(sd_bus *b, sd_bus_message *m, usec_t timeout) {
94++ int r;
95++
96+ assert(b);
97+ assert(m);
98+
99+@@ -1563,7 +1606,11 @@ static int bus_seal_message(sd_bus *b, sd_bus_message *m, usec_t timeout) {
100+ if (timeout == 0)
101+ timeout = BUS_DEFAULT_TIMEOUT;
102+
103+- return bus_message_seal(m, ++b->cookie, timeout);
104++ r = next_cookie(b);
105++ if (r < 0)
106++ return r;
107++
108++ return bus_message_seal(m, b->cookie, timeout);
109+ }
110+
111+ static int bus_remarshal_message(sd_bus *b, sd_bus_message **m) {
112+--
113+2.26.2
114+
115diff --git a/debian/patches/series b/debian/patches/series
116index 42e3aab..7a67331 100644
117--- a/debian/patches/series
118+++ b/debian/patches/series
119@@ -149,3 +149,4 @@ lp1867421-70-mouse.hwdb-Set-DPI-for-MS-Classic-IntelliMouse.patch
120 lp1858412-journalctl-allow-running-vacuum-on-remote-journals-t.patch
121 lp1862232-network-DHCP-ignore-error-in-setting-hostname-when-i.patch
122 lp1837914-journal-do-not-trigger-assertion-when-journal_file_c.patch
123+lp1876600-sd-bus-deal-with-cookie-overruns.patch

Subscribers

People subscribed via source and target branches