]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agotest: build the SELinux test module on the host 27698/head
Frantisek Sumsal [Fri, 19 May 2023 09:45:11 +0000 (11:45 +0200)] 
test: build the SELinux test module on the host

Let's save some time and build the SELinux test module on the host
instead of a possibly unaccelerated VM. This brings the runtime of
TEST-06-SELINUX from ~12 minutes down to a ~1 minute.

2 years agotest: drop generated stuff from the final coverage report
Frantisek Sumsal [Fri, 19 May 2023 09:07:07 +0000 (11:07 +0200)] 
test: drop generated stuff from the final coverage report

Let's drop stuff from the current $BUILD_DIR from the final coverage
report, as it's all generated files (mostly gperf) which we don't
really care about and it makes the Coveralls report confusing, since it
reports "source not available" for all such files.

2 years agotest: make the stress test slightly less stressful on slower machines
Frantisek Sumsal [Fri, 19 May 2023 08:48:15 +0000 (10:48 +0200)] 
test: make the stress test slightly less stressful on slower machines

Without acceleration this part of the test takes over 10 minutes (!),
which feels quite unnecessary. Let's cut down the number of stuff we
dump to the journal in such case, but keep the original value if we run
with acceleration (since in that case it takes less than 10 seconds).

2 years agocore/device: downgrade error when units specified in SYSTEMD_WANTS= not found
Yu Watanabe [Thu, 18 May 2023 20:27:46 +0000 (05:27 +0900)] 
core/device: downgrade error when units specified in SYSTEMD_WANTS= not found

Closes #27693.

2 years agounit: add conditions and deps to make oomd.socket and .service consistent
Yu Watanabe [Thu, 18 May 2023 19:47:34 +0000 (04:47 +0900)] 
unit: add conditions and deps to make oomd.socket and .service consistent

Fixes #27690.

2 years agoMerge pull request #27686 from keszybz/make-boot-output-nicer
Yu Watanabe [Thu, 18 May 2023 18:50:45 +0000 (03:50 +0900)] 
Merge pull request #27686 from keszybz/make-boot-output-nicer

Make boot output nicer

2 years agohwdb: fix Positivo CG15D key toggle touchpad and programmable keys (#27689)
Edson Juliano Drosdeck [Thu, 18 May 2023 18:06:42 +0000 (14:06 -0400)] 
hwdb: fix Positivo CG15D key toggle touchpad and programmable keys (#27689)

2 years agoMerge pull request #27685 from keszybz/the-semiannual-excercise-in-output-narrowing
Yu Watanabe [Thu, 18 May 2023 18:04:47 +0000 (03:04 +0900)] 
Merge pull request #27685 from keszybz/the-semiannual-excercise-in-output-narrowing

The semiannual excercise in output narrowing

2 years agoMerge pull request #27684 from mrc0mmand/more-nspawn-tests
Yu Watanabe [Thu, 18 May 2023 18:00:54 +0000 (03:00 +0900)] 
Merge pull request #27684 from mrc0mmand/more-nspawn-tests

test: further extend systemd-nspawn coverage

2 years agointegration test: pass 'noresume' to qemu
Luca Boccassi [Thu, 18 May 2023 12:08:56 +0000 (13:08 +0100)] 
integration test: pass 'noresume' to qemu

When running on Debian/Ubuntu, I get a minute delay or so on every boot
because the local initramfs tries to resume from hibernation. This is
not really useful here, so always skip it

2 years agotest: wrap setfacl when running with ASan 27684/head
Frantisek Sumsal [Thu, 18 May 2023 15:30:36 +0000 (17:30 +0200)] 
test: wrap setfacl when running with ASan

2 years agooomd: shorten message 27686/head
Zbigniew Jędrzejewski-Szmek [Thu, 18 May 2023 14:29:20 +0000 (16:29 +0200)] 
oomd: shorten message

We can make the message shorter and more direct without changing
the meaning.

2 years agosd-bus,sd-event: allow querying of description even after fork
Zbigniew Jędrzejewski-Szmek [Thu, 18 May 2023 15:05:41 +0000 (17:05 +0200)] 
sd-bus,sd-event: allow querying of description even after fork

This in unnecessarilly unpleasant: the code might report about a bus
connection, e.g. in an error message or assert. Let's let it query
the name of the object.

This partially reverts f4b2933ee7890e5d414ab266d8586f19027a2bd9.

2 years agosd-bus: do not assert if bus description is not set
Zbigniew Jędrzejewski-Szmek [Thu, 18 May 2023 15:03:53 +0000 (17:03 +0200)] 
sd-bus: do not assert if bus description is not set

The code has an explicit fallback using runtime_scope_to_string(), which
is also documented in the man page. So -ENXIO should only be returned when
the fallback doesn't work, i.e. bus->runtime_scope == -EINVAL.

Fixup for f4b2933ee7890e5d414ab266d8586f19027a2bd9.

This should fix the following errors during boot:
May 18 16:05:37 fedora systemd-update-utmp[263]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:38 fedora systemctl[360]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:38 fedora systemctl[363]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:38 fedora systemd-update-utmp[372]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:38 fedora @ystemctl[387]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:40 fedora systemd-update-utmp[477]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:41 fedora systemd-homed[509]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:41 fedora systemd-logind[510]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:41 fedora systemd-update-utmp[529]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:42 fedora systemd-user-runtime-dir[531]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:42 fedora systemctl[542]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.
May 18 16:05:42 fedora systemd-hostnamed[556]: Assertion 'bus->description' failed at src/libsystemd/sd-bus/sd-bus.c:4201, function sd_bus_get_description(). Ignoring.

2 years agomeson: rename "dist-check" suite to "dist" 27685/head
Zbigniew Jędrzejewski-Szmek [Thu, 18 May 2023 15:16:33 +0000 (17:16 +0200)] 
meson: rename "dist-check" suite to "dist"

*Now* one of those tests is the longest, let's make them a bit shorter.

2 years agomeson: rename "fuzzers" suite to "fuzz"
Zbigniew Jędrzejewski-Szmek [Thu, 18 May 2023 15:14:50 +0000 (17:14 +0200)] 
meson: rename "fuzzers" suite to "fuzz"

Fuzz tests have all the longest names, so by making this name
shorter, we save three columns of screen real estate.

2 years agotest: don't mount /sys & /proc if already mounted
Frantisek Sumsal [Thu, 18 May 2023 13:52:43 +0000 (15:52 +0200)] 
test: don't mount /sys & /proc if already mounted

2 years agonspawn: make the error message less confusing
Frantisek Sumsal [Thu, 18 May 2023 13:14:20 +0000 (15:14 +0200)] 
nspawn: make the error message less confusing

by not printing (null) and dropping the extraneous slash, e.g.:

systemd-nspawn[2049]: Failed to resolve (null)//proc: Permission denied

2 years agotest: add a couple of tests for nspawn config files
Frantisek Sumsal [Wed, 17 May 2023 20:36:07 +0000 (22:36 +0200)] 
test: add a couple of tests for nspawn config files

2 years agonspawn: correctly parse a list of interfaces
Frantisek Sumsal [Thu, 18 May 2023 10:54:15 +0000 (12:54 +0200)] 
nspawn: correctly parse a list of interfaces

Interface=/MACVLAN=/IPVLAN= nspawn options take a _list_ of interface
names - this was recently enhanced by 2f091b1b49 to support interface
pairs. Unfortunately, this also introduced a regression where we don't
parse the list as a list, but just as a single value. For example,
having `Interface=sd-shared1 sd-shared2` in an nspawn config file would
throw:

systemd-nspawn[898]: Network interface, interface name not valid: sd-shared1 sd-shared2
systemd-nspawn[898]: /run/systemd/nspawn/testsuite-13.nspawn-settings.1po.nspawn:41: Failed to parse file: Invalid argument

Follow-up to 2f091b1b49.

2 years agotest: create nspawn config files when collecting coverage
Frantisek Sumsal [Wed, 17 May 2023 19:49:20 +0000 (21:49 +0200)] 
test: create nspawn config files when collecting coverage

Which bind-mounts the $BUILD_DIR into the container. This whole coverage
thing is getting slightly ridiculous.

Follow-up to 3b2823a749, but for non-machinectl containers.

2 years agotest: cover --bind-user=
Frantisek Sumsal [Wed, 17 May 2023 13:35:10 +0000 (15:35 +0200)] 
test: cover --bind-user=

2 years agotest: add a couple of sanity tests for --port=
Frantisek Sumsal [Wed, 17 May 2023 12:57:50 +0000 (14:57 +0200)] 
test: add a couple of sanity tests for --port=

2 years agotest: drop "check" from test case names
Frantisek Sumsal [Wed, 17 May 2023 11:57:37 +0000 (13:57 +0200)] 
test: drop "check" from test case names

2 years agotest: exercise a couple of error paths in nspawn's OCI code as well
Frantisek Sumsal [Wed, 17 May 2023 11:09:02 +0000 (13:09 +0200)] 
test: exercise a couple of error paths in nspawn's OCI code as well

2 years agonspawn: clean up & unify cleanup handlers
Frantisek Sumsal [Wed, 17 May 2023 09:06:40 +0000 (11:06 +0200)] 
nspawn: clean up & unify cleanup handlers

Also, make them follow our naming conventions.

2 years agofuzz: rename long samples
Zbigniew Jędrzejewski-Szmek [Wed, 17 May 2023 16:24:49 +0000 (18:24 +0200)] 
fuzz: rename long samples

With those long filenames, output doesn't fit on the terminal.

2 years agomkosi: use wildcard to shorten things
Zbigniew Jędrzejewski-Szmek [Thu, 11 May 2023 19:22:08 +0000 (21:22 +0200)] 
mkosi: use wildcard to shorten things

2 years agoRevert "resolved: address DVE-2018-0001"
Dimitri John Ledkov [Thu, 30 Mar 2023 20:58:40 +0000 (21:58 +0100)] 
Revert "resolved: address DVE-2018-0001"

DVE-2018-0001 has been fixed by the vendor, and this workaround is no longer
needed. Removal of this workaround improves performance as queries used to be
retried more than necessory.

This reverts 1ed4e584f3a03f47d2313314b6b5a78c9dc6f135.
This reverts https://github.com/systemd/systemd/pull/18638

Keep .clamp_feature_level_servfail name, as imho it is more descriptive than
just .clamp_feature_level, especially if we ever need to add similar
workarounds as the one we had for DVE-2018-0001.

However note that there is another retry which was added in
8a33aa199dc1cea14494469ac9d7d08dc6721df1 - seems to be working around Stubby
resolver behaviour.

Fixes: #26967
2 years agonspawn: use ASSERT_PTR() more
Frantisek Sumsal [Wed, 17 May 2023 08:53:57 +0000 (10:53 +0200)] 
nspawn: use ASSERT_PTR() more

2 years agonss-resolve: report EAI_NODATA
Mateusz Poliwczak [Wed, 17 May 2023 15:55:42 +0000 (17:55 +0200)] 
nss-resolve: report EAI_NODATA

2 years agobusctl: Add space before "tree" paths for copying
Matt Johnston [Thu, 18 May 2023 04:28:06 +0000 (12:28 +0800)] 
busctl: Add space before "tree" paths for copying

This allows a double-click on the path in a terminal to select the
whole path. Otherwise the leading '-' character is also included in
the copied path.

```
New output:
./busctl tree org.freedesktop.network1
`- /org
  `- /org/freedesktop
    |- /org/freedesktop/LogControl1
    `- /org/freedesktop/network1
      |- /org/freedesktop/network1/link
      | |- /org/freedesktop/network1/link/_31
      | |- /org/freedesktop/network1/link/_32
```

2 years agoMerge pull request #27673 from YHNdnzj/restartsteps-transient
Yu Watanabe [Thu, 18 May 2023 08:54:33 +0000 (17:54 +0900)] 
Merge pull request #27673 from YHNdnzj/restartsteps-transient

core,bus-unit-util: add missing RestartSteps and RestartMaxDelaySec to bus_append_service_property

2 years agoREADME: drop busybox requirement
Yu Watanabe [Thu, 18 May 2023 08:49:41 +0000 (17:49 +0900)] 
README: drop busybox requirement

Follow-up for 5656759d0617594ee8e850a258a21d3e187bf02c.

2 years agoMerge pull request #27677 from mrc0mmand/test-followups
Yu Watanabe [Thu, 18 May 2023 08:47:02 +0000 (17:47 +0900)] 
Merge pull request #27677 from mrc0mmand/test-followups

test: get rid of the busybox stuff

2 years agoRevert (partially) "man: Clarify when OnFailure= activates after restarts (#7646)"
Mike Yuan [Wed, 17 May 2023 15:47:53 +0000 (23:47 +0800)] 
Revert (partially) "man: Clarify when OnFailure= activates after restarts (#7646)"

This reverts part of commit bd2538b50ba283c9ce39142d5d16d90184a55b90,
specifically changes to the description of service state between auto-restarts.

Fixes #27594

2 years agotest: explicitly use bash 27677/head
Frantisek Sumsal [Wed, 17 May 2023 18:14:05 +0000 (20:14 +0200)] 
test: explicitly use bash

To avoid unexpected surprised in CIs with different default shell.

2 years agotest: get rid of the busybox stuff
Frantisek Sumsal [Wed, 17 May 2023 17:10:55 +0000 (19:10 +0200)] 
test: get rid of the busybox stuff

It already required a lot of workarounds, since the busybox utilities
often work differently than their "full" counterparts, and putting
the container together using our "tools" is quite simple anyway.

2 years agobus-unit-util: add missing RestartSteps and RestartMaxDelaySec to bus_append_service_... 27673/head
Mike Yuan [Wed, 17 May 2023 15:33:05 +0000 (23:33 +0800)] 
bus-unit-util: add missing RestartSteps and RestartMaxDelaySec to bus_append_service_property

Follow-up for be1adc27fc61ba723bd0392199f7b82ef9f1c970

2 years agocore: rename RestartSecMax to RestartMaxDelaySec
Mike Yuan [Wed, 17 May 2023 16:15:23 +0000 (00:15 +0800)] 
core: rename RestartSecMax to RestartMaxDelaySec

2 years agotest: mangle the machine ID only for the QEMU test part
Frantisek Sumsal [Wed, 17 May 2023 07:05:04 +0000 (09:05 +0200)] 
test: mangle the machine ID only for the QEMU test part

systemd-nspawn doesn't like invalid machine IDs and refuses to boot with one:

TEST-74-AUX-UTILS RUN: Tests for auxiliary utilities
...
Spawning container TEST-74-AUX-UTILS--3 on /var/tmp/systemd-test-TEST-74-AUX-UTILS_3/root.
Press Ctrl-] three times within 1s to kill container.
Failed to read machine ID from container image: Structure needs cleaning
E: nspawn failed with exit code 1

Follow-up to b4d42a82eb.

2 years agoMerge pull request #27669 from keszybz/man-fixes-254
Zbigniew Jędrzejewski-Szmek [Wed, 17 May 2023 12:12:33 +0000 (14:12 +0200)] 
Merge pull request #27669 from keszybz/man-fixes-254

Some simple man page fixes to reduce the list of issues tagged for v254

2 years agoMerge pull request #27671 from keszybz/manpage-fixes-254-2
Zbigniew Jędrzejewski-Szmek [Wed, 17 May 2023 12:12:08 +0000 (14:12 +0200)] 
Merge pull request #27671 from keszybz/manpage-fixes-254-2

man: fixes for assorted issues reported by the manpage-l10n project

2 years agoman: fixes for assorted issues reported by the manpage-l10n project 27671/head
Zbigniew Jędrzejewski-Szmek [Wed, 17 May 2023 10:24:04 +0000 (12:24 +0200)] 
man: fixes for assorted issues reported by the manpage-l10n project

Fixes #26761.

2 years agoman/tmpfiles: fix off-by-one in example 27669/head
Zbigniew Jędrzejewski-Szmek [Wed, 17 May 2023 09:16:56 +0000 (11:16 +0200)] 
man/tmpfiles: fix off-by-one in example

Reported and diagnosed by gitterman. Fixes #26617.

2 years agoman: explain allowed values for /sys/power/{disk,state}
Zbigniew Jędrzejewski-Szmek [Wed, 17 May 2023 09:12:32 +0000 (11:12 +0200)] 
man: explain allowed values for /sys/power/{disk,state}

Also fix the grammar: "neither" can only be used with two values, and
here we have an inderminate number >= 1.

Fixes #26460.

2 years agoman: say that ProtectClock= also affects reads
Zbigniew Jędrzejewski-Szmek [Wed, 17 May 2023 07:52:17 +0000 (09:52 +0200)] 
man: say that ProtectClock= also affects reads

Fixes #26413: the docs said that the filter prevents writes, but it just a
filter at the system call level, and some of those calls are used for writing
and reading. This is confusing esp. when a higher level library call like
ntp_gettime() is denied.

I don't think it's realistic that we'll make the filter smarter in the near
future, so let's change the docs to describe the implementation.

Also, split out the advice part into a separate paragraph.

2 years agoMerge pull request #27664 from mrc0mmand/test-merge
Yu Watanabe [Wed, 17 May 2023 00:53:58 +0000 (09:53 +0900)] 
Merge pull request #27664 from mrc0mmand/test-merge

test: let's merge more tests together

2 years agotest: move runas() to the shared utility library 27664/head
Frantisek Sumsal [Tue, 16 May 2023 20:41:03 +0000 (22:41 +0200)] 
test: move runas() to the shared utility library

2 years agotest: make shellcheck happy again
Frantisek Sumsal [Tue, 16 May 2023 18:55:45 +0000 (20:55 +0200)] 
test: make shellcheck happy again

No functional changes.

2 years agotest: merge TEST-48-START-STOP-NO-RELOAD into TEST-23-UNIT-FILE
Frantisek Sumsal [Tue, 16 May 2023 18:41:35 +0000 (20:41 +0200)] 
test: merge TEST-48-START-STOP-NO-RELOAD into TEST-23-UNIT-FILE

2 years agotest: merge TEST-49-RUNTIME-BIND-PATHS into TEST-23-UNIT-FILE
Frantisek Sumsal [Tue, 16 May 2023 18:31:49 +0000 (20:31 +0200)] 
test: merge TEST-49-RUNTIME-BIND-PATHS into TEST-23-UNIT-FILE

2 years agotest: clean up test artifacts
Frantisek Sumsal [Tue, 16 May 2023 17:56:30 +0000 (19:56 +0200)] 
test: clean up test artifacts

So we don't run into unexpected fails when two tests use the same paths.

2 years agotest: merge TEST-28-PERCENTJ-WANTEDBY into TEST-23-UNIT-FILE
Frantisek Sumsal [Tue, 16 May 2023 17:45:56 +0000 (19:45 +0200)] 
test: merge TEST-28-PERCENTJ-WANTEDBY into TEST-23-UNIT-FILE

2 years agotest: merge TEST-56-EXIT-TYPE into TEST-19-CGROUP
Frantisek Sumsal [Tue, 16 May 2023 17:26:42 +0000 (19:26 +0200)] 
test: merge TEST-56-EXIT-TYPE into TEST-19-CGROUP

And clean it up a bit.

2 years agotest: rename TEST-19-DELEGATE to TEST-19-CGROUP
Frantisek Sumsal [Tue, 16 May 2023 17:17:40 +0000 (19:17 +0200)] 
test: rename TEST-19-DELEGATE to TEST-19-CGROUP

And clean it up a bit.

2 years agotest: introduce get_cgroup_hierarchy()
Frantisek Sumsal [Tue, 16 May 2023 17:11:51 +0000 (19:11 +0200)] 
test: introduce get_cgroup_hierarchy()

2 years agotest: rename assert.sh to util.sh
Frantisek Sumsal [Tue, 16 May 2023 17:09:13 +0000 (19:09 +0200)] 
test: rename assert.sh to util.sh

So we can extend it with additional utility functions without making it
confusing.

No functional change.

2 years agotest: merge TEST-33-CLEAN-UNIT into TEST-23-UNIT-FILE
Frantisek Sumsal [Tue, 16 May 2023 16:50:43 +0000 (18:50 +0200)] 
test: merge TEST-33-CLEAN-UNIT into TEST-23-UNIT-FILE

2 years agotest: merge TEST-27-STDOUTFILE into TEST-23-UNIT-FILE
Frantisek Sumsal [Tue, 16 May 2023 16:42:14 +0000 (18:42 +0200)] 
test: merge TEST-27-STDOUTFILE into TEST-23-UNIT-FILE

2 years agotest: merge TEST-14-MACHINE-ID into TEST-74-AUX-UTILS
Frantisek Sumsal [Tue, 16 May 2023 16:31:45 +0000 (18:31 +0200)] 
test: merge TEST-14-MACHINE-ID into TEST-74-AUX-UTILS

2 years agoman/systemd-sysext: correct explanation of confexts directories
Antonio Alvarez Feijoo [Tue, 16 May 2023 14:49:28 +0000 (16:49 +0200)] 
man/systemd-sysext: correct explanation of confexts directories

2 years agoswitch-root: add a comment regarding the safety limits of rm_rf_children()
Lennart Poettering [Mon, 15 May 2023 19:31:38 +0000 (21:31 +0200)] 
switch-root: add a comment regarding the safety limits of rm_rf_children()

2 years agoMerge pull request #27606 from YHNdnzj/loginctl-list-show-state
Yu Watanabe [Tue, 16 May 2023 16:41:13 +0000 (01:41 +0900)] 
Merge pull request #27606 from YHNdnzj/loginctl-list-show-state

loginctl: list-{users,sessions}: add a column for showing state

2 years agoMerge pull request #27655 from yuwata/udev-net-assign-alternative-names-only-on-add...
Yu Watanabe [Tue, 16 May 2023 16:39:40 +0000 (01:39 +0900)] 
Merge pull request #27655 from yuwata/udev-net-assign-alternative-names-only-on-add-event

udev/net: assign alternative names only on add event

2 years agoMerge pull request #27651 from mrc0mmand/more-nspawn-tests
Frantisek Sumsal [Tue, 16 May 2023 15:26:25 +0000 (17:26 +0200)] 
Merge pull request #27651 from mrc0mmand/more-nspawn-tests

nspawn: OCI related fixes & tests

2 years agoMerge pull request #27659 from yuwata/memfd-seal
Mike Yuan [Tue, 16 May 2023 14:00:57 +0000 (22:00 +0800)] 
Merge pull request #27659 from yuwata/memfd-seal

memfd-util: handle F_SEAL_EXEC flag

2 years agoMerge pull request #27638 from YHNdnzj/upheldby-unit-file
Mike Yuan [Tue, 16 May 2023 13:53:24 +0000 (21:53 +0800)] 
Merge pull request #27638 from YHNdnzj/upheldby-unit-file

unit-file: support UpheldBy= in [Install] settings (adding Upholds= deps from .upholds/)

2 years agoMerge pull request #27573 from poettering/sd-bus-description
Lennart Poettering [Tue, 16 May 2023 13:46:29 +0000 (06:46 -0700)] 
Merge pull request #27573 from poettering/sd-bus-description

sd-bus: pass bus description (and comm name) to per via socket address binding on AF_UNIX

2 years agoMerge pull request #27648 from poettering/common-dissect-dir
Lennart Poettering [Tue, 16 May 2023 12:26:48 +0000 (05:26 -0700)] 
Merge pull request #27648 from poettering/common-dissect-dir

pid1: add common root dir inode to mount disk images to in private namespaces

2 years agoMerge pull request #27647 from poettering/mount-setup-tweaklets
Lennart Poettering [Tue, 16 May 2023 12:26:09 +0000 (05:26 -0700)] 
Merge pull request #27647 from poettering/mount-setup-tweaklets

mount-setup: minor tweaks

2 years agoMerge pull request #27658 from poettering/base-fs-run
Lennart Poettering [Tue, 16 May 2023 12:25:43 +0000 (05:25 -0700)] 
Merge pull request #27658 from poettering/base-fs-run

base-filesystem: also set up /run/ mount point if missing

2 years agoman: indicate that the JOB parameter to "systemctl cancel" is optional
Lennart Poettering [Tue, 16 May 2023 07:35:39 +0000 (09:35 +0200)] 
man: indicate that the JOB parameter to "systemctl cancel" is optional

As per:

https://social.treehouse.systems/@grawity/110376583742207755

2 years agotest: add test for state in loginctl list-{users,sessions} 27606/head
Mike Yuan [Mon, 15 May 2023 05:45:33 +0000 (13:45 +0800)] 
test: add test for state in loginctl list-{users,sessions}

2 years agologinctl: list-sessions: also show state
Mike Yuan [Thu, 11 May 2023 05:21:37 +0000 (13:21 +0800)] 
loginctl: list-sessions: also show state

2 years agologinctl: list-sessions: minor modernization
Mike Yuan [Thu, 11 May 2023 05:17:59 +0000 (13:17 +0800)] 
loginctl: list-sessions: minor modernization

2 years agologinctl: list-users: also show state
Mike Yuan [Thu, 11 May 2023 05:05:39 +0000 (13:05 +0800)] 
loginctl: list-users: also show state

2 years agobusctl: set a description for the bus connection 27573/head
Lennart Poettering [Fri, 5 May 2023 19:33:56 +0000 (21:33 +0200)] 
busctl: set a description for the bus connection

Unlike most other bus connections in our codebase this one is created
manually and every setting set invididually. It hence does not have a
description by default (as all automatic connections have). Set one
explicitly.

2 years agopid1: debug log client comm/description strings if available for incoming connections
Lennart Poettering [Fri, 5 May 2023 19:45:54 +0000 (21:45 +0200)] 
pid1: debug log client comm/description strings if available for incoming connections

Very useful for debugging, to see which clients actually connect.

2 years agotest: add testcase for the new sockaddr metainfo logic
Lennart Poettering [Fri, 5 May 2023 19:47:02 +0000 (21:47 +0200)] 
test: add testcase for the new sockaddr metainfo logic

2 years agosd-bus: use the new information in the client's sockaddr in the creds structure
Lennart Poettering [Fri, 5 May 2023 19:43:57 +0000 (21:43 +0200)] 
sd-bus: use the new information in the client's sockaddr in the creds structure

Now that clients might convey comm/description strings via the sockaddr,
let's actually use them on the other side, read the data via
getpeername() parse it, and include it in the "owner" creds (which is
how we call the peer's creds).

2 years agotest: add basic test for memfd_set_sealed() and memfd_get_sealed() 27659/head
Yu Watanabe [Tue, 16 May 2023 09:59:25 +0000 (18:59 +0900)] 
test: add basic test for memfd_set_sealed() and memfd_get_sealed()

2 years agomemfd-util: set F_SEAL_EXEC flag if supported
Yu Watanabe [Tue, 16 May 2023 09:50:39 +0000 (18:50 +0900)] 
memfd-util: set F_SEAL_EXEC flag if supported

2 years agomemfd-util: memfd may also have F_SEAL_EXEC flag
Yu Watanabe [Tue, 16 May 2023 09:48:29 +0000 (18:48 +0900)] 
memfd-util: memfd may also have F_SEAL_EXEC flag

Follow-up for c29715a8f77d96cd731b4a3083b3a852b3b61eb8.

Fixes #27608.

2 years agomissing: add more F_SEAL_XYZ flags
Yu Watanabe [Tue, 16 May 2023 09:46:16 +0000 (18:46 +0900)] 
missing: add more F_SEAL_XYZ flags

2 years agobase-filesystem: mention why we don't carry an entry for /tmp/ for now 27658/head
Lennart Poettering [Tue, 16 May 2023 09:44:27 +0000 (11:44 +0200)] 
base-filesystem: mention why we don't carry an entry for /tmp/ for now

2 years agonspawn: make sure the device type survives when setting device mode 27651/head
Frantisek Sumsal [Tue, 16 May 2023 09:40:33 +0000 (11:40 +0200)] 
nspawn: make sure the device type survives when setting device mode

2 years agobase-filesystem: also set up /run/ mount point if missing
Lennart Poettering [Mon, 15 May 2023 19:20:36 +0000 (21:20 +0200)] 
base-filesystem: also set up /run/ mount point if missing

We don't support images without, hence create this one too, like we
create all other relevant mount points we definitely require for
booting.

2 years agotest: add tests for renaming network interface 27655/head
Yu Watanabe [Tue, 16 May 2023 07:28:54 +0000 (16:28 +0900)] 
test: add tests for renaming network interface

2 years agofuzz: update the base JSON for fuzz-nspawn-oci
Frantisek Sumsal [Mon, 15 May 2023 19:10:07 +0000 (21:10 +0200)] 
fuzz: update the base JSON for fuzz-nspawn-oci

2 years agotest: add a couple of tests for nspawn's OCI stuff
Frantisek Sumsal [Mon, 15 May 2023 16:57:55 +0000 (18:57 +0200)] 
test: add a couple of tests for nspawn's OCI stuff

2 years agonspawn: fix a global-buffer-overflow
Frantisek Sumsal [Mon, 15 May 2023 18:25:43 +0000 (20:25 +0200)] 
nspawn: fix a global-buffer-overflow

Whoopsie.

=================================================================
==3789231==ERROR: AddressSanitizer: global-buffer-overflow on address 0x00000051d0b8 at pc 0x7f70850bc904 bp 0x7ffd9bbdf660 sp 0x7ffd9bbdf658
READ of size 8 at 0x00000051d0b8 thread T0
    #0 0x7f70850bc903 in json_dispatch ../src/shared/json.c:4347
    #1 0x4a5b54 in oci_seccomp_syscalls ../src/nspawn/nspawn-oci.c:1838
    #2 0x7f70850bd359 in json_dispatch ../src/shared/json.c:4395
    #3 0x4a668c in oci_seccomp ../src/nspawn/nspawn-oci.c:1905
    #4 0x7f70850bd359 in json_dispatch ../src/shared/json.c:4395
    #5 0x4a7d8c in oci_linux ../src/nspawn/nspawn-oci.c:2030
    #6 0x7f70850bd359 in json_dispatch ../src/shared/json.c:4395
    #7 0x4aa31c in oci_load ../src/nspawn/nspawn-oci.c:2198
    #8 0x446cec in load_oci_bundle ../src/nspawn/nspawn.c:4744
    #9 0x44ffa7 in run ../src/nspawn/nspawn.c:5477
    #10 0x4552fb in main ../src/nspawn/nspawn.c:5920
    #11 0x7f7083a4a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)
    #12 0x7f7083a4a5c8 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x275c8)
    #13 0x40d284 in _start (/home/fsumsal/repos/@systemd/systemd/build-san/systemd-nspawn+0x40d284)

0x00000051d0b8 is located 40 bytes to the left of global variable 'bus_standard_errors_copy_0' defined in '../src/libsystemd/sd-bus/bus-error.h:57:1' (0x51d0e0) of size 8
0x00000051d0b8 is located 0 bytes to the right of global variable 'table' defined in '../src/nspawn/nspawn-oci.c:1829:43' (0x51d040) of size 120
SUMMARY: AddressSanitizer: global-buffer-overflow ../src/shared/json.c:4347 in json_dispatch
Shadow bytes around the buggy address:
  0x00008009b9c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00008009b9d0: 00 00 00 00 f9 f9 f9 f9 00 00 00 00 00 00 00 00
  0x00008009b9e0: 00 00 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
  0x00008009b9f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00008009ba00: 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
=>0x00008009ba10: 00 00 00 00 00 00 00[f9]f9 f9 f9 f9 00 f9 f9 f9
  0x00008009ba20: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
  0x00008009ba30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00008009ba40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00008009ba50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00008009ba60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==3789231==ABORTING

2 years agonspawn: fix inverted condition
Frantisek Sumsal [Mon, 15 May 2023 18:10:05 +0000 (20:10 +0200)] 
nspawn: fix inverted condition

2 years agonspawn: call json_dispatch() with a correct pointer
Frantisek Sumsal [Mon, 15 May 2023 17:45:13 +0000 (19:45 +0200)] 
nspawn: call json_dispatch() with a correct pointer

Otherwise hilarity ensues:

 AddressSanitizer:DEADLYSIGNAL
 =================================================================
 ==722==ERROR: AddressSanitizer: SEGV on unknown address 0xffffffff00000000 (pc 0x7f8d50ca9ffb bp 0x7fff11b0d4a0 sp 0x7fff11b0cc30 T0)
 ==722==The signal is caused by a READ memory access.
     #0 0x7f8d50ca9ffb in __interceptor_strcmp.part.0 (/lib64/libasan.so.8+0xa9ffb)
     #1 0x7f8d4f9cf5a1 in strcmp_ptr ../src/fundamental/string-util-fundamental.h:33
     #2 0x7f8d4f9cf5f8 in streq_ptr ../src/fundamental/string-util-fundamental.h:46
     #3 0x7f8d4f9d74d2 in free_and_strdup ../src/basic/string-util.c:948
     #4 0x49139a in free_and_strdup_warn ../src/basic/string-util.h:197
     #5 0x4923eb in oci_absolute_path ../src/nspawn/nspawn-oci.c:139
     #6 0x7f8d4f6bd359 in json_dispatch ../src/shared/json.c:4395
     #7 0x4a8831 in oci_hooks_array ../src/nspawn/nspawn-oci.c:2089
     #8 0x7f8d4f6bd359 in json_dispatch ../src/shared/json.c:4395
     #9 0x4a8b56 in oci_hooks ../src/nspawn/nspawn-oci.c:2112
     #10 0x7f8d4f6bd359 in json_dispatch ../src/shared/json.c:4395
     #11 0x4aa298 in oci_load ../src/nspawn/nspawn-oci.c:2197
     #12 0x446cec in load_oci_bundle ../src/nspawn/nspawn.c:4744
     #13 0x44ffa7 in run ../src/nspawn/nspawn.c:5477
     #14 0x4552fb in main ../src/nspawn/nspawn.c:5920
     #15 0x7f8d4e04a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)
     #16 0x7f8d4e04a5c8 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x275c8)
     #17 0x40d284 in _start (/usr/bin/systemd-nspawn+0x40d284)
 AddressSanitizer can not provide additional info.
 SUMMARY: AddressSanitizer: SEGV (/lib64/libasan.so.8+0xa9ffb) in __interceptor_strcmp.part.0
 ==722==ABORTING

2 years agonspawn: all hooks should be arrays of objects, not just objects
Frantisek Sumsal [Mon, 15 May 2023 17:44:15 +0000 (19:44 +0200)] 
nspawn: all hooks should be arrays of objects, not just objects

See: https://github.com/opencontainers/runtime-spec/blob/v1.0.0/config.md#posix-platform-hooks

2 years agonspawn: use the just returned errno in the log message
Frantisek Sumsal [Mon, 15 May 2023 17:06:14 +0000 (19:06 +0200)] 
nspawn: use the just returned errno in the log message

Use the returned errno even though we are going to ignore it, otherwise
the log message is just confusing:

config.json:119:13: Failed to resolve device node 4:2, ignoring: Success

2 years agonspawn: disableOOMKiller should be boolean, not int
Frantisek Sumsal [Mon, 15 May 2023 16:42:08 +0000 (18:42 +0200)] 
nspawn: disableOOMKiller should be boolean, not int

See: https://github.com/opencontainers/runtime-spec/blob/v1.0.0/config-linux.md#memory

2 years agonspawn: modernize the cleanup functions a bit
Frantisek Sumsal [Tue, 16 May 2023 06:19:09 +0000 (08:19 +0200)] 
nspawn: modernize the cleanup functions a bit

2 years agonspawn: avoid NULL pointer dereference
Frantisek Sumsal [Tue, 16 May 2023 06:18:32 +0000 (08:18 +0200)] 
nspawn: avoid NULL pointer dereference

When merging the settings we take the pointer to the array of extra
devices, but don't reset the array counter to zero. This later leads to
a NULL pointer dereference, where device_node_array_free() attempts to
loop over a NULL pointer:

+ systemd-nspawn --oci-bundle=/var/lib/machines/testsuite-13.oci-bundle.Npo
 ../src/nspawn/nspawn-settings.c:118:29: runtime error: member access within null pointer of type 'struct DeviceNode'
     #0 0x4b91ee in device_node_array_free ../src/nspawn/nspawn-settings.c:118
     #1 0x4ba42a in settings_free ../src/nspawn/nspawn-settings.c:161
     #2 0x410b79 in settings_freep ../src/nspawn/nspawn-settings.h:249
     #3 0x446ce8 in load_oci_bundle ../src/nspawn/nspawn.c:4733
     #4 0x44ff42 in run ../src/nspawn/nspawn.c:5476
     #5 0x455296 in main ../src/nspawn/nspawn.c:5919
     #6 0x7f0cb7a4a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)
     #7 0x7f0cb7a4a5c8 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x275c8)
     #8 0x40d284 in _start (/usr/bin/systemd-nspawn+0x40d284)
 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/nspawn/nspawn-settings.c:118:29 in

Also, add an appropriate assert to catch such issues in the future.

2 years agosd-bus: bind outgoing AF_UNIX sockets to abstract addresses conveying client comm...
Lennart Poettering [Fri, 5 May 2023 19:35:19 +0000 (21:35 +0200)] 
sd-bus: bind outgoing AF_UNIX sockets to abstract addresses conveying client comm + bus description string

Let's pass some additional meta information along bus connections
without actually altering the communication protocol.

Pass the client comm and client description string of the bus via
including it in the abstract namespace client socket address we connect
to. This is purely informational (and entirely user controlled), but has
the benefit that servers can make use of the information if they want,
but really don't have to. It works entirely transparently.

This takes inspiration from how we convey similar information via
credential socket connections.