Merge ~slyon/ubuntu/+source/systemd:slyon/revert-resolved-segfault into ~ubuntu-core-dev/ubuntu/+source/systemd:ubuntu-focal

Proposed by Lukas Märdian
Status: Rejected
Rejected by: Lukas Märdian
Proposed branch: ~slyon/ubuntu/+source/systemd:slyon/revert-resolved-segfault
Merge into: ~ubuntu-core-dev/ubuntu/+source/systemd:ubuntu-focal
Diff against target: 208 lines (+10/-173)
3 files modified
debian/changelog (+10/-0)
debian/patches/series (+0/-1)
dev/null (+0/-172)
Reviewer Review Type Date Requested Status
Lukas Märdian Disapprove
Dan Streetman Pending
Review via email: mp+408816@code.launchpad.net

Commit message

revert/remove resolved-disable-event-sources-before-unreffing-them.patch

    This did not fix the root-cause of the segfault but rather moved it to a
    slightly different location in the code. (LP: #1943982)
    File: debian/patches/lp1934221-resolved-disable-event-sources-before-unreffing-them.patch

Description of the change

revert/remove resolved-disable-event-sources-before-unreffing-them.patch

    This did not fix the root-cause of the segfault but rather moved it to a
    slightly different location in the code. (LP: #1943982)
    File: debian/patches/lp1934221-resolved-disable-event-sources-before-unreffing-them.patch

To post a comment you must log in.
Revision history for this message
Lukas Märdian (slyon) wrote :

Actually, looking at the numbers of the new and old crash reports, I think we should let this update in as it seems to improve the situation, even if it is not providing a final fix for the root cause.

https://errors.ubuntu.com/problem/c4e5be3f1c7af9483993c7e6007b9325ab5b78cd (new)
https://errors.ubuntu.com/problem/bb0ce4ff8e6ef86041cfb5647b792823a20b44f7 (old)

As can be seen, the old crash does not happen anymore as of systemd 247.3-3ubuntu3.5/6 (Hirsute) and systemd 245.4-4ubuntu3.12/13 (Focal), but is instead replaced by the new (slightly different, but same root-cause crash). Not a single crash report of this type since the systemd SRU hit hirsute-updates (and started phasing for focal-updates) a week ago on 2021-09-15.

Additionally, we observed only 4 crashes (up to now) on Hirsute (where it's fully phased), whereas there have been 974 crash reports of the old crash in total. This is evidence that the new crash does happen less often, thus improves the situation overall, even though not fixing the root cause. It also supports the statement made by the original bug reporter in https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1934221/comments/34 that the crash still happens, but less frequent.

With the old crash not happening anymore and the new crash happening less frequent, I think we should ask the release team to manually approve/phase this SRU, as it improves the overall situation.

Revision history for this message
Lukas Märdian (slyon) wrote :

SRU team (RAOF) agreed, so I'm closing this one.

review: Disapprove

Unmerged commits

a75d319... by Lukas Märdian

update changelog

87fd092... by Lukas Märdian

revert/remove resolved-disable-event-sources-before-unreffing-them.patch

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 98be76e..303329c 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,13 @@
6+systemd (245.4-4ubuntu3.14) UNRELEASED; urgency=medium
7+
8+ * revert/remove resolved-disable-event-sources-before-unreffing-them.patch
9+ This did not fix the root-cause of the segfault but rather moved it to a
10+ slightly different location in the code. (LP: #1943982)
11+ File: debian/patches/lp1934221-resolved-disable-event-sources-before-unreffing-them.patch
12+ https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=87fd092cbe40be455ef99e6dbd4cef50272da1da
13+
14+ -- Lukas Märdian <slyon@ubuntu.com> Fri, 17 Sep 2021 16:52:06 +0200
15+
16 systemd (245.4-4ubuntu3.13) focal; urgency=medium
17
18 * d/p/dell-clamshell-accel-location-base-with-sku.patch:
19diff --git a/debian/patches/lp1934221-resolved-disable-event-sources-before-unreffing-them.patch b/debian/patches/lp1934221-resolved-disable-event-sources-before-unreffing-them.patch
20deleted file mode 100644
21index fa9b484..0000000
22--- a/debian/patches/lp1934221-resolved-disable-event-sources-before-unreffing-them.patch
23+++ /dev/null
24@@ -1,172 +0,0 @@
25-From: Denys Fedoryshchenko <nuclearcat@nuclearcat.com>
26-Date: Tue, 20 Jul 2021 11:44:01 +0200
27-Subject: resolved: disable event sources before unreffing them
28-Origin: upstream, https://github.com/systemd/systemd/commit/97935302283729c9206b84f5e00b1aff0f78ad19
29-Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1934221
30-Reviewed-by: Lukas Märdian <slyon@ubuntu.com>
31-
32-We generally operate on the assumption that a source is "gone" as soon
33-as we unref it. This is generally true because we have the only reference.
34-But if something else holds the reference, our unref doesn't really stop
35-the source and it could fire again.
36-
37-In particular, on_query_timeout() is called with DnsQuery* as userdata, and
38-it calls dns_query_stop() which invalidates that pointer. If it was ever
39-called again, we'd be accessing already-freed memory.
40-
41-I don't see what would hold the reference. sd-event takes a temporary reference,
42-but on the sd_event object, not on the individual sources. And our sources
43-are non-floating, so there is no reference from the sd_event object to the
44-sources.
45-
46-For #18427.
47----
48- src/resolve/resolved-dns-query.c | 2 +-
49- src/resolve/resolved-dns-scope.c | 8 ++++----
50- src/resolve/resolved-dns-stream.c | 4 ++--
51- src/resolve/resolved-dns-stub.c | 4 ++--
52- src/resolve/resolved-dns-transaction.c | 4 ++--
53- src/resolve/resolved-llmnr.c | 8 ++++----
54- src/resolve/resolved-mdns.c | 4 ++--
55- 7 files changed, 17 insertions(+), 17 deletions(-)
56-
57-diff --git a/src/resolve/resolved-dns-query.c b/src/resolve/resolved-dns-query.c
58-index 4a41921..614cc32 100644
59---- a/src/resolve/resolved-dns-query.c
60-+++ b/src/resolve/resolved-dns-query.c
61-@@ -333,7 +333,7 @@ static void dns_query_stop(DnsQuery *q) {
62-
63- assert(q);
64-
65-- q->timeout_event_source = sd_event_source_unref(q->timeout_event_source);
66-+ q->timeout_event_source = sd_event_source_disable_unref(q->timeout_event_source);
67-
68- LIST_FOREACH(candidates_by_query, c, q->candidates)
69- dns_query_candidate_stop(c);
70-diff --git a/src/resolve/resolved-dns-scope.c b/src/resolve/resolved-dns-scope.c
71-index d7e7b5a..4701736 100644
72---- a/src/resolve/resolved-dns-scope.c
73-+++ b/src/resolve/resolved-dns-scope.c
74-@@ -110,9 +110,9 @@ DnsScope* dns_scope_free(DnsScope *s) {
75- hashmap_free(s->transactions_by_key);
76-
77- ordered_hashmap_free_with_destructor(s->conflict_queue, dns_resource_record_unref);
78-- sd_event_source_unref(s->conflict_event_source);
79-+ sd_event_source_disable_unref(s->conflict_event_source);
80-
81-- sd_event_source_unref(s->announce_event_source);
82-+ sd_event_source_disable_unref(s->announce_event_source);
83-
84- dns_cache_flush(&s->cache);
85- dns_zone_flush(&s->zone);
86-@@ -998,7 +998,7 @@ static int on_conflict_dispatch(sd_event_source *es, usec_t usec, void *userdata
87- assert(es);
88- assert(scope);
89-
90-- scope->conflict_event_source = sd_event_source_unref(scope->conflict_event_source);
91-+ scope->conflict_event_source = sd_event_source_disable_unref(scope->conflict_event_source);
92-
93- for (;;) {
94- _cleanup_(dns_resource_key_unrefp) DnsResourceKey *key = NULL;
95-@@ -1204,7 +1204,7 @@ static int on_announcement_timeout(sd_event_source *s, usec_t usec, void *userda
96-
97- assert(s);
98-
99-- scope->announce_event_source = sd_event_source_unref(scope->announce_event_source);
100-+ scope->announce_event_source = sd_event_source_disable_unref(scope->announce_event_source);
101-
102- (void) dns_scope_announce(scope, false);
103- return 0;
104-diff --git a/src/resolve/resolved-dns-stream.c b/src/resolve/resolved-dns-stream.c
105-index 2a10694..d46302e 100644
106---- a/src/resolve/resolved-dns-stream.c
107-+++ b/src/resolve/resolved-dns-stream.c
108-@@ -17,8 +17,8 @@
109- static void dns_stream_stop(DnsStream *s) {
110- assert(s);
111-
112-- s->io_event_source = sd_event_source_unref(s->io_event_source);
113-- s->timeout_event_source = sd_event_source_unref(s->timeout_event_source);
114-+ s->io_event_source = sd_event_source_disable_unref(s->io_event_source);
115-+ s->timeout_event_source = sd_event_source_disable_unref(s->timeout_event_source);
116- s->fd = safe_close(s->fd);
117-
118- /* Disconnect us from the server object if we are now not usable anymore */
119-diff --git a/src/resolve/resolved-dns-stub.c b/src/resolve/resolved-dns-stub.c
120-index ce994a7..851a78a 100644
121---- a/src/resolve/resolved-dns-stub.c
122-+++ b/src/resolve/resolved-dns-stub.c
123-@@ -577,8 +577,8 @@ int manager_dns_stub_start(Manager *m) {
124- void manager_dns_stub_stop(Manager *m) {
125- assert(m);
126-
127-- m->dns_stub_udp_event_source = sd_event_source_unref(m->dns_stub_udp_event_source);
128-- m->dns_stub_tcp_event_source = sd_event_source_unref(m->dns_stub_tcp_event_source);
129-+ m->dns_stub_udp_event_source = sd_event_source_disable_unref(m->dns_stub_udp_event_source);
130-+ m->dns_stub_tcp_event_source = sd_event_source_disable_unref(m->dns_stub_tcp_event_source);
131-
132- m->dns_stub_udp_fd = safe_close(m->dns_stub_udp_fd);
133- m->dns_stub_tcp_fd = safe_close(m->dns_stub_tcp_fd);
134-diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c
135-index 2f3fb68..5e29275 100644
136---- a/src/resolve/resolved-dns-transaction.c
137-+++ b/src/resolve/resolved-dns-transaction.c
138-@@ -59,14 +59,14 @@ static void dns_transaction_close_connection(DnsTransaction *t) {
139- t->stream = dns_stream_unref(t->stream);
140- }
141-
142-- t->dns_udp_event_source = sd_event_source_unref(t->dns_udp_event_source);
143-+ t->dns_udp_event_source = sd_event_source_disable_unref(t->dns_udp_event_source);
144- t->dns_udp_fd = safe_close(t->dns_udp_fd);
145- }
146-
147- static void dns_transaction_stop_timeout(DnsTransaction *t) {
148- assert(t);
149-
150-- t->timeout_event_source = sd_event_source_unref(t->timeout_event_source);
151-+ t->timeout_event_source = sd_event_source_disable_unref(t->timeout_event_source);
152- }
153-
154- DnsTransaction* dns_transaction_free(DnsTransaction *t) {
155-diff --git a/src/resolve/resolved-llmnr.c b/src/resolve/resolved-llmnr.c
156-index 61e5034..5ffa984 100644
157---- a/src/resolve/resolved-llmnr.c
158-+++ b/src/resolve/resolved-llmnr.c
159-@@ -11,16 +11,16 @@
160- void manager_llmnr_stop(Manager *m) {
161- assert(m);
162-
163-- m->llmnr_ipv4_udp_event_source = sd_event_source_unref(m->llmnr_ipv4_udp_event_source);
164-+ m->llmnr_ipv4_udp_event_source = sd_event_source_disable_unref(m->llmnr_ipv4_udp_event_source);
165- m->llmnr_ipv4_udp_fd = safe_close(m->llmnr_ipv4_udp_fd);
166-
167-- m->llmnr_ipv6_udp_event_source = sd_event_source_unref(m->llmnr_ipv6_udp_event_source);
168-+ m->llmnr_ipv6_udp_event_source = sd_event_source_disable_unref(m->llmnr_ipv6_udp_event_source);
169- m->llmnr_ipv6_udp_fd = safe_close(m->llmnr_ipv6_udp_fd);
170-
171-- m->llmnr_ipv4_tcp_event_source = sd_event_source_unref(m->llmnr_ipv4_tcp_event_source);
172-+ m->llmnr_ipv4_tcp_event_source = sd_event_source_disable_unref(m->llmnr_ipv4_tcp_event_source);
173- m->llmnr_ipv4_tcp_fd = safe_close(m->llmnr_ipv4_tcp_fd);
174-
175-- m->llmnr_ipv6_tcp_event_source = sd_event_source_unref(m->llmnr_ipv6_tcp_event_source);
176-+ m->llmnr_ipv6_tcp_event_source = sd_event_source_disable_unref(m->llmnr_ipv6_tcp_event_source);
177- m->llmnr_ipv6_tcp_fd = safe_close(m->llmnr_ipv6_tcp_fd);
178- }
179-
180-diff --git a/src/resolve/resolved-mdns.c b/src/resolve/resolved-mdns.c
181-index 921720f..15c3263 100644
182---- a/src/resolve/resolved-mdns.c
183-+++ b/src/resolve/resolved-mdns.c
184-@@ -15,10 +15,10 @@
185- void manager_mdns_stop(Manager *m) {
186- assert(m);
187-
188-- m->mdns_ipv4_event_source = sd_event_source_unref(m->mdns_ipv4_event_source);
189-+ m->mdns_ipv4_event_source = sd_event_source_disable_unref(m->mdns_ipv4_event_source);
190- m->mdns_ipv4_fd = safe_close(m->mdns_ipv4_fd);
191-
192-- m->mdns_ipv6_event_source = sd_event_source_unref(m->mdns_ipv6_event_source);
193-+ m->mdns_ipv6_event_source = sd_event_source_disable_unref(m->mdns_ipv6_event_source);
194- m->mdns_ipv6_fd = safe_close(m->mdns_ipv6_fd);
195- }
196-
197diff --git a/debian/patches/series b/debian/patches/series
198index 9da13cd..800d12f 100644
199--- a/debian/patches/series
200+++ b/debian/patches/series
201@@ -146,7 +146,6 @@ lp1891215/0003-fs-util-rename-conservative_rename-conservative_rena.patch
202 lp1891215/0004-fs-util-make-sure-conservative_renameat-properly-det.patch
203 lp1914740-network-enable-DHCP-broadcast-flag-if-required-by-in.patch
204 lp1934981-correct-suspend-then-sleep-string.patch
205-lp1934221-resolved-disable-event-sources-before-unreffing-them.patch
206 CVE-2020-13529.patch
207 CVE-2021-33910.patch
208 lp1937117/0001-revert-lp1929560-network-move-set-MAC-and-set-nomaster-operations-out.patch

Subscribers

People subscribed via source and target branches