Merge ~enr0n/ubuntu/+source/systemd:ubuntu-lunar-sru into ~ubuntu-core-dev/ubuntu/+source/systemd:ubuntu-lunar
- Git
- lp:~enr0n/ubuntu/+source/systemd
- ubuntu-lunar-sru
- Merge into ubuntu-lunar
Proposed by
Nick Rosbrook
Status: | Merged | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 2d65b6c74864976a2bb42c884baf75d1674215fc | ||||||||||||||||||||||||
Proposed branch: | ~enr0n/ubuntu/+source/systemd:ubuntu-lunar-sru | ||||||||||||||||||||||||
Merge into: | ~ubuntu-core-dev/ubuntu/+source/systemd:ubuntu-lunar | ||||||||||||||||||||||||
Diff against target: |
434 lines (+299/-55) 9 files modified
debian/patches/lp2009743/network-dhcp4-do-not-ignore-the-gateway-even-if-the-desti.patch (+60/-0) debian/patches/lp2009743/test-network-add-one-more-testcase-for-DHCPv4-classless-r.patch (+36/-0) debian/patches/lp2013543-core-reorder-systemd-arguments-on-reexec.patch (+58/-0) debian/patches/lp2028180-udev-rules-fix-nvme-symlink-creation-on-namespace-changes.patch (+59/-0) debian/patches/lp2031683-sd-bus-bus_message_type_from_string-is-not-pure.patch (+62/-0) debian/patches/series (+5/-1) debian/systemd.postinst (+18/-15) debian/tests/tests-in-lxd (+1/-1) dev/null (+0/-38) |
||||||||||||||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Lukas Märdian | Approve | ||
Review via email: mp+449221@code.launchpad.net |
Commit message
Description of the change
SRU several bug fixes to Lunar.
To post a comment you must log in.
Revision history for this message
Lukas Märdian (slyon) wrote : | # |
Added an inline comment reply.
Revision history for this message
Nick Rosbrook (enr0n) wrote : | # |
Thanks for your review! I will take a look at the email thread you sent before proceeding.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/debian/patches/debian/UBUNTU-wait-online-exit-if-no-links-are-managed.patch b/debian/patches/debian/UBUNTU-wait-online-exit-if-no-links-are-managed.patch |
2 | deleted file mode 100644 |
3 | index 204b67f..0000000 |
4 | --- a/debian/patches/debian/UBUNTU-wait-online-exit-if-no-links-are-managed.patch |
5 | +++ /dev/null |
6 | @@ -1,38 +0,0 @@ |
7 | -From: Dimitri John Ledkov <xnox@ubuntu.com> |
8 | -Date: Mon, 26 Mar 2018 13:17:01 +0100 |
9 | -Subject: wait-online: exit, if no links are managed. |
10 | - |
11 | -(cherry picked from commit 19d11f607ac0f8b1e31f72a8e9d3d44371b9dadb) |
12 | ---- |
13 | - src/network/wait-online/manager.c | 7 ++++++- |
14 | - 1 file changed, 6 insertions(+), 1 deletion(-) |
15 | - |
16 | ---- a/src/network/wait-online/manager.c |
17 | -+++ b/src/network/wait-online/manager.c |
18 | -@@ -116,6 +116,7 @@ |
19 | - |
20 | - bool manager_configured(Manager *m) { |
21 | - bool one_ready = false; |
22 | -+ bool none_managed = true; |
23 | - const char *ifname; |
24 | - Link *l; |
25 | - int r; |
26 | -@@ -166,13 +167,17 @@ |
27 | - _LINK_OPERSTATE_INVALID }); |
28 | - if (r < 0 && !m->any) |
29 | - return false; |
30 | -+ if (l->state && STR_IN_SET(l->state, "configured", "failed")) { |
31 | -+ log_info("managing: %s", l->ifname); |
32 | -+ none_managed = false; |
33 | -+ } |
34 | - if (r > 0) |
35 | - /* we wait for at least one link to be ready, |
36 | - * regardless of who manages it */ |
37 | - one_ready = true; |
38 | - } |
39 | - |
40 | -- return one_ready; |
41 | -+ return one_ready || none_managed; |
42 | - } |
43 | - |
44 | - static int manager_process_link(sd_netlink *rtnl, sd_netlink_message *mm, void *userdata) { |
45 | diff --git a/debian/patches/lp2009743/network-dhcp4-do-not-ignore-the-gateway-even-if-the-desti.patch b/debian/patches/lp2009743/network-dhcp4-do-not-ignore-the-gateway-even-if-the-desti.patch |
46 | new file mode 100644 |
47 | index 0000000..e412f97 |
48 | --- /dev/null |
49 | +++ b/debian/patches/lp2009743/network-dhcp4-do-not-ignore-the-gateway-even-if-the-desti.patch |
50 | @@ -0,0 +1,60 @@ |
51 | +From: Yu Watanabe <watanabe.yu+github@gmail.com> |
52 | +Date: Fri, 7 Jul 2023 06:31:04 +0900 |
53 | +Subject: network/dhcp4: do not ignore the gateway even if the destination is |
54 | + in the same network |
55 | + |
56 | +Origin: upstream, https://github.com/systemd/systemd-stable/commit/2ed806724288c69da272907d91149570d874133d |
57 | +Bug-Ubuntu: https://launchpad.net/bugs/2009743 |
58 | + |
59 | +Fixes #28280. |
60 | + |
61 | +(cherry picked from commit 77451f654a89d822cd288883edfac315949d1cb6) |
62 | +(cherry picked from commit 234b51fb730d1b36ebcc32fc26725a12b08cd818) |
63 | +--- |
64 | + src/network/networkd-dhcp4.c | 12 ++++++++---- |
65 | + 1 file changed, 8 insertions(+), 4 deletions(-) |
66 | + |
67 | +diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c |
68 | +index 9a22b6f..eef7633 100644 |
69 | +--- a/src/network/networkd-dhcp4.c |
70 | ++++ b/src/network/networkd-dhcp4.c |
71 | +@@ -275,7 +275,8 @@ static int dhcp4_request_route_to_gateway(Link *link, const struct in_addr *gw) |
72 | + static int dhcp4_request_route_auto( |
73 | + Route *in, |
74 | + Link *link, |
75 | +- const struct in_addr *gw) { |
76 | ++ const struct in_addr *gw, |
77 | ++ bool force_use_gw) { |
78 | + |
79 | + _cleanup_(route_freep) Route *route = in; |
80 | + struct in_addr address, netmask, prefix; |
81 | +@@ -320,7 +321,8 @@ static int dhcp4_request_route_auto( |
82 | + route->gw = IN_ADDR_NULL; |
83 | + route->prefsrc.in = address; |
84 | + |
85 | +- } else if (route->dst_prefixlen >= prefixlen && |
86 | ++ } else if (!force_use_gw && |
87 | ++ route->dst_prefixlen >= prefixlen && |
88 | + (route->dst.in.s_addr & netmask.s_addr) == prefix.s_addr) { |
89 | + if (in4_addr_is_set(gw)) |
90 | + log_link_debug(link, "DHCP: requested route destination "IPV4_ADDRESS_FMT_STR"/%u is in the assigned network " |
91 | +@@ -470,7 +472,9 @@ static int dhcp4_request_static_routes(Link *link, struct in_addr *ret_default_g |
92 | + in4_addr_is_null(&default_gw)) |
93 | + default_gw = gw; |
94 | + |
95 | +- r = dhcp4_request_route_auto(TAKE_PTR(route), link, &gw); |
96 | ++ /* Do not ignore the gateway given by the classless route option even if the destination is |
97 | ++ * in the same network. See issue #28280. */ |
98 | ++ r = dhcp4_request_route_auto(TAKE_PTR(route), link, &gw, /* force_use_gw = */ n_classless_routes > 0); |
99 | + if (r < 0) |
100 | + return r; |
101 | + } |
102 | +@@ -606,7 +610,7 @@ static int dhcp4_request_routes_to_servers( |
103 | + route->dst.in = servers[i]; |
104 | + route->dst_prefixlen = 32; |
105 | + |
106 | +- r = dhcp4_request_route_auto(TAKE_PTR(route), link, gw); |
107 | ++ r = dhcp4_request_route_auto(TAKE_PTR(route), link, gw, /* force_use_gw = */ false); |
108 | + if (r < 0) |
109 | + return r; |
110 | + } |
111 | diff --git a/debian/patches/lp2009743/test-network-add-one-more-testcase-for-DHCPv4-classless-r.patch b/debian/patches/lp2009743/test-network-add-one-more-testcase-for-DHCPv4-classless-r.patch |
112 | new file mode 100644 |
113 | index 0000000..330d6ec |
114 | --- /dev/null |
115 | +++ b/debian/patches/lp2009743/test-network-add-one-more-testcase-for-DHCPv4-classless-r.patch |
116 | @@ -0,0 +1,36 @@ |
117 | +From: Yu Watanabe <watanabe.yu+github@gmail.com> |
118 | +Date: Fri, 7 Jul 2023 06:57:04 +0900 |
119 | +Subject: test-network: add one more testcase for DHCPv4 classless route |
120 | + |
121 | +Origin: upstream, https://github.com/systemd/systemd-stable/commit/7cf1bc00b02010f7ad89c5804dfa81fd906e44c7 |
122 | +Bug-Ubuntu: https://launchpad.net/bugs/2009743 |
123 | + |
124 | +For issue #28280. |
125 | + |
126 | +(cherry picked from commit 86f6760038477e9e27ccea580f1b3b27328a98a7) |
127 | +(cherry picked from commit f74337b7565348a9bd44baae27917b2a202dcf1a) |
128 | +--- |
129 | + test/test-network/systemd-networkd-tests.py | 3 ++- |
130 | + 1 file changed, 2 insertions(+), 1 deletion(-) |
131 | + |
132 | +diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py |
133 | +index a04f302..1fe743d 100755 |
134 | +--- a/test/test-network/systemd-networkd-tests.py |
135 | ++++ b/test/test-network/systemd-networkd-tests.py |
136 | +@@ -4658,7 +4658,7 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities): |
137 | + ] |
138 | + if classless: |
139 | + additional_options += [ |
140 | +- '--dhcp-option=option:classless-static-route,0.0.0.0/0,192.168.5.4,8.0.0.0/8,192.168.5.5' |
141 | ++ '--dhcp-option=option:classless-static-route,0.0.0.0/0,192.168.5.4,8.0.0.0/8,192.168.5.5,192.168.5.64/26,192.168.5.5' |
142 | + ] |
143 | + start_dnsmasq(*additional_options) |
144 | + self.wait_online(['veth99:routable', 'veth-peer:routable']) |
145 | +@@ -4671,6 +4671,7 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities): |
146 | + if classless: |
147 | + self.assertRegex(output, r'default via 192.168.5.4 proto dhcp src 192.168.5.[0-9]* metric 1024') |
148 | + self.assertRegex(output, r'8.0.0.0/8 via 192.168.5.5 proto dhcp src 192.168.5.[0-9]* metric 1024') |
149 | ++ self.assertRegex(output, r'192.168.5.64/26 via 192.168.5.5 proto dhcp src 192.168.5.[0-9]* metric 1024') |
150 | + self.assertRegex(output, r'192.168.5.4 proto dhcp scope link src 192.168.5.[0-9]* metric 1024') |
151 | + self.assertRegex(output, r'192.168.5.5 proto dhcp scope link src 192.168.5.[0-9]* metric 1024') |
152 | + else: |
153 | diff --git a/debian/patches/lp2013543-core-reorder-systemd-arguments-on-reexec.patch b/debian/patches/lp2013543-core-reorder-systemd-arguments-on-reexec.patch |
154 | new file mode 100644 |
155 | index 0000000..d45f0e9 |
156 | --- /dev/null |
157 | +++ b/debian/patches/lp2013543-core-reorder-systemd-arguments-on-reexec.patch |
158 | @@ -0,0 +1,58 @@ |
159 | +From: Frantisek Sumsal <frantisek@sumsal.cz> |
160 | +Date: Thu, 29 Jun 2023 13:31:19 +0200 |
161 | +Subject: core: reorder systemd arguments on reexec |
162 | + |
163 | +Origin: upstream, https://github.com/systemd/systemd-stable/commit/163be31d380fbdcb56ec06c09e81774840df90dc |
164 | +Bug-Ubuntu: https://launchpad.net/bugs/2013543 |
165 | + |
166 | +When reexecuting system let's put our arguments carrying deserialization |
167 | +info first followed by any existing arguments to make sure they get |
168 | +parsed in case we get weird stuff from the kernel cmdline (like --). |
169 | + |
170 | +See: https://github.com/systemd/systemd/issues/28184 |
171 | +(cherry picked from commit 06afda6b38d5d730fca3c65449096425933272bc) |
172 | +(cherry picked from commit 884ab38057dca70b8779c85884f4646057e80921) |
173 | +--- |
174 | + src/core/main.c | 6 +++++- |
175 | + test/TEST-01-BASIC/test.sh | 5 +++++ |
176 | + 2 files changed, 10 insertions(+), 1 deletion(-) |
177 | + |
178 | +diff --git a/src/core/main.c b/src/core/main.c |
179 | +index c8b7d16..263bdde 100644 |
180 | +--- a/src/core/main.c |
181 | ++++ b/src/core/main.c |
182 | +@@ -1796,13 +1796,17 @@ static int do_reexecute( |
183 | + xsprintf(sfd, "%i", fileno(arg_serialization)); |
184 | + |
185 | + i = 1; /* Leave args[0] empty for now. */ |
186 | +- filter_args(args, &i, argv, argc); |
187 | + |
188 | ++ /* Put our stuff first to make sure it always gets parsed in case |
189 | ++ * we get weird stuff from the kernel cmdline (like --) */ |
190 | + if (switch_root_dir) |
191 | + args[i++] = "--switched-root"; |
192 | + args[i++] = arg_system ? "--system" : "--user"; |
193 | + args[i++] = "--deserialize"; |
194 | + args[i++] = sfd; |
195 | ++ |
196 | ++ filter_args(args, &i, argv, argc); |
197 | ++ |
198 | + args[i++] = NULL; |
199 | + |
200 | + assert(i <= args_size); |
201 | +diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh |
202 | +index cc6d065..d0e714a 100755 |
203 | +--- a/test/TEST-01-BASIC/test.sh |
204 | ++++ b/test/TEST-01-BASIC/test.sh |
205 | +@@ -8,6 +8,11 @@ RUN_IN_UNPRIVILEGED_CONTAINER=${RUN_IN_UNPRIVILEGED_CONTAINER:-yes} |
206 | + TEST_REQUIRE_INSTALL_TESTS=0 |
207 | + TEST_SUPPORTING_SERVICES_SHOULD_BE_MASKED=0 |
208 | + |
209 | ++# Check if we can correctly deserialize if the kernel cmdline contains "weird" stuff |
210 | ++# like an invalid argument, "end of arguments" separator, or a sysvinit argument (-z) |
211 | ++# See: https://github.com/systemd/systemd/issues/28184 |
212 | ++KERNEL_APPEND="foo -- -z bar --- baz $KERNEL_APPEND" |
213 | ++ |
214 | + # shellcheck source=test/test-functions |
215 | + . "${TEST_BASE_DIR:?}/test-functions" |
216 | + |
217 | diff --git a/debian/patches/lp2028180-udev-rules-fix-nvme-symlink-creation-on-namespace-changes.patch b/debian/patches/lp2028180-udev-rules-fix-nvme-symlink-creation-on-namespace-changes.patch |
218 | new file mode 100644 |
219 | index 0000000..5f2735b |
220 | --- /dev/null |
221 | +++ b/debian/patches/lp2028180-udev-rules-fix-nvme-symlink-creation-on-namespace-changes.patch |
222 | @@ -0,0 +1,59 @@ |
223 | +From: Thomas Blume <Thomas.Blume@suse.com> |
224 | +Date: Thu, 2 Mar 2023 12:06:13 +0100 |
225 | +Subject: udev-rules: fix nvme symlink creation on namespace changes |
226 | + |
227 | +Origin: upstream, https://github.com/systemd/systemd/commit/c5ba7a2a4dd19a2d31b8a9d52d3c4bdde78387f0 |
228 | +Bug-Ubuntu: https://launchpad.net/bugs/2028180 |
229 | + |
230 | +The nvme by-id symlink changes to the latest namespace when a new namespace gets |
231 | +added, for example by connecting multiple NVMe/TCP host controllers via nvme |
232 | +connect-all. |
233 | +That is incorrect for persistent device links. |
234 | +The persistent symbolic device link should continue to point to the same NVMe |
235 | +namespace throughout the lifetime of the current boot. |
236 | +Therefore the namespace id needs to be added to the link name. |
237 | +--- |
238 | + rules.d/60-persistent-storage.rules | 8 ++++++++ |
239 | + test/units/testsuite-64.sh | 2 ++ |
240 | + 2 files changed, 10 insertions(+) |
241 | + |
242 | +diff --git a/rules.d/60-persistent-storage.rules b/rules.d/60-persistent-storage.rules |
243 | +index 2780dcb..e1c4bf6 100644 |
244 | +--- a/rules.d/60-persistent-storage.rules |
245 | ++++ b/rules.d/60-persistent-storage.rules |
246 | +@@ -37,14 +37,22 @@ KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{serial}=="?*", ENV{ID_S |
247 | + KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{wwid}=="?*", ENV{ID_WWN}="$attr{wwid}" |
248 | + KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{model}=="?*", ENV{ID_MODEL}="$attr{model}" |
249 | + KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{firmware_rev}=="?*", ENV{ID_REVISION}="$attr{firmware_rev}" |
250 | ++KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{nsid}=="?*", ENV{ID_NSID}="$attr{nsid}" |
251 | ++# obsolete symlink that might get overridden on adding a new nvme controller, kept for backward compatibility |
252 | + KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ENV{ID_MODEL}=="?*", ENV{ID_SERIAL_SHORT}=="?*", \ |
253 | + OPTIONS="string_escape=replace", ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}" |
254 | ++KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ENV{ID_MODEL}=="?*", ENV{ID_SERIAL_SHORT}=="?*", ENV{ID_NSID}=="?*",\ |
255 | ++ OPTIONS="string_escape=replace", ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}_$env{ID_NSID}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}" |
256 | + |
257 | + KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{serial}=="?*", ENV{ID_SERIAL_SHORT}="$attr{serial}" |
258 | + KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{model}=="?*", ENV{ID_MODEL}="$attr{model}" |
259 | + KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{firmware_rev}=="?*", ENV{ID_REVISION}="$attr{firmware_rev}" |
260 | ++KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{nsid}=="?*", ENV{ID_NSID}="$attr{nsid}" |
261 | ++# obsolete symlink that might get overridden on adding a new nvme controller, kept for backward compatibility |
262 | + KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ENV{ID_MODEL}=="?*", ENV{ID_SERIAL_SHORT}=="?*", \ |
263 | + OPTIONS="string_escape=replace", ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}-part%n" |
264 | ++KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ENV{ID_MODEL}=="?*", ENV{ID_SERIAL_SHORT}=="?*", ENV{ID_NSID}=="?*",\ |
265 | ++ OPTIONS="string_escape=replace", ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}_$env{ID_NSID}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}-part%n" |
266 | + |
267 | + # virtio-blk |
268 | + KERNEL=="vd*[!0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}" |
269 | +diff --git a/test/units/testsuite-64.sh b/test/units/testsuite-64.sh |
270 | +index c4406f3..5d32e0d 100755 |
271 | +--- a/test/units/testsuite-64.sh |
272 | ++++ b/test/units/testsuite-64.sh |
273 | +@@ -181,6 +181,8 @@ testcase_nvme_subsystem() { |
274 | + local expected_symlinks=( |
275 | + # Controller(s) |
276 | + /dev/disk/by-id/nvme-QEMU_NVMe_Ctrl_deadbeef |
277 | ++ /dev/disk/by-id/nvme-QEMU_NVMe_Ctrl_deadbeef_16 |
278 | ++ /dev/disk/by-id/nvme-QEMU_NVMe_Ctrl_deadbeef_17 |
279 | + # Shared namespaces |
280 | + /dev/disk/by-path/pci-*-nvme-16 |
281 | + /dev/disk/by-path/pci-*-nvme-17 |
282 | diff --git a/debian/patches/lp2031683-sd-bus-bus_message_type_from_string-is-not-pure.patch b/debian/patches/lp2031683-sd-bus-bus_message_type_from_string-is-not-pure.patch |
283 | new file mode 100644 |
284 | index 0000000..7cd6202 |
285 | --- /dev/null |
286 | +++ b/debian/patches/lp2031683-sd-bus-bus_message_type_from_string-is-not-pure.patch |
287 | @@ -0,0 +1,62 @@ |
288 | +From: Xi Ruoyao <xry111@xry111.site> |
289 | +Date: Wed, 10 May 2023 01:41:28 +0800 |
290 | +Subject: sd-bus: bus_message_type_from_string is not pure |
291 | + |
292 | +Origin: upstream, https://github.com/systemd/systemd-stable/commit/bf2f71a0615b3831f170728760171d8bfb13fc5e |
293 | +Bug-Ubuntu: https://launchpad.net/bugs/2031683 |
294 | +MIME-Version: 1.0 |
295 | +Content-Type: text/plain; charset="utf-8" |
296 | +Content-Transfer-Encoding: 8bit |
297 | + |
298 | +GCC document [1] says: |
299 | + |
300 | + The pure attribute prohibits a function from modifying the state |
301 | + of the program that is observable by means other than inspecting |
302 | + the function’s return value. |
303 | + |
304 | +And there is an example: |
305 | + |
306 | + `int hash (char *) __attribute__ ((pure));` |
307 | + ... Even though hash takes a non-const pointer argument it must |
308 | + not modify the array it points to, ... |
309 | + |
310 | +But we are modifying the object pointed to by the pointer u, which is |
311 | +clearly a violation of the semantic of pure. |
312 | + |
313 | +With -ftrivial-auto-var-init (enabled by -Dmode=release), on some |
314 | +targets (GCC 12.2 on AArch64 and GCC 13.1 on x86_64) performs an |
315 | +optimization: as the variable "u" in bus_match_parse has been |
316 | +zero-initialized (by the -ftrivial-auto-var-init option) and never |
317 | +modified (because a "pure" bus_message_type_from_string is not allowed |
318 | +to modify it), "u" will be always 0. |
319 | + |
320 | +Then 0 is used to initialize .value_u8 field of struct |
321 | +bus_match_component. This then causes a infinite event loop, so |
322 | +"systemctl restart" never stops, and pam_systemd timeouts communicating |
323 | +with logind, etc. |
324 | + |
325 | +So we should remove the "pure" attribute here. |
326 | + |
327 | +Fixes #26395. |
328 | + |
329 | +[1]:https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-pure-function-attribute |
330 | + |
331 | +(cherry picked from commit 6723c28f36ea566faf61d3610012cd89f95ee4a0) |
332 | +(cherry picked from commit 59dccdfddbdde5d4ff047108a545106f2bac6872) |
333 | +--- |
334 | + src/libsystemd/sd-bus/bus-internal.h | 2 +- |
335 | + 1 file changed, 1 insertion(+), 1 deletion(-) |
336 | + |
337 | +diff --git a/src/libsystemd/sd-bus/bus-internal.h b/src/libsystemd/sd-bus/bus-internal.h |
338 | +index 51673ad1..d486e17 100644 |
339 | +--- a/src/libsystemd/sd-bus/bus-internal.h |
340 | ++++ b/src/libsystemd/sd-bus/bus-internal.h |
341 | +@@ -361,7 +361,7 @@ bool path_complex_pattern(const char *pattern, const char *value) _pure_; |
342 | + bool namespace_simple_pattern(const char *pattern, const char *value) _pure_; |
343 | + bool path_simple_pattern(const char *pattern, const char *value) _pure_; |
344 | + |
345 | +-int bus_message_type_from_string(const char *s, uint8_t *u) _pure_; |
346 | ++int bus_message_type_from_string(const char *s, uint8_t *u); |
347 | + const char *bus_message_type_to_string(uint8_t u) _pure_; |
348 | + |
349 | + #define error_name_is_valid interface_name_is_valid |
350 | diff --git a/debian/patches/series b/debian/patches/series |
351 | index ac0e72b..a9a027e 100644 |
352 | --- a/debian/patches/series |
353 | +++ b/debian/patches/series |
354 | @@ -18,7 +18,6 @@ debian/Ubuntu-UseDomains-by-default.patch |
355 | debian/Ubuntu-units-set-ConditionVirtualization-private-users-on-j.patch |
356 | debian/UBUNTU-Add-AssumedApparmorLabel-unconfined-to-timedate1-dbus.patch |
357 | debian/UBUNTU-test-test-functions-launch-qemu-with-vga-none.patch |
358 | -debian/UBUNTU-wait-online-exit-if-no-links-are-managed.patch |
359 | debian/UBUNTU-journald.service-set-Nice-1-to-dodge-watchdog-on-soft-loc.patch |
360 | debian/UBUNTU-units-block-CAP_SYS_MODULE-units-in-containers-too.patch |
361 | debian/UBUNTU-test-sleep-skip-test_fiemap-upon-inapproriate-ioctl-.patch |
362 | @@ -57,3 +56,8 @@ lp2002445/sd-device-make-device_set_syspath-clear-sysname-and-sysnu.patch |
363 | lp2002445/udev-restore-syspath-and-properties-on-failure.patch |
364 | lp2002445/sd-device-introduce-device_get_property_int.patch |
365 | lp2002445/core-device-ignore-failed-uevents.patch |
366 | +lp2028180-udev-rules-fix-nvme-symlink-creation-on-namespace-changes.patch |
367 | +lp2013543-core-reorder-systemd-arguments-on-reexec.patch |
368 | +lp2009743/network-dhcp4-do-not-ignore-the-gateway-even-if-the-desti.patch |
369 | +lp2009743/test-network-add-one-more-testcase-for-DHCPv4-classless-r.patch |
370 | +lp2031683-sd-bus-bus_message_type_from_string-is-not-pure.patch |
371 | diff --git a/debian/systemd.postinst b/debian/systemd.postinst |
372 | index f63f02f..bced892 100644 |
373 | --- a/debian/systemd.postinst |
374 | +++ b/debian/systemd.postinst |
375 | @@ -61,19 +61,6 @@ fi |
376 | # Initial update of the Message Catalogs database |
377 | _update_catalog |
378 | |
379 | -# skip daemon-reexec and try-restarts during shutdown to avoid hitting LP: #1803391 |
380 | -if [ -n "$2" ] && [ "$(systemctl is-system-running)" != "stopping" ]; then |
381 | - _systemctl daemon-reexec || true |
382 | - # do not restart logind; this can be done again once this gets implemented: |
383 | - # https://github.com/systemd/systemd/issues/1163 |
384 | - if dpkg --compare-versions "$2" lt-nl "246.2-2~"; then |
385 | - # the socket configuration changed |
386 | - _systemctl stop systemd-networkd.socket || true |
387 | - fi |
388 | - _systemctl try-restart systemd-networkd.service || true |
389 | - _systemctl try-restart systemd-journald.service || true |
390 | -fi |
391 | - |
392 | # Process all tmpfiles that we ship, including any overrides in |
393 | # runtime-dir/sysadmin-dir/other packages (e.g. rsyslog) |
394 | # |
395 | @@ -93,8 +80,24 @@ fi |
396 | |
397 | #DEBHELPER# |
398 | |
399 | -if [ -n "$2" ]; then |
400 | - _systemctl daemon-reexec || true |
401 | +# skip daemon-reexec and try-restarts during shutdown to avoid hitting LP: #1803391 |
402 | +if [ -n "$2" ] && [ "$(systemctl is-system-running)" != "stopping" ]; then |
403 | + # LP: #2013543 - the systemd cmdline can get mangled depending on the |
404 | + # contents of /proc/cmdline, which causes systemd to fail to deserialize |
405 | + # it's previous state on daemon-reexec. This means that for upgrades from |
406 | + # affected versions, we need a reboot and cannot re-exec here, else the |
407 | + # bug could be triggered. |
408 | + if dpkg --compare-versions "$2" lt "249.11-0ubuntu3.10~" || |
409 | + dpkg --compare-versions "$2" eq "252.5-2ubuntu3"; then |
410 | + if ! grep -Fqsx systemd /run/reboot-required.pkgs; then |
411 | + echo systemd >> /run/reboot-required.pkgs || true |
412 | + fi |
413 | + |
414 | + # Reload to avoid warnings when restarting services below |
415 | + _systemctl daemon-reload || true |
416 | + else |
417 | + _systemctl daemon-reexec || true |
418 | + fi |
419 | # do not restart logind |
420 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=919509 |
421 | if dpkg --compare-versions "$2" lt-nl "246.2-2~"; then |
422 | diff --git a/debian/tests/tests-in-lxd b/debian/tests/tests-in-lxd |
423 | index b107262..d901999 100644 |
424 | --- a/debian/tests/tests-in-lxd |
425 | +++ b/debian/tests/tests-in-lxd |
426 | @@ -47,7 +47,7 @@ if [ -d ../../binaries ]; then |
427 | fi |
428 | |
429 | lxc stop systemd-lxc |
430 | -lxc publish systemd-lxc --alias $IMAGE |
431 | +lxc publish systemd-lxc --reuse --alias $IMAGE |
432 | |
433 | # Only test unprivileged LXD containers, since privileged LXD containers cause LoadCredential= (LP: #1950787), |
434 | # and other things to break. According to upstream LXD, we should not worry to much about privileged LXD |
Thanks, lgtm.
I left an inline question about the systemd.postinst cleanup. Might be unrelated, but maybe should not be dropped as part of a SRU. Also, regarding dropping of the UBUNTU- wait-online- exit-if- no-links- are-managed. patch see the GKE email that I forwarded to you... Should be fine to drop it in the Lunar SRU, IMO, but might need extra considerations for Jammy.