Merge ~enr0n/ubuntu/+source/systemd:ubuntu-focal into ~ubuntu-core-dev/ubuntu/+source/systemd:ubuntu-focal

Proposed by Nick Rosbrook
Status: Merged
Merged at revision: c2da3a5c28c68534df69dde7cc9c158732ebde86
Proposed branch: ~enr0n/ubuntu/+source/systemd:ubuntu-focal
Merge into: ~ubuntu-core-dev/ubuntu/+source/systemd:ubuntu-focal
Diff against target: 136 lines (+83/-3)
4 files modified
debian/changelog (+4/-1)
debian/patches/lp1978079-efi-pstore-not-cleared-on-boot.patch (+9/-2)
debian/patches/lp1979951-network-do-not-remove-localhost-address.patch (+69/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Lukas Märdian Approve
Review via email: mp+427304@code.launchpad.net

Description of the change

Stage some changes for upcoming SRU.

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

Thanks! LGTM.

I think we should still include fixes for LP: #1930482 in the next Focal SRU and double check if the fix for LP: #1982462 is also needed in Focal, after the lp1978079-efi-pstore-not-cleared-on-boot.patch is included.

review: Approve
Revision history for this message
Nick Rosbrook (enr0n) wrote :

Thanks for the review! I will add those LPs to my to-do list for focal.

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 a9e1aa0..3df1667 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -9,6 +9,9 @@ systemd (245.4-4ubuntu3.18) UNRELEASED; urgency=medium
6 (LP: #1966800)
7 File: debian/patches/lp1966800-shared-calendarspec-when-mktime-moves-us-backwards-jump-f.patch
8 https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=1f063541e44f6ff1a6904676d4264a2e49a09594
9+ * network: do not remove localhost address (LP: #1979951)
10+ File: debian/patches/lp1979951-network-do-not-remove-localhost-address.patch
11+ https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=87f872b8c5451f353601fb606e7fd7a479217cef
12
13 [ Mustafa Kemal Gilor ]
14 * d/p/lp1978079-efi-pstore-not-cleared-on-boot.patch: pstore: Run after
15@@ -18,7 +21,7 @@ systemd (245.4-4ubuntu3.18) UNRELEASED; urgency=medium
16 File: debian/patches/lp1978079-efi-pstore-not-cleared-on-boot.patch
17 https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=6e60756f2079d6408abdb967127a1d9b9a0eba8c
18
19- -- Lukas Märdian <slyon@ubuntu.com> Thu, 23 Jun 2022 18:01:34 +0200
20+ -- Nick Rosbrook <nick.rosbrook@canonical.com> Fri, 22 Jul 2022 15:30:27 -0400
21
22 systemd (245.4-4ubuntu3.17) focal; urgency=medium
23
24diff --git a/debian/patches/lp1978079-efi-pstore-not-cleared-on-boot.patch b/debian/patches/lp1978079-efi-pstore-not-cleared-on-boot.patch
25index 2b282d0..af6a0ca 100644
26--- a/debian/patches/lp1978079-efi-pstore-not-cleared-on-boot.patch
27+++ b/debian/patches/lp1978079-efi-pstore-not-cleared-on-boot.patch
28@@ -3,6 +3,13 @@ From: Alexander Graf <graf@amazon.com>
29 Date: Thu, 9 Jun 2022 16:20:43 +0200
30 Subject: [PATCH] pstore: Run after modules are loaded
31
32+Origin: upstream, https://github.com/systemd/systemd/commit/70e74a5997ae2ce7ba72a74ac949c3b2dad1a1d6
33+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1978079
34+Last-Updated: 2022-07-22
35+
36+The original commit has been modified to not load mtdpstore.
37+
38+---
39 The systemd-pstore service takes pstore files on boot and transfers them
40 to disk. It only does it once on boot and only if it finds any. The typical
41 location of the pstore on modern systems is the UEFI variable store.
42@@ -34,8 +41,8 @@ index 848e311e9642..86de30ad4a72 100644
43 DefaultDependencies=no
44 Conflicts=shutdown.target
45 Before=sysinit.target shutdown.target
46-+After=modprobe@efi_pstore.service modprobe@mtdpstore.service modprobe@chromeos_pstore.service modprobe@ramoops.service modprobe@pstore_zone.service modprobe@pstore_blk.service
47-+Wants=modprobe@efi_pstore.service modprobe@mtdpstore.service modprobe@chromeos_pstore.service modprobe@ramoops.service modprobe@pstore_zone.service modprobe@pstore_blk.service
48++After=modprobe@efi_pstore.service modprobe@chromeos_pstore.service modprobe@ramoops.service modprobe@pstore_zone.service modprobe@pstore_blk.service
49++Wants=modprobe@efi_pstore.service modprobe@chromeos_pstore.service modprobe@ramoops.service modprobe@pstore_zone.service modprobe@pstore_blk.service
50
51 [Service]
52 Type=oneshot
53diff --git a/debian/patches/lp1979951-network-do-not-remove-localhost-address.patch b/debian/patches/lp1979951-network-do-not-remove-localhost-address.patch
54new file mode 100644
55index 0000000..8577ef1
56--- /dev/null
57+++ b/debian/patches/lp1979951-network-do-not-remove-localhost-address.patch
58@@ -0,0 +1,69 @@
59+From: Yu Watanabe <watanabe.yu+github@gmail.com>
60+Date: Mon, 31 Jan 2022 19:26:51 +0900
61+Subject: network: do not remove localhost address
62+
63+Origin: upstream, https://github.com/systemd/systemd/commit/b69bfa43052586cd6894c32d7d3d447195539ec5
64+Bug-Ubuntu: https://launchpad.net/bugs/1979951
65+
66+The original commit was modified to apply to v245, i.e. before link_drop_foreign_addresses existed.
67+
68+---
69+Managing loopback interfaces by networkd is not recommended, but supporeted.
70+Even such spurious situation, do not drop the localhost addresses.
71+---
72+ src/basic/in-addr-util.c | 13 +++++++++++++
73+ src/basic/in-addr-util.h | 1 +
74+ src/network/networkd-link.c | 4 ++++
75+ 3 files changed, 18 insertions(+)
76+
77+diff --git a/src/basic/in-addr-util.c b/src/basic/in-addr-util.c
78+index bfe855f..e8c6f41 100644
79+--- a/src/basic/in-addr-util.c
80++++ b/src/basic/in-addr-util.c
81+@@ -92,6 +92,19 @@ int in_addr_is_localhost(int family, const union in_addr_union *u) {
82+ return -EAFNOSUPPORT;
83+ }
84+
85++int in_addr_is_localhost_one(int family, const union in_addr_union *u) {
86++ assert(u);
87++
88++ if (family == AF_INET)
89++ /* 127.0.0.1 */
90++ return be32toh(u->in.s_addr) == UINT32_C(0x7F000001);
91++
92++ if (family == AF_INET6)
93++ return IN6_IS_ADDR_LOOPBACK(&u->in6); /* lgtm [cpp/potentially-dangerous-function] */
94++
95++ return -EAFNOSUPPORT;
96++}
97++
98+ bool in4_addr_equal(const struct in_addr *a, const struct in_addr *b) {
99+ assert(a);
100+ assert(b);
101+diff --git a/src/basic/in-addr-util.h b/src/basic/in-addr-util.h
102+index ae2dad0..5a6d17a 100644
103+--- a/src/basic/in-addr-util.h
104++++ b/src/basic/in-addr-util.h
105+@@ -29,6 +29,7 @@ int in_addr_is_link_local(int family, const union in_addr_union *u);
106+
107+ bool in4_addr_is_localhost(const struct in_addr *a);
108+ int in_addr_is_localhost(int family, const union in_addr_union *u);
109++int in_addr_is_localhost_one(int family, const union in_addr_union *u);
110+
111+ bool in4_addr_is_non_local(const struct in_addr *a);
112+
113+diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
114+index 5a223c1..6f3096c 100644
115+--- a/src/network/networkd-link.c
116++++ b/src/network/networkd-link.c
117+@@ -2610,6 +2610,10 @@ static int link_drop_foreign_config(Link *link) {
118+ if (address->family == AF_INET6 && in_addr_is_link_local(AF_INET6, &address->in_addr) == 1 && link_ipv6ll_enabled(link))
119+ continue;
120+
121++ /* Do not remove localhost address (127.0.0.1 and ::1) */
122++ if (link->flags & IFF_LOOPBACK && in_addr_is_localhost_one(address->family, &address->in_addr) > 0)
123++ continue;
124++
125+ if (link_address_is_dynamic(link, address)) {
126+ if (link->network && FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_DHCP))
127+ continue;
128diff --git a/debian/patches/series b/debian/patches/series
129index 56ece03..d1d0127 100644
130--- a/debian/patches/series
131+++ b/debian/patches/series
132@@ -178,3 +178,4 @@ lp1966179-add-more-hp-dmi-to-unblock-intel-hid-event.patch
133 lp1959475-core-make-sure-we-don-t-get-confused-when-setting-TERM-fo.patch
134 lp1966800-shared-calendarspec-when-mktime-moves-us-backwards-jump-f.patch
135 lp1978079-efi-pstore-not-cleared-on-boot.patch
136+lp1979951-network-do-not-remove-localhost-address.patch

Subscribers

People subscribed via source and target branches