Zbigniew Jędrzejewski-Szmek [Mon, 28 Feb 2022 08:47:28 +0000 (09:47 +0100)]
man: recommend built-in platform.freedesktop_os_release() in our page
Python gained support for reading os-release, let's advertise it a bit more.
Our open-coded example is still useful, but let's not suggest it as the
default implementation.
I added quotes around the printed string because it looks a bit better
this way.
(cherry picked from commit
ee6fd6a50922d2b27c97084e1c3f9872d495c273)
(cherry picked from commit
d4dd289f821d29415f0057266da48f184a51bb1c)
Daan De Meyer [Fri, 25 Feb 2022 11:01:07 +0000 (11:01 +0000)]
mkosi: Remove Arch nspawn workaround
This has been fixed so the workaround can be removed.
(cherry picked from commit
6b2ab8fc5cc0f706b85cbd559e8dcf4e05d7687d)
(cherry picked from commit
f0cc6d2f99b2510c57fa36ad7f28cc42c0b724b3)
Daan De Meyer [Thu, 24 Feb 2022 13:29:54 +0000 (13:29 +0000)]
meson: Drop required libfdisk version to 2.32
We initially pinned this to 2.33 in
e71f5585b9b0580428f9530d0a485265c9c25165 because libfdisk 2.32 in
CentOS 8 didn't have
https://github.com/karelzak/util-linux/commit/
2f35c1ead621f42f32f7777232568cb03185b473
backported.
If we check now, we can see it has been backported
(https://git.centos.org/rpms/util-linux/blob/c8s/f/SOURCES/0048-libfdisk-count-gaps-to-possible-size-when-resize.patch)
which means we can drop the required version to 2.32 instead of 2.33.
(cherry picked from commit
baec7d782b07414f0c13ba3a0b0b526973e04923)
(cherry picked from commit
e517b37922df332f2c3224de15e2a094177bf864)
Peter Hutterer [Tue, 22 Feb 2022 23:12:43 +0000 (09:12 +1000)]
udev-builtin-input_id: don't label absolute mice as pointing sticks
The Getac UX10 tablet exposes a "CUST0000:00 0EEF:C002 Mouse" device
with BTN_LEFT/RIGHT and ABS_X/Y on the i2c bus. This causes the builtin
to incorrectly label it as pointing stick (all i2c mice are
tagged as ID_INPUT_POINTING_STICK, see
3d7ac1c655ec4).
Fix this by adding a separate variable for absolute pointing
devices like the VMmouse USB mouse or this Getac tablet - this way we
skip the pointing stick check.
See https://gitlab.freedesktop.org/libinput/libinput/-/issues/743
for recordings.
(cherry picked from commit
8ac9ec4d5c210825759d515422d3e66c20615fc1)
(cherry picked from commit
ea5701eb64ff40f915567ae4088ffb7efc0f4155)
Zbigniew Jędrzejewski-Szmek [Thu, 17 Feb 2022 19:34:14 +0000 (20:34 +0100)]
man: adjust command for Fedora installations
glibc now has Suggests:glibc-minimal-langpack, so we don't
need to mention it ourselves.
--repo=… is a nicer alternative to --disablerepo=* --enablerepo=….
It also avoids the issue with quoting.
Let's exclude weak deps, but install systemd-networkd, so the container
can configure networking if necessary.
(cherry picked from commit
8c4db5629c877425b2f46e414a94a8f24280a9d3)
(cherry picked from commit
c1cdb13193e6a95de2d89f8c0e080333c4110321)
Yu Watanabe [Tue, 22 Feb 2022 17:03:54 +0000 (02:03 +0900)]
journal-send: close fd on exit when running with valgrind
Fixes an issue reported in #22576.
(cherry picked from commit
eb9752d2be82d994cd6a17f271be27c4d56423d6)
(cherry picked from commit
a7ec2be1509372974f44f1d98bf243a155cd203f)
Yu Watanabe [Tue, 22 Feb 2022 16:52:29 +0000 (01:52 +0900)]
test-journal-send: close fd opend by syslog()
Fixes an issue reported in #22576.
(cherry picked from commit
9048a6ccf3bd4f6794fc1ac9a838e1a0bfbcabf1)
(cherry picked from commit
4d24a369908f9915757632fa196deda14c172f9e)
Yu Watanabe [Tue, 22 Feb 2022 16:29:42 +0000 (01:29 +0900)]
unit: escape %
Fixes #22601.
(cherry picked from commit
6e4d122ad1db11ca898de183f898f731c4839d4a)
(cherry picked from commit
02bebaef30bcb155c508a341b47ee5bcbb432bea)
Lennart Poettering [Tue, 22 Feb 2022 15:51:58 +0000 (16:51 +0100)]
clang-format: we actually typically use 16ch continuation indentation
We use 8 for blocks, and 16 for continuation in most cases afaics, hence
say so in .clang-format too
(cherry picked from commit
92148fb77766767fdb6ad6e52747317dae2aae85)
(cherry picked from commit
4a90c12f4f09f23e071e649422754f04eda6d273)
Yu Watanabe [Tue, 22 Feb 2022 12:46:41 +0000 (21:46 +0900)]
test: fix file descriptor leak in test-psi-util
Fixes an issue reported in #22576.
(cherry picked from commit
be99883e131ef422f8278ec1d099520996a78bb0)
(cherry picked from commit
81d3e2abff5f4234e06ceb6590d0c9939d8d97b4)
Yu Watanabe [Tue, 22 Feb 2022 12:44:58 +0000 (21:44 +0900)]
test: fix file descriptor leak in test-tmpfiles.c
Also fixes a typo in assertion.
Fixes an issure reported in #22576.
(cherry picked from commit
1da5325d19dee654326e5fa2f61262e5e0a40fff)
(cherry picked from commit
d9189c31117e159f7bae9233863aa88a02159e14)
Yu Watanabe [Tue, 22 Feb 2022 12:42:22 +0000 (21:42 +0900)]
test: fix file descriptor leak in test-fs-util
Fixes an issue reported in #22576.
(cherry picked from commit
19962747ca86a25e7102c536380bb2e9d7cfee9a)
(cherry picked from commit
cfe1cd0a066b29e5508b4a2c388fd919fd5e0c9f)
Yu Watanabe [Tue, 22 Feb 2022 12:38:15 +0000 (21:38 +0900)]
test: fix file descriptor leak in test-oomd-util
Fixes an issue reported in #22576.
(cherry picked from commit
282696ce52471f5e3c963b9d98dbc89fba3a1fba)
(cherry picked from commit
55ec995341e6a2d554bc69a1eddb097d21d8084f)
Yu Watanabe [Tue, 22 Feb 2022 12:11:51 +0000 (21:11 +0900)]
test: fix file descriptor leak in test-catalog
Fixes an issue reported in #22576.
(cherry picked from commit
62d4b3b36e9aba9e605ba042a75c374155b6e18b)
(cherry picked from commit
92b86911c0c877e6b61d06dfe3ad20046e10d8e8)
Yu Watanabe [Tue, 22 Feb 2022 11:23:58 +0000 (20:23 +0900)]
test-oomd-util: fix conditional jump on uninitialised value
Fixes #22577.
(cherry picked from commit
a6d6a51d83fae32212e1780e71b16517a4df9a57)
(cherry picked from commit
b10cc2de7dc6ac8d7d72d576100dd3a37ddb588a)
Yu Watanabe [Tue, 22 Feb 2022 11:21:45 +0000 (20:21 +0900)]
test-oomd-util: style fixlets
(cherry picked from commit
d9fe39b24a0a5464c83c7a754752ca21dbd2578f)
(cherry picked from commit
1343c2efd5401aa52f7790fff4ad7e2d70173f01)
Franck Bui [Fri, 18 Feb 2022 09:06:24 +0000 (10:06 +0100)]
core: really skip automatic restart when a JOB_STOP job is pending
It's not clear why we rescheduled a service auto restart while a stop job for
the unit was pending. The comment claims that the unit shouldn't be restarted
but the code did reschedule an auto restart meanwhile.
In practice that was rarely an issue because the service waited for the next
auto restart to be rescheduled, letting the queued stop job to be proceed and
service_stop() to be called preventing the next restart to complete.
However when RestartSec=0, the timer expired right away making PID1 to
reschedule the unit again, making the timer expired right away... and so
on. This busy loop prevented PID1 to handle any queued jobs (and hence giving
no chance to the start rate limiting to trigger), which made the busy loop last
forever.
This patch breaks this loop by skipping the reschedule of the unit auto restart
and hence not depending on the value of u->restart_usec anymore.
Fixes: #13667
(cherry picked from commit
c972880640ee19e89ce9265d8eae1b3aae190332)
(cherry picked from commit
2198c08d0786c5cec1b39283831969b2cc1adf40)
Frantisek Sumsal [Fri, 18 Feb 2022 22:09:18 +0000 (23:09 +0100)]
systemctl: make `--timestamp=` affect the `show` verb as well
Currently the `--timestamp=` option has no effect on timestamps shown by
`systemctl show`, let's fix that.
Spotted in #22567.
Before:
```
$ systemctl show --timestamp=us+utc systemd-journald | grep Timestamp=
ExecMainStartTimestamp=Sat 2021-12-11 15:25:57 CET
StateChangeTimestamp=Sat 2021-12-11 15:25:57 CET
InactiveExitTimestamp=Sat 2021-12-11 15:25:57 CET
ActiveEnterTimestamp=Sat 2021-12-11 15:25:57 CET
ActiveExitTimestamp=Sat 2021-12-11 15:25:57 CET
InactiveEnterTimestamp=Sat 2021-12-11 15:25:57 CET
ConditionTimestamp=Sat 2021-12-11 15:25:57 CET
AssertTimestamp=Sat 2021-12-11 15:25:57 CET
```
After:
```
$ systemctl show --timestamp=us+utc systemd-journald | grep Timestamp=
ExecMainStartTimestamp=Sat 2021-12-11 14:25:57.177848 UTC
StateChangeTimestamp=Sat 2021-12-11 14:25:57.196714 UTC
InactiveExitTimestamp=Sat 2021-12-11 14:25:57.177871 UTC
ActiveEnterTimestamp=Sat 2021-12-11 14:25:57.196714 UTC
ActiveExitTimestamp=Sat 2021-12-11 14:25:57.144677 UTC
InactiveEnterTimestamp=Sat 2021-12-11 14:25:57.176331 UTC
ConditionTimestamp=Sat 2021-12-11 14:25:57.176980 UTC
AssertTimestamp=Sat 2021-12-11 14:25:57.176980 UTC
```
(cherry picked from commit
a59e5c625da5a6e0c46e493d55f2f4212e9457ca)
(cherry picked from commit
e59c381e2321ae9e476c550d5a3d43a1fd0493ac)
Lennart Poettering [Thu, 17 Feb 2022 13:49:54 +0000 (14:49 +0100)]
pid1: set SYSTEMD_NSS_DYNAMIC_BYPASS=1 env var for dbus-daemon
There's currently a deadlock between PID 1 and dbus-daemon: in some
cases dbus-daemon will do NSS lookups (which are blocking) at the same
time PID 1 synchronously blocks on some call to dbus-daemon. Let's break
that by setting SYSTEMD_NSS_DYNAMIC_BYPASS=1 env var for dbus-daemon,
which will disable synchronously blocking varlink calls from nss-systemd
to PID 1.
In the long run we should fix this differently: remove all synchronous
calls to dbus-daemon from PID 1. This is not trivial however: so far we
had the rule that synchronous calls from PID 1 to the dbus broker are OK
as long as they only go to interfaces implemented by the broke itself
rather than services reachable through it. Given that the relationship
between PID 1 and dbus is kinda special anyway, this was considered
acceptable for the sake of simplicity, since we quite often need
metadata about bus peers from the broker, and the asynchronous logic
would substantially complicate even the simplest method handlers.
This mostly reworks the existing code that sets SYSTEMD_NSS_BYPASS_BUS=
(which is a similar hack to deal with deadlocks between nss-systemd and
dbus-daemon itself) to set SYSTEMD_NSS_DYNAMIC_BYPASS=1 instead. No code
was checking SYSTEMD_NSS_BYPASS_BUS= anymore anyway, and it used to
solve a similar problem, hence it's an obvious piece of code to rework
like this.
Issue originally tracked down by Lukas Märdian. This patch is inspired
and closely based on his patch:
https://github.com/systemd/systemd/pull/22038
Fixes: #15316
Co-authored-by: Lukas Märdian <slyon@ubuntu.com>
(cherry picked from commit
de90700f36f2126528f7ce92df0b5b5d5e277558)
(cherry picked from commit
367041af816d48d4852140f98fd0ba78ed83f9e4)
Lennart Poettering [Thu, 17 Feb 2022 13:47:34 +0000 (14:47 +0100)]
docs: $SYSTEMD_NSS_BYPASS_BUS is not honoured anymore, don't document it
It was removed back in
1684c56f40f020e685e70b3d1785d596ff16f892
Follow-up for:
1684c56f40f020e685e70b3d1785d596ff16f892
(cherry picked from commit
cec16155e3dab4f123ba073223477a4ef2cf10f9)
(cherry picked from commit
4ec9aec4b695e1f0a26dc9cd55719c2f91ebdd6a)
Lennart Poettering [Thu, 17 Feb 2022 13:40:25 +0000 (14:40 +0100)]
pid1: lookup owning PID of BusName= name of services asynchronously
A first step of removing blocking calls to the D-Bus broker from PID 1.
There's a lot more to got (i.e. grep src/core/ for sd_bus_creds
basically), but it's a start.
Removing blocking calls to D-Bus broker deals systematicallly with
deadlocks caused by dbus-daemon blocking on synchronous IPC calls back
to PID1 (e.g. Varlink calls through nss-systemd). Bugs such as #15316.
Also-see: https://github.com/systemd/systemd/pull/22038#issuecomment-
1042958390
(cherry picked from commit
e39eb045a502d599e6cd3fda7a46020dd438d018)
(cherry picked from commit
cf390149cb25248169c482e315a1a7ff02eaf956)
Lennart Poettering [Thu, 17 Feb 2022 16:23:48 +0000 (17:23 +0100)]
pid1: watch bus name always when we have it
Previously we'd only watch configured service bus names if Type=dbus was
set. Let's also watch it for other types. This is useful to pick up the
main PID of such a service. In fact the code to pick it up was already
in place, alas it didn't do anything given the signal was never received
for it. Fix that.
(It's also useful for debugging)
(cherry picked from commit
1e8b312e5a22538f91defb89cf2997e09e106297)
(cherry picked from commit
a51e540b278827c0fc59760b9c77cd42cbddc0d2)
Yu Watanabe [Fri, 4 Feb 2022 03:05:33 +0000 (12:05 +0900)]
resolve: synthesize empty domain only when A and/or AAAA key is requested
Follow-up for
3b2ac14ac45bef01cf489c3231b868936866444b (#22231).
Before this commit.
---
$ dig -t SRV '.'
; <<>> DiG 9.16.24-RH <<>> -t SRV .
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16836
;; flags: qr aa rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;. IN SRV
;; Query time: 1 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Fri Feb 04 12:01:09 JST 2022
;; MSG SIZE rcvd: 28
---
After this commit.
---
$ dig -t SRV '.'
; <<>> DiG 9.16.24-RH <<>> -t SRV .
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19861
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;. IN SRV
;; AUTHORITY SECTION:
. 86394 IN SOA a.root-servers.net. nstld.verisign-grs.com.
2022020302 1800 900 604800 86400
;; Query time: 20 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Fri Feb 04 12:00:12 JST 2022
;; MSG SIZE rcvd: 103
---
Fixes #22401.
(cherry picked from commit
30fa3aa1fa56d9a1a4f3a26c0bc02253d44dfa0f)
(cherry picked from commit
d57147ef5698c50e02e5e74df8d0936230032cfe)
Yu Watanabe [Tue, 22 Feb 2022 22:50:30 +0000 (07:50 +0900)]
resolve: make dns_scope_good_domain() take DnsQuery*
(cherry picked from commit
176a9a2cca47f7c1553d96f7dd51c2193a269dbc)
(cherry picked from commit
54ab65f5f3da22985126dc3ae846a777d6b555a9)
Yu Watanabe [Tue, 22 Feb 2022 22:49:40 +0000 (07:49 +0900)]
resolve: drop never matched condition
As dns_scope_good_domain() does not return negative errno.
(cherry picked from commit
830f50ab1e03fa7ee262876ed42023d10e89688d)
(cherry picked from commit
499115dbc3408f9a85160099e114bbaf0bacfe84)
Yu Watanabe [Sun, 23 Jan 2022 21:36:53 +0000 (06:36 +0900)]
resolve: synthesize null address, IPv4 broadcast address, or invalid domain
These are filtered in `dns_scope_good_domain()`, but not synthesized.
Fixes #22229.
(cherry picked from commit
46b53e8035fb60c9a7f26dd32d6689ab3b7da97c)
(cherry picked from commit
89b439ee00e3fbee47cda3f790cbf320538cae7f)
Yu Watanabe [Sun, 23 Jan 2022 21:07:33 +0000 (06:07 +0900)]
resolve: synthesize empty name
Do not return any error for empty name. Just returns empty answer.
Before:
---
$ dig .
; <<>> DiG 9.16.24-RH <<>> .
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 13617
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;. IN A
;; Query time: 0 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Mon Jan 24 05:49:30 JST 2022
;; MSG SIZE rcvd: 28
---
After:
---
$ dig .
; <<>> DiG 9.16.24-RH <<>> .
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7957
;; flags: qr aa rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;. IN A
;; Query time: 1 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Mon Jan 24 06:05:02 JST 2022
;; MSG SIZE rcvd: 28
---
Replaces #22197.
Fixes RHBZ#
2039854 (https://bugzilla.redhat.com/show_bug.cgi?id=
2039854).
(cherry picked from commit
3b2ac14ac45bef01cf489c3231b868936866444b)
(cherry picked from commit
0fd3ccca64402eaec9535d0288d888f7fcacb9b8)
Yu Watanabe [Sun, 23 Jan 2022 21:06:55 +0000 (06:06 +0900)]
dns-domain: re-introduce dns_name_is_empty()
(cherry picked from commit
7bdf41983044268b4bc2f9d34462db7f89ba284a)
(cherry picked from commit
df08c12062dfd9903edec371598412a47a3055e0)
Frantisek Sumsal [Thu, 17 Feb 2022 13:02:04 +0000 (14:02 +0100)]
packit: drop unnumbered patches as well
(cherry picked from commit
729c6b6af8e3cef259b80746f7f7f10cc63d309f)
(cherry picked from commit
477b85f43871c78fce053ebbd9592bf71d49dd30)
Yu Watanabe [Thu, 27 Jan 2022 17:14:47 +0000 (02:14 +0900)]
sd-dhcp-server: rename server_send_nak() -> server_send_nak_or_ignore()
And logs error in the function.
(cherry picked from commit
eb5bff9c9de2bd218f5ac431e3aead4b5747ecd9)
(cherry picked from commit
7f36fb25d5c6681dbabb067a9fb083bfad37a804)
Frantisek Sumsal [Wed, 15 Sep 2021 08:56:21 +0000 (10:56 +0200)]
tree-wide: mark set-but-not-used variables as unused to make LLVM happy
LLVM 13 introduced `-Wunused-but-set-variable` diagnostic flag, which
trips over some intentionally set-but-not-used variables or variables
attached to cleanup handlers with side effects (`_cleanup_umask_`,
`_cleanup_(notify_on_cleanup)`, `_cleanup_(restore_sigsetp)`, etc.):
```
../src/basic/process-util.c:1257:46: error: variable 'saved_ssp' set but not used [-Werror,-Wunused-but-set-variable]
_cleanup_(restore_sigsetp) sigset_t *saved_ssp = NULL;
^
1 error generated.
```
(cherry picked from commit
d7ac09520be8f0d3d94df3dd4fd8a6e7404c0174)
Frantisek Sumsal [Tue, 22 Feb 2022 13:43:40 +0000 (14:43 +0100)]
ci: fix clang-13 installation
For some reason Ubuntu Focal repositories now have `llvm-13` virtual
package which can't be installed, but successfully fools our check,
resulting in no clang/llvm being installed...
```
$ apt show llvm-13
Package: llvm-13
State: not a real package (virtual)
N: Can't select candidate version from package llvm-13 as it has no candidate
N: Can't select versions from package 'llvm-13' as it is purely virtual
N: No packages found
$ apt install --dry-run llvm-13
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package llvm-13 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'llvm-13' has no installation candidate
```
(cherry picked from commit
b491d74064f9d5e17a71b38b014434237169a077)
(cherry picked from commit
fa6e263273905cfc9e4528e8175ace3d19d881e3)
Evgeny Vereshchagin [Sun, 26 Dec 2021 01:11:00 +0000 (01:11 +0000)]
ci: replace apt-key with signed-by
to limit the scope of the key to apt.llvm.org only.
This is mostly inspired by https://blog.cloudflare.com/dont-use-apt-key/
(cherry picked from commit
bfa6bd1be098adc4710e1819b9cd34d65b3855da)
(cherry picked from commit
c92297a20c13b7e15b0026b1f36ebe99d86cfce8)
Yu Watanabe [Fri, 11 Feb 2022 00:43:16 +0000 (09:43 +0900)]
resolve: add reference of the original bus message to the aux queries
Otherwise, the error in aux queries cannot be replied.
Fixes #22477.
(cherry picked from commit
08275791d85a1852e79951212f6cbbc727db789a)
(cherry picked from commit
919d398668d2baa1873e61f7f502fac910a9d606)
Yu Watanabe [Fri, 11 Feb 2022 00:49:13 +0000 (09:49 +0900)]
resolve: refuse AF_UNSPEC when resolving address
Fixes #22480.
(cherry picked from commit
0234f0c0531682e7f28a4ef51852c102c6e97267)
(cherry picked from commit
084c88983eaecbf23e113db5a7ee11f94b60472b)
Frantisek Sumsal [Mon, 11 Oct 2021 19:12:42 +0000 (21:12 +0200)]
ci: use the system llvm-11 package on Focal
ATTOW llvm-11 got into focal-updates, which conflicts with llvm-11
provided by the apt.llvm.org repositories. Let's use the system
llvm package if available in such cases to avoid that.
(cherry picked from commit
1c71302f70c7d0712d49b5214f5f29b4d6a2c73e)
Luca Boccassi [Tue, 15 Feb 2022 01:21:01 +0000 (01:21 +0000)]
packit: build on and use Fedora 35 spec file
It's targeted to the v249 branch, while the rawhide one follows
the newest upstream release, and the command line options are not
compatible
Luca Boccassi [Tue, 15 Feb 2022 10:21:49 +0000 (10:21 +0000)]
Partially revert "sd-dhcp-server: refuse too large packet to send"
This test fails on this branch:
949/1228 fuzz-dhcp-server-relay-message_clusterfuzz-testcase-minimized-fuzz-dhcp-server-relay-message-4972399731277824_address,undefined FAIL 0.00s (exit status 127)12:43
--- command ---12:43
01:47:36 UBSAN_OPTIONS='print_stacktrace=1:print_summary=1:halt_on_error=1' /usr/bin/env /tmp/autopkgtest-lxc.cl7c6fs0/downtmp/build.X6Z/src/build-deb/fuzz-dhcp-server-relay-message:address,undefined /tmp/autopkgtest-lxc.cl7c6fs0/downtmp/build.X6Z/src/test/fuzz/fuzz-dhcp-server-relay-message/clusterfuzz-testcase-minimized-fuzz-dhcp-server-relay-message-
497239973127782412:43
--- stderr ---12:43
/usr/bin/env: ‘/tmp/autopkgtest-lxc.cl7c6fs0/downtmp/build.X6Z/src/build-deb/fuzz-dhcp-server-relay-message:address,undefined’: No such file or directory
This partially reverts commit
76bcd1d6d26ebe0424e2c5edc7f5a31a82ae3a7c.
(cherry picked from commit
e69b2a3a69d472e887633162111ed2a45f317eb9)
Luca Boccassi [Tue, 15 Feb 2022 10:20:34 +0000 (10:20 +0000)]
Revert "tests: add a file triggering a memory leak in dhcp_lease_parse_search_domains"
The test fails on this branch:
948/1228 fuzz-dhcp-client_minimized-from-555a2b073b8d208655b68c294f8dfd592a11e50a_address,undefined FAIL 0.00s (exit status 127)12:43
--- command ---12:43
01:47:36 UBSAN_OPTIONS='print_stacktrace=1:print_summary=1:halt_on_error=1' /usr/bin/env /tmp/autopkgtest-lxc.cl7c6fs0/downtmp/build.X6Z/src/build-deb/fuzz-dhcp-client:address,undefined /tmp/autopkgtest-lxc.cl7c6fs0/downtmp/build.X6Z/src/test/fuzz/fuzz-dhcp-client/minimized-from-
555a2b073b8d208655b68c294f8dfd592a11e50a12:43
--- stderr ---12:43
/usr/bin/env: ‘/tmp/autopkgtest-lxc.cl7c6fs0/downtmp/build.X6Z/src/build-deb/fuzz-dhcp-client:address,undefined’: No such file or directory
This reverts commit
87728a590ad82391e76a275024c9039625ff2b67.
(cherry picked from commit
2614461383b344041b397870fb3662c79f2a7b75)
Zbigniew Jędrzejewski-Szmek [Sat, 15 Jan 2022 12:38:30 +0000 (13:38 +0100)]
sd-device: silence gcc warning with newest gcc
(cherry picked from commit
376ee2c312b87951028a0adff96b1052f32475fa)
(cherry picked from commit
18aff8c85720606e05826045b6799d19a7dcf08a)
Luca Boccassi [Tue, 15 Feb 2022 01:21:01 +0000 (01:21 +0000)]
packit: remove unsupported -Dcryptolib=openssl option
Introduced later, so it breaks the build on v249-stable
Zbigniew Jędrzejewski-Szmek [Wed, 7 Jul 2021 16:02:50 +0000 (18:02 +0200)]
sd-bus: allow numerical uids in -M user@.host
UIDs don't work well over ssh, but locally or with containers they are OK.
In particular, user@.service uses UIDs as identifiers, and it's nice to be
able to copy&paste that UID for interaction with the user's managers.
(cherry picked from commit
2da7d0bc92e2423a5c7225c5d24b99d5d52a0bc6)
Zbigniew Jędrzejewski-Szmek [Wed, 7 Jul 2021 16:01:03 +0000 (18:01 +0200)]
sd-bus: print debugging information if bus_container_connect_socket() fails
We would return the errno, but there are many steps, and without some
debugging info it's hard to figure out what exactly failed.
(cherry picked from commit
0c201ca945c64e97ba4961ded13ce38a63200468)
Zbigniew Jędrzejewski-Szmek [Wed, 7 Jul 2021 14:36:49 +0000 (16:36 +0200)]
sd-bus: print quoted commandline when in bus_socket_exec()
The arguments are where the interesting part is:
src/libsystemd/sd-bus/bus-socket.c:965: sd-bus: starting bus with systemd-run...
↓
src/libsystemd/sd-bus/bus-socket.c:972: sd-bus: starting bus with systemd-run -M.host -PGq --wait -pUser=1000 -pPAMName=login systemd-stdio-bridge "-punix:path=\${XDG_RUNTIME_DIR}/bus"
(cherry picked from commit
87fa2e21dd7a30d25ccda2df6b8446a82637b059)
Zbigniew Jędrzejewski-Szmek [Wed, 7 Jul 2021 14:28:19 +0000 (16:28 +0200)]
core: use the new quoting helper
(cherry picked from commit
8a62620ebe23945021075df7e1b0759102c286ae)
Zbigniew Jędrzejewski-Szmek [Wed, 7 Jul 2021 14:27:51 +0000 (16:27 +0200)]
basic/escape: add helper for quoting command lines
(cherry picked from commit
eeb91d29b0279d6bf8a3f1c4da54c9e9c0881a19)
Yu Watanabe [Thu, 10 Feb 2022 09:04:34 +0000 (18:04 +0900)]
test-network: add missing tests for bridge properties
(cherry picked from commit
b6d5dab7bbb8ecf4ce1229840085daa15ab4cf57)
(cherry picked from commit
ab30fe12edf4b859d38f4c5726b3eaa71aa5b3f7)
Yu Watanabe [Thu, 10 Feb 2022 08:47:14 +0000 (17:47 +0900)]
network: bridge: fix endian of vlan protocol
Fixes #22469.
(cherry picked from commit
6eb35be8e0fa5f1f00dddd558cf4dc3642d9e53e)
(cherry picked from commit
514a4c051ce6cceaa5417a2044e708bd5105131d)
Yu Watanabe [Sat, 5 Feb 2022 13:04:42 +0000 (22:04 +0900)]
resolve: use _cleanup_ attribute for freeing DnsQuery
(cherry picked from commit
c704288c473fa08820566fdb16c38726d24db026)
(cherry picked from commit
0533d1aab61b6a797d07c4c861acf5e87f8191e8)
Yu Watanabe [Sat, 5 Feb 2022 13:03:19 +0000 (22:03 +0900)]
resolve: fix possible memleak
Fortunately, unlike the issue fixed in the previous commit, the memleak
should be superficial and not become apparent, as the queries handled
here are managed by the stub stream, and will be freed when the stream
is closed.
Just for safety, and slightly reducing the runtime memory usage by the
stub stream.
(cherry picked from commit
fe8c5ce615ee2123f17b1f0b3728c439e19e4b5b)
(cherry picked from commit
4dbc210124b4303ecadb6cdb28a4a4c821e1150b)
Yu Watanabe [Sat, 5 Feb 2022 12:37:01 +0000 (21:37 +0900)]
resolve: fix potential memleak and use-after-free
When stub stream is closed early, then queries associated to the stream
are freed. Previously, the timer event source for queries may not be
disabled, hence may be triggered with already freed query.
See also dns_stub_stream_complete().
Note that we usually not set NULL or zero when freeing simple objects.
But, here DnsQuery is large and complicated object, and the element may
be referenced in subsequent freeing process in the future. Hence, for
safety, let's set NULL to the pointer.
(cherry picked from commit
73bfd7be042cc63e7649242b377ad494bf74ea4b)
(cherry picked from commit
d82bd80cf4e7659906a502735b20a45964b55a88)
Lennart Poettering [Tue, 1 Feb 2022 11:06:21 +0000 (12:06 +0100)]
util: another set of CVE-2021-4034 assert()s
It's a good idea that we validate argc/argv when we are supposed to
store them away.
(cherry picked from commit
007e03b284e8ffc0b92edb2122cd9d2d16f049ef)
(cherry picked from commit
dcba78244e5dc3a4b57fb978a2d21640164c89a2)
Luca Boccassi [Thu, 27 Jan 2022 14:08:05 +0000 (14:08 +0000)]
test: use mksquashfs -noappend
Makes the setup idempotent, as mksquashfs by default attempts to
append to an existing image
(cherry picked from commit
392d46d7a8f78169ff6b0d2740f82924e6fdc878)
(cherry picked from commit
44c4116557389ad86d5d204e290f8f2c57b7f009)
Yu Watanabe [Wed, 2 Feb 2022 05:05:45 +0000 (14:05 +0900)]
core/mount: fail early if directory cannot be created
Prompted by #22334.
(cherry picked from commit
e4de58c8231e47509ffeb3aa47620ca42f22d7f6)
(cherry picked from commit
1d7e0b68048ba0760f8fdf6a26c7a5017ac38569)
Lennart Poettering [Tue, 1 Feb 2022 17:11:04 +0000 (18:11 +0100)]
units: we need systemd-journald.service from systemd-journal-flush.service
This is a follow-up for
d5ee050ffc9d413253932d9340ade8c8fb111092, and
reintroduces a requirement dep from systemd-journal-flush.service onto
systemd-journald.service, but a weaker one than originally: a Wants= one
instead of a Requires= one.
Why? Simply because the service issues an IPC call to the journald,
hence it should pull it in. (Note that socket activation doesn't happen
for the Varlink socket it uses, hence we should pull in the service
itself.)
(cherry picked from commit
23b1e8d087c9e8c5a2cdcc6a91510a4e7ca8f72f)
(cherry picked from commit
9793254248a51bd2d19399bacb314e541cf2a4a0)
Yu Watanabe [Sun, 30 Jan 2022 20:19:09 +0000 (05:19 +0900)]
sd-dhcp-lease: fix memleak
Fixes https://github.com/systemd/systemd/pull/22294#issuecomment-
1024840811.
(cherry picked from commit
06cf04dff4dd6c69e527913ad137616c23861270)
(cherry picked from commit
ae95ca27bee2bef5bf53002873a254f1a0fe8b81)
Yu Watanabe [Tue, 1 Feb 2022 04:26:40 +0000 (13:26 +0900)]
test-network: set xfrm interface ID
This also unifies two tests for xfrm, and checks the output of
'ip link' command.
Fixes #22329.
(cherry picked from commit
020483b248b45b15eb93d2ae322d7f211c61e44d)
(cherry picked from commit
a5fc827b3a775f8553c95381ed49649beb86c5ea)
Yu Watanabe [Tue, 1 Feb 2022 04:00:51 +0000 (13:00 +0900)]
network: xfrm: refuse zero interface ID
Since kernel 5.17-rc1, 5.16.3, and 5.15.17 (more specifically,
https://github.com/torvalds/linux/commit/
8dce43919566f06e865f7e8949f5c10d8c2493f5)
the kernel refuses to create an xfrm interface with zero ID.
(cherry picked from commit
fd11005951920a0cee96f0c56f36d9ff8bc66a41)
(cherry picked from commit
1ef56ad928df3a8fb45b9dcdf3950035a6f699b7)
Conflicts:
src/network/netdev/xfrm.c
Lennart Poettering [Tue, 1 Feb 2022 12:50:28 +0000 (13:50 +0100)]
execute: document that the 'env' param is input *and* output
(cherry picked from commit
421bb42d1b366c00392ef5bbab6a67412295b6dc)
(cherry picked from commit
c4357f31da66b1917d3612d02c28adb300d4b0c6)
Lennart Poettering [Tue, 1 Feb 2022 12:50:13 +0000 (13:50 +0100)]
execute: line break comments a bit less aggressively
(cherry picked from commit
cafc5ca147cb05b90bd731661d8594c299601f79)
(cherry picked from commit
14567dc93d5c498bfaadd28478f59952f6da320c)
Lennart Poettering [Tue, 1 Feb 2022 12:49:56 +0000 (13:49 +0100)]
execute: use _cleanup_ logic where appropriate
(cherry picked from commit
46e5bbab5895b7137b03453dee08bd1c89c710e9)
(cherry picked from commit
9b2954b79435eaf54be208acdce8026b83bdc249)
Lennart Poettering [Tue, 1 Feb 2022 11:37:51 +0000 (12:37 +0100)]
pid1: pass PAM_DATA_SILENT to pam_end() in child
Fixes: #22318
(cherry picked from commit
7feb2b5737ad110eb3985e8e9d8189f18d1c5147)
(cherry picked from commit
9c560d201527ee064ae11784d6538ae544926181)
Yu Watanabe [Sat, 29 Jan 2022 20:38:35 +0000 (05:38 +0900)]
login: use bus_error_message() at one more place
(cherry picked from commit
80c8c786a314bceba180fac5506e72aa48c0764a)
(cherry picked from commit
048487c094a149e99b4067c8cd2d3974a8f17397)
Yu Watanabe [Sat, 29 Jan 2022 20:38:01 +0000 (05:38 +0900)]
core/unit: use bus_error_message() at one more place
(cherry picked from commit
33322185554799b08e94aca036dd109aaee52408)
(cherry picked from commit
81e59411161078f4f90d80e2e111755adc16db33)
Yu Watanabe [Sat, 29 Jan 2022 20:36:56 +0000 (05:36 +0900)]
bus-util: retrieve bus error from message
The error in argument is not input, but used for output.
(cherry picked from commit
853b94863cf26d084454edd63ce987cc7ab0505a)
(cherry picked from commit
b9e144629bdb7c3d4535fb0a0ad8639140a25034)
Luca Boccassi [Fri, 28 Jan 2022 22:56:10 +0000 (22:56 +0000)]
core: don't fail on EEXIST when creating mount point
systemd[1016]: Failed to mount /tmp/app1 (type n/a) on /run/systemd/unit-extensions/1 (MS_BIND ): No such file or directory
systemd[1016]: Failed to create destination mount point node '/run/systemd/unit-extensions/1': File exists
(cherry picked from commit
9d6d4c305ab8d65aab7f546450d7331f760b7259)
(cherry picked from commit
ae8bc570a81e1286eb5b59a77ef179a500b95f9d)
Evgeny Vereshchagin [Sat, 29 Jan 2022 03:16:40 +0000 (03:16 +0000)]
sd-dhcp-lease: fix a memory leak in dhcp_lease_parse_search_domains
=================================================================
==81071==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 16 byte(s) in 1 object(s) allocated from:
#0 0x51245c in __interceptor_reallocarray (/home/vagrant/systemd/build/fuzz-dhcp-client+0x51245c)
#1 0x7f01440c67e6 in strv_push /home/vagrant/systemd/build/../src/basic/strv.c:435:13
#2 0x7f01440ca9e1 in strv_consume /home/vagrant/systemd/build/../src/basic/strv.c:506:13
#3 0x7f01440ca9e1 in strv_extend /home/vagrant/systemd/build/../src/basic/strv.c:558:16
#4 0x5806e3 in dhcp_lease_parse_search_domains /home/vagrant/systemd/build/../src/libsystemd-network/sd-dhcp-lease.c:900:21
#5 0x57c1be in dhcp_lease_parse_options /home/vagrant/systemd/build/../src/libsystemd-network/sd-dhcp-lease.c:727:21
#6 0x572450 in parse_options /home/vagrant/systemd/build/../src/libsystemd-network/dhcp-option.c:348:33
#7 0x571c6a in dhcp_option_parse /home/vagrant/systemd/build/../src/libsystemd-network/dhcp-option.c:376:13
#8 0x559a01 in client_handle_offer /home/vagrant/systemd/build/../src/libsystemd-network/sd-dhcp-client.c:1543:13
#9 0x5592bd in LLVMFuzzerTestOneInput /home/vagrant/systemd/build/../src/libsystemd-network/fuzz-dhcp-client.c:74:16
#10 0x44a379 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) (/home/vagrant/systemd/build/fuzz-dhcp-client+0x44a379)
#11 0x42ae1f in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) (/home/vagrant/systemd/build/fuzz-dhcp-client+0x42ae1f)
#12 0x432ade in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) (/home/vagrant/systemd/build/fuzz-dhcp-client+0x432ade)
#13 0x421f86 in main (/home/vagrant/systemd/build/fuzz-dhcp-client+0x421f86)
#14 0x7f0142fff55f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f)
(cherry picked from commit
9591c0a8b3496d0e5cbbfe7c75161ba80089c143)
(cherry picked from commit
7dc0f80588f371a62a56a75bf27eab2c515becf3)
Evgeny Vereshchagin [Sat, 29 Jan 2022 03:18:31 +0000 (03:18 +0000)]
tests: add a file triggering a memory leak in dhcp_lease_parse_search_domains
(cherry picked from commit
998ec39b1d20a40453a3b47f7eb68feacefd65d9)
(cherry picked from commit
ba335f6f40b58ea4050471a5051ceacfbff71f08)
Evgeny Vereshchagin [Sat, 29 Jan 2022 02:08:39 +0000 (02:08 +0000)]
sd-dhcp-lease: fix an infinite loop found by the fuzzer
(cherry picked from commit
86b06c666be8b7afb45541d35aa4d0ecb38056d1)
(cherry picked from commit
426807c54b9500b806eaaf50d32c7c936510706c)
Donald Chan [Fri, 28 Jan 2022 22:53:46 +0000 (22:53 +0000)]
basic: mac_[selinux,smack]_apply_fd does not work when applying labels
Commit
a7fdc6c introduced a regression where file descriptors are opened
using O_PATH option. mac_smack_apply_fd() calls fsetxattr() and would fail
with a -EBADF (Bad file descriptor) error.
Use FORMAT_PROC_FD_PATH(fd) to convert the fd back into a full path and
call setxattr() or setfilecon() instead.
Signed-off-by: Donald Chan <hoiho@amazon.com>
(cherry picked from commit
a718364e9d9242cc2111c9860f2ab5bb9bb26db9)
(cherry picked from commit
9f596964f6e403b089450dc083724b48fb4b4bb1)
Yu Watanabe [Fri, 28 Jan 2022 02:53:49 +0000 (11:53 +0900)]
sd-dhcp-server: refuse too large packet to send
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=44134.
(cherry picked from commit
71df50a9734f7006bc1ac8be59ca81c797b39c35)
(cherry picked from commit
530a18d49361ade6d3f09abb78f8f901753a4cda)
Arfrever Frehtes Taifersar Arahesis [Thu, 27 Jan 2022 00:00:00 +0000 (00:00 +0000)]
logind.conf: Fix name of option: RuntimeDirectoryInodes -> RuntimeDirectoryInodesMax
(cherry picked from commit
a42a93830fcc18da073a5ac06f93c386efc9109d)
(cherry picked from commit
5b20a2b19c847b8ad8b354f1b735fbbaf88d2f8f)
Christian Brauner [Mon, 24 Jan 2022 09:12:57 +0000 (10:12 +0100)]
core/namespace: s/normalize_mounts()/drop_unused_mounts()
Rename the normalize_mounts() helper to drop_unused_mounts. All the
helpers called in there get rid of mounts that are unused for a variety
of reasons. And whereas the helpers are aptly prefixed with "drop" the
overall helper isn't and instead uses "normalize".
Make it more obvious what the helper actually does by renaming it from
normalize_mounts() to drop_unused_mounts(). Readers of code calling this
helper will immediately see that it will get rid of unused mounts.
Link: https://github.com/systemd/systemd/issues/22206
(cherry picked from commit
fbf90c0d5cadc5d1e95485f770f45a7d4cd39daa)
(cherry picked from commit
09936a7ec92c859b3c4c9520ecd49c2909a8b35c)
Christian Brauner [Fri, 21 Jan 2022 12:08:19 +0000 (13:08 +0100)]
core/namespace: allow using ProtectSubset=pid and ProtectHostname=true together
If a service requests both ProtectSubset=pid and ProtectHostname=true
then it will currently fail to start. The ProcSubset=pid option
instructs systemd to mount procfs for the service with subset=pid which
hides all entries other than /proc/<pid>. Consequently trying to
interact with the two files /proc/sys/kernel/{hostname,domainname}
covered by ProtectHostname=true will fail.
Fix this by only performing this check when ProtectSubset=pid is not
requested. Essentially ProtectSubset=pid implies/provides
ProtectHostname=true.
(cherry picked from commit
1361f015773e3b4d74e382edf1565f3315a3396b)
(cherry picked from commit
a727941affa7821592d503c8a5033c92d615f64c)
Martin Wilck [Thu, 20 Jan 2022 13:31:45 +0000 (14:31 +0100)]
udevadm: cleanup-db: don't delete information for kept db entries
devices with the db_persist property won't be deleted during database
cleanup. This applies to dm and md devices in particular.
For such devices, we should also keep the files under /run/udev/links,
/run/udev/tags, and /run/udev/watch, to make sure that after restart,
udevd has the same information about the devices as it did before
the cleanup.
If we don't do this, a lower-priority device that is discovered in
the coldplug phase may take over symlinks from a device that persisted.
Not removing the watches also enables udevd to resume watching a device
after restart.
Signed-off-by: Martin Wilck <mwilck@suse.com>
(cherry picked from commit
7ec624147a41d80f8e492c9fe19a24e2cda58c25)
(cherry picked from commit
ef7ceef26adb714ef44b2fbc07a219c05a012b42)
Martin Wilck [Fri, 21 Jan 2022 09:44:26 +0000 (10:44 +0100)]
udevadm: cleanup_dir: use dot_or_dot_dot()
which is safer than just checking dent[0].
Also, fix two style issues.
(cherry picked from commit
28d6e8545151d413f8614db9fa790f9f9edbb045)
(cherry picked from commit
494e3c0def197abd4ec88f7b0c3ba331a708d81e)
Anita Zhang [Wed, 19 Jan 2022 21:26:01 +0000 (13:26 -0800)]
oomd: handle situations when no cgroups are killed
Currently if systemd-oomd doesn't kill anything in a selected cgroup, it
selects a new candidate immediately. But if a selected cgroup wasn't killed,
it is likely due to it disappearing or getting cleaned up between the time
it was selected as a candidate and getting sent SIGKILL(s). We should handle
it as though systemd-oomd did perform a kill so that it will check
swap/pressure again before it tries to select a new candidate.
(cherry picked from commit
914d4e99f43761f1ce77b520850cf096aa5196cd)
(cherry picked from commit
c4d89cd602b94ab3baac746395c797ec4da43679)
Anita Zhang [Wed, 19 Jan 2022 18:40:46 +0000 (10:40 -0800)]
oomd: fix race with path unavailability when killing cgroups
There can be a situation where systemd-oomd would kill all of the processes
in a cgroup, pid1 would clean up that cgroup, and systemd-oomd would get
ENODEV trying to iterate the cgroup a final time to ensure it was empty.
systemd-oomd sees this as an error and immediately picks a new candidate even
though pressure may have recovered. To counter this, check and handle
path unavailability errnos specially.
Fixes: #22030
(cherry picked from commit
2ee209466bb51f39ae9df7fec4d5594ce8cfa3f0)
(cherry picked from commit
0456e3aaaae7c21a037f4d3c758463c3ba4d167c)
Yu Watanabe [Wed, 19 Jan 2022 20:24:31 +0000 (05:24 +0900)]
resolve: fix assertion triggered when r == 0
Fixes #22178.
(cherry picked from commit
98b1eb711cfc70776fefd3d4ec437a6a4f9aeff2)
(cherry picked from commit
740dd39e070b3b827cbac37df2a40d61bd9cdb89)
Luca Boccassi [Wed, 19 Jan 2022 00:08:57 +0000 (00:08 +0000)]
core: refuse to mount ExtensionImages if the base layer doesn't at least have ID in os-release
We can't match an extension if we don't at least have an ID,
so refuse to continue
(cherry picked from commit
78ab2b5064a0f87579ce5430f9cb83bba0db069a)
(cherry picked from commit
179bd47f04c538ed1f2c1de2cf2c18f17b027a51)
Luca Boccassi [Wed, 19 Jan 2022 00:01:48 +0000 (00:01 +0000)]
dissect-image: validate extension-release even if the host has only ID in os-release
A rolling distro won't set VERSION_ID or SYSEXT_LEVEL in os-release,
which means we skip validation of ExtensionImages.
Validate even with just an ID, the lower level helper already
recognizes and accepts this use case.
Fixes https://github.com/systemd/systemd/issues/22146
(cherry picked from commit
37361f46d571ad0b71ef99dec6a9b76edbab38bb)
(cherry picked from commit
0dab9e5f057380322755e90ee4d35716d5bf6232)
Luca Boccassi [Wed, 19 Jan 2022 00:27:45 +0000 (00:27 +0000)]
sysext: use LO_FLAGS_PARTSCAN when opening image
Jan 17 12:34:59 myguest1 (sd-sysext)[486]: Device '/var/lib/extensions/myext.raw' is loopback block device with partition scanning turned off, please turn it on.
Fixes https://github.com/systemd/systemd/issues/22146
(cherry picked from commit
70a5c6dce0872b3bb0a39be250adde86a0c8f35c)
(cherry picked from commit
4ef7122f3c3328aa01e1ed187a793e7b1595ee87)
Topi Miettinen [Sat, 27 Nov 2021 10:51:39 +0000 (12:51 +0200)]
namespace: allow ProcSubset=pid with some ProtectKernel options
In case `/proc` is successfully mounted with pid tree subset only due to
`ProcSubset=pid`, the protective mounts for `ProtectKernelTunables=yes` and
`ProtectKernelLogs=yes` to non-pid `/proc` paths are failing because the paths
don't exist. But the pid only option may have failed gracefully (for example
because of ancient kernel), so let's try the mounts but it's not fatal if they
don't succeed.
(cherry picked from commit
788e720181aead8c85ba30fc7ec9a1455a865cbe)
Yu Watanabe [Tue, 21 Dec 2021 11:10:09 +0000 (20:10 +0900)]
meson: fix cross compiling
(cherry picked from commit
3112d756a36993900b70fbff98e69a2a43b970a8)
Daan De Meyer [Wed, 12 Jan 2022 14:44:50 +0000 (14:44 +0000)]
journal: Skip data objects with invalid offsets
We already skip invalid objects, but don't yet skip invalid offsets.
Let's skip these as well to improve robustness when we're dealing with
corrupted journals.
Before:
```
➜ systemd git:(main) build/journalctl -r -n 5 --file ~/Downloads/system@
0005d2b275abaaf8-
f243a2818cb39b98.journal_
Failed to get journal fields: Cannot assign requested address
-- No entries --
```
After:
```
➜ systemd git:(main) ✗ build/journalctl -r -n 5 --file ~/Downloads/system@
0005d2b275abaaf8-
f243a2818cb39b98.journal_
Dec 09 08:32:38 snowball3 NetworkManager[911]: <info> [
1639038758.1464] device (wlp1s0): supplicant interface state: scanning -> authenticating
Dec 09 08:32:38 snowball3 kernel: wlp1s0: send auth to ec:a9:40:79:fb:ad (try 1/3)
Dec 09 08:32:38 snowball3 kernel: wlp1s0: authenticate with ec:a9:40:79:fb:ad
Dec 09 08:32:38 snowball3 wpa_supplicant[1003]: wlp1s0: SME: Trying to authenticate with ec:a9:40:79:fb:ad (SSID='UPC949397B' freq=5500 MHz)
```
(cherry picked from commit
df207ccb7be02b1ca6bdd0a2066a898e5b24ee86)
(cherry picked from commit
556f46aa3b17f4ed6768521137405297c8a99d35)
Benjamin Berg [Mon, 10 Jan 2022 11:35:46 +0000 (12:35 +0100)]
xdg-autostart-service: Ignore missing desktop-sepcific condition binary
If a desktop specific ExecCondition= binary does not exist, this just
means that the desktop environment is not available. As such, it is not
an error condition that should prevent the service from being installed
in the .wants target.
Fix this by simply returning zero.
(cherry picked from commit
6d0aef1dd15088e7379681b3bd93c3cb450f3c55)
(cherry picked from commit
19fbd7764da2e23a89e27b4d95afd77b99f4be87)
Zbigniew Jędrzejewski-Szmek [Wed, 12 Jan 2022 10:32:53 +0000 (11:32 +0100)]
man+docs: adjust links to the new page
(cherry picked from commit
717e92ceb96471251f8242ad4f4c45cc2c68ecc9)
(cherry picked from commit
704d859eeb20fea27cec10c7c6cdb47c59413138)
Zbigniew Jędrzejewski-Szmek [Wed, 12 Jan 2022 09:42:22 +0000 (10:42 +0100)]
policy files: adjust landing page link
(cherry picked from commit
d6e2c1ab7158d52425d3cb72459c5624db12368c)
(cherry picked from commit
944d8d9050b96e690054224e796254dfc18e6681)
Zbigniew Jędrzejewski-Szmek [Wed, 12 Jan 2022 09:39:00 +0000 (10:39 +0100)]
docs: use https:// for fd.o links
(cherry picked from commit
931bc1957b13817fcb0ffe69958dd562202c8e4c)
(cherry picked from commit
e7ed0ba895e53109c1d6f225d7d53605cad8bd8c)
Zbigniew Jędrzejewski-Szmek [Wed, 12 Jan 2022 09:33:57 +0000 (10:33 +0100)]
README: link to the new page
Lennart's blog is now mostly of historical interest, and the wiki
landing page has been replaced by systemd.io.
(cherry picked from commit
2777a4a3bfe153cb675d3d66b383a26043c187b8)
(cherry picked from commit
26271c128ae2b519ecf25ad6cc07e9cf4051c92b)
Zbigniew Jędrzejewski-Szmek [Wed, 12 Jan 2022 09:33:10 +0000 (10:33 +0100)]
NEWS: adjust links to moved pages
All those pages contain a redirect at the top of the page, so it doesn't
make much sense to tell people to take the detour. Linking directly will
also increase the search rankings of the new pages.
(cherry picked from commit
a794a4d87219367e8b24469fcafce83a9f224080)
(cherry picked from commit
2b075f74cb23ba838a29c4b5b898437c8294ddf9)
yangmingtai [Tue, 11 Jan 2022 12:22:11 +0000 (20:22 +0800)]
fix test-string-util failed when locale is not utf8
(cherry picked from commit
647082cf7f07a87c65601626e86c3ed9f78fb387)
(cherry picked from commit
32f33c9474ab89061d799a92a1273b106468e8c6)
Zbigniew Jędrzejewski-Szmek [Wed, 12 Jan 2022 21:22:21 +0000 (22:22 +0100)]
Revert "core: Add trigger limit for path units"
This reverts commit
4c63c3b00aac56390a44e4c0a9d056426d6ff81d.
Zbigniew Jędrzejewski-Szmek [Wed, 12 Jan 2022 21:21:14 +0000 (22:21 +0100)]
Revert "core: Check unit start rate limiting earlier"
This reverts commit
a82b93092bdd3901a22375a820bfa09db8a39978.
This previous commit.
Zbigniew Jędrzejewski-Szmek [Wed, 12 Jan 2022 21:19:37 +0000 (22:19 +0100)]
Revert "Reintroduce ExitType"
This reverts commit
31b7eefb6c3c8e3da74ef18d864e64d72f542e16.
I included this patch because it is important to fix starting of user units
under KDE [1], but I got lost in all the attempts and reverts, and the backport
is broken [2]. I'll try to do a better backport later.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=
1956022
[2] https://bugzilla.redhat.com/show_bug.cgi?id=
2039888
Zbigniew Jędrzejewski-Szmek [Tue, 11 Jan 2022 19:45:42 +0000 (20:45 +0100)]
Reintroduce ExitType
This introduces `ExitType=main|cgroup` for services.
Similar to how `Type` specifies the launch of a service, `ExitType` is
concerned with how systemd determines that a service exited.
- If set to `main` (the current behavior), the service manager will consider
the unit stopped when the main process exits.
- The `cgroup` exit type is meant for applications whose forking model is not
known ahead of time and which might not have a specific main process.
The service will stay running as long as at least one process in the cgroup
is running. This is intended for transient or automatically generated
services, such as graphical applications inside of a desktop environment.
Motivation for this is #16805. The original PR (#18782) was reverted (#20073)
after realizing that the exit status of "the last process in the cgroup" can't
reliably be known (#19385)
This version instead uses the main process exit status if there is one and just
listens to the cgroup empty event otherwise.
The advantages of a service with `ExitType=cgroup` over scopes are:
- Integrated logging / stdout redirection
- Avoids the race / synchronisation issue between launch and scope creation
- More extensive use of drop-ins and thus distro-level configuration:
by moving from scopes to services we can have drop ins that will affect
properties that can only be set during service creation,
like `OOMPolicy` and security-related properties
- It makes systemd-xdg-autostart-generator usable by fixing [1], as obviously
only services can be used in the generator, not scopes.
[1] https://bugs.kde.org/show_bug.cgi?id=433299
(cherry picked from commit
596e447076b27d103a30c26a68626e9820ac705b)
Daan De Meyer [Tue, 24 Aug 2021 15:46:47 +0000 (16:46 +0100)]
core: Check unit start rate limiting earlier
Fixes #17433. Currently, if any of the validations we do before we
check start rate limiting fail, we can still enter a busy loop as
no rate limiting gets applied. A common occurence of this scenario
is path units triggering a service that fails a condition check.
To fix the issue, we simply move up start rate limiting checks to
be the first thing we do when starting a unit. To achieve this,
we add a new method to the unit vtable and implement it for the
relevant unit types so that we can do the start rate limit checks
earlier on.
(cherry picked from commit
9727f2427ff6b2e1f4ab927cc57ad8e888f04e95)
Zbigniew Jędrzejewski-Szmek [Tue, 11 Jan 2022 12:36:39 +0000 (13:36 +0100)]
nss: only read logging config from environment variables
log_parse_environment() uses should_parse_proc_cmdline() to determine whether
it should parse settings from the kernel command line. But the checks that
should_parse_proc_cmdline() apply to the whole process, and we could get a positive
answer also when log_parse_environment() was called from one of the nss modules.
In case of nss-modules, we don't want to look at the kernel command line.
log_parse_environment_variables() that only looks at the environment variables
is split out and used in the nss modules.
Fixes #22020.
(cherry picked from commit
a7d15a24659770b0fa9f4cd26fc7bbb17765cbb7)
Zbigniew Jędrzejewski-Szmek [Tue, 11 Jan 2022 12:23:27 +0000 (13:23 +0100)]
nss: drop dummy setup_logging() helpers
log_parse_environment() stopped being a macro in
9fdee66f2d9.
As reported by @bauen1 in https://github.com/systemd/systemd/issues/22020,
the comment was out of date.
(cherry picked from commit
56a5f4969b96529c82ec8cc08db4fa8e9c61e7b9)
Daan De Meyer [Fri, 17 Dec 2021 19:01:31 +0000 (20:01 +0100)]
core: Add trigger limit for path units
When conditions fail on a service unit, a path unit can cause
PID 1 to busy loop as it keeps trying to activate the service unit.
To avoid this from happening, add a trigger limit to the path unit,
identical to the trigger limit we have for socket units.
Initially, let's start with a high limit and not make it configurable.
If needed, we can add properties to configure the rate limit similar
to the ones we have for socket units.
(cherry picked from commit
aaae822b37aa3ca39aebb516fdc6bef36d730c25)