]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agobash-completion: add systemd-dissect support 25068/head
Antonio Alvarez Feijoo [Wed, 19 Oct 2022 12:43:50 +0000 (14:43 +0200)] 
bash-completion: add systemd-dissect support

3 years agodissect: add missing --umount to the help output
Antonio Alvarez Feijoo [Wed, 19 Oct 2022 12:42:42 +0000 (14:42 +0200)] 
dissect: add missing --umount to the help output

3 years agoMerge pull request #25055 from keszybz/coredump-deadlock
Luca Boccassi [Wed, 19 Oct 2022 12:21:33 +0000 (14:21 +0200)] 
Merge pull request #25055 from keszybz/coredump-deadlock

Fix coredump deadlock with overly long backtraces

3 years agoTEST-15: add daemon-reload in one place
Zbigniew Jędrzejewski-Szmek [Wed, 19 Oct 2022 07:56:56 +0000 (09:56 +0200)] 
TEST-15: add daemon-reload in one place

Quoting https://github.com/systemd/systemd/pull/25050#discussion_r998721845:

This part seems to be quite racy, at least in the C8S job:

[ 1767.520856] H testsuite-15.sh[35]: *** test transient slice drop-ins
[ 1767.520856] H testsuite-15.sh[35]: + mkdir -p /etc/systemd/system/slice.d
[ 1767.522480] H testsuite-15.sh[35]: + mkdir -p /etc/systemd/system/a-.slice.d
[ 1767.524992] H testsuite-15.sh[35]: + mkdir -p /etc/systemd/system/a-b-.slice.d
[ 1767.526799] H testsuite-15.sh[35]: + mkdir -p /etc/systemd/system/a-b-c.slice.d
[ 1767.528302] H testsuite-15.sh[35]: + echo -e '[Unit]\nDocumentation=man:drop1'
[ 1767.528434] H testsuite-15.sh[35]: + echo -e '[Unit]\nDocumentation=man:drop2'
[ 1767.528519] H testsuite-15.sh[35]: + echo -e '[Unit]\nDocumentation=man:drop3'
[ 1767.528595] H testsuite-15.sh[35]: + echo -e '[Unit]\nDocumentation=man:drop4'
[ 1767.528676] H testsuite-15.sh[35]: + systemctl cat a-b-c.slice
[ 1767.541321] H systemctl[1042]: No files found for a-b-c.slice.
[ 1767.542854] H systemd[1]: testsuite-15.service: Main process exited, code=exited, status=1/FAILURE
[ 1767.542995] H systemd[1]: testsuite-15.service: Failed with result 'exit-code'.
[ 1767.543360] H systemd[1]: Failed to start testsuite-15.service.
[ 1767.543542] H systemd[1]: testsuite-15.service: Consumed 1.586s CPU time.
[ 1767.543938] H systemd[1]: Reached target testsuite.target.
[ 1767.545737] H systemd[1]: Starting end.service...

3 years agoman: document restrictions on naming interfaces
Lennart Poettering [Wed, 19 Oct 2022 09:38:11 +0000 (11:38 +0200)] 
man: document restrictions on naming interfaces

Let's document that "." is a bad choice of character when naming
interfaces. Let's also document the hard restrictions we make when
naming interfaces.

Result of the mess that is #25052.

3 years agoMerge pull request #25056 from yuwata/sd-device-monitor-set-description
Luca Boccassi [Wed, 19 Oct 2022 11:04:17 +0000 (13:04 +0200)] 
Merge pull request #25056 from yuwata/sd-device-monitor-set-description

tree-wide: set description for device monitor

3 years agoREADME.md: add a missing line break
Frantisek Sumsal [Wed, 19 Oct 2022 09:17:33 +0000 (11:17 +0200)] 
README.md: add a missing line break

Follow-up to b7a279f9ef.

3 years agoci: Enable Scorecard Github Action and Badge (#25054)
Joyce [Wed, 19 Oct 2022 09:05:39 +0000 (06:05 -0300)] 
ci: Enable Scorecard Github Action and Badge (#25054)

* chore: enable scorecard action

* chore: add badge to the README file

* chore: enable on config file update

* chore: update scorecard to 2.0.4

* chore: run scorecard on PR at main branch

* chore: add condition to publish_result key

* chore: skip upload to code scanning if PR

* chore: only runs scorecard in the main repo

Resolves: #25042

3 years agocoredump: avoid deadlock when passing processed backtrace data 25055/head
Zbigniew Jędrzejewski-Szmek [Tue, 18 Oct 2022 16:23:53 +0000 (18:23 +0200)] 
coredump: avoid deadlock when passing processed backtrace data

We would deadlock when passing the data back from the forked-off process that
was doing backtrace generation back to the coredump parent. This is because we
fork the child and wait for it to exit. The child tries to write too much data
to the output pipe, and and after the first 64k blocks on the parent because
the pipe is full. The bug surfaced in Fedora because of a combination of four
factors:
87707784c70dc9894ec613df0a6e75e732a362a3 was backported to v251.5, which
  allowed coredump processing to be successful.
1a0281a3ebf4f8c16d40aa9e63103f16cd23bb2a was NOT backported, so the output
  was very verbose.
- Fedora has the ELF package metadata available, so a lot of output can be
  generated. Most other distros just don't have the information.
- gnome-calendar crashes and has a bazillion modules and 69596 bytes of output
  are generated for it.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2135778.

The code is changed to try to write data opportunistically. If we get partial
information, that is still logged. In is generally better to log partial
backtrace information than nothing at all.

3 years agoshared/json: use different return code for empty input
Zbigniew Jędrzejewski-Szmek [Wed, 19 Oct 2022 06:41:13 +0000 (08:41 +0200)] 
shared/json: use different return code for empty input

It is useful to distinguish if json_parse_file() got no input or invalid input.
Use different return codes for the two cases.

3 years agotest: skip one test for iszero_safe() on i386 without SSE2
Yu Watanabe [Tue, 18 Oct 2022 12:23:26 +0000 (21:23 +0900)] 
test: skip one test for iszero_safe() on i386 without SSE2

We do not provide any numerical libraries, and iszero_safe() is only
used in parsing or formatting JSON. Hence, it is not necessary for us to
request that the function provides the same result on different systems.

Fixes #25044.

3 years agotree-wide: set description for device manager 25056/head
Yu Watanabe [Tue, 18 Oct 2022 19:46:24 +0000 (04:46 +0900)] 
tree-wide: set description for device manager

3 years agoudev: drop redundant description setting
Yu Watanabe [Tue, 18 Oct 2022 19:45:10 +0000 (04:45 +0900)] 
udev: drop redundant description setting

Follow-up for f714ecd450828e45a6f04e6277011d67a10c323f.

3 years agoMerge pull request #25050 from keszybz/transient-drop-ins-2
Luca Boccassi [Tue, 18 Oct 2022 17:32:36 +0000 (19:32 +0200)] 
Merge pull request #25050 from keszybz/transient-drop-ins-2

TEST-15: add one more variant of the test for drop-ins on transient services

3 years agoshared/json: allow json_variant_dump() to return an error
Zbigniew Jędrzejewski-Szmek [Tue, 18 Oct 2022 16:09:06 +0000 (18:09 +0200)] 
shared/json: allow json_variant_dump() to return an error

3 years agoNEWS: add entries after 252-rc1, update contrib list v252-rc2
Zbigniew Jędrzejewski-Szmek [Tue, 18 Oct 2022 12:30:54 +0000 (14:30 +0200)] 
NEWS: add entries after 252-rc1, update contrib list

3 years agoTODO: drop entry 25050/head
Zbigniew Jędrzejewski-Szmek [Tue, 18 Oct 2022 10:29:09 +0000 (12:29 +0200)] 
TODO: drop entry

This was resolved by 028a981c005e90c36c269e28709bf25032c2e8ca. We don't do
the reload in the normal path.

3 years agoTEST-15: add test that shows slice dropin issue
Zbigniew Jędrzejewski-Szmek [Tue, 18 Oct 2022 10:01:38 +0000 (12:01 +0200)] 
TEST-15: add test that shows slice dropin issue

This should be fixed by single-unit reloads. We already have a TODO
entry for this.

3 years agoupdate TODO
Lennart Poettering [Tue, 18 Oct 2022 10:08:53 +0000 (12:08 +0200)] 
update TODO

3 years agoMerge pull request #25004 from keszybz/transient-drop-ins
Luca Boccassi [Tue, 18 Oct 2022 09:49:29 +0000 (11:49 +0200)] 
Merge pull request #25004 from keszybz/transient-drop-ins

Allow drop-ins for transient units

3 years agoMerge pull request #25007 from keszybz/rename-dbus-dump
Zbigniew Jędrzejewski-Szmek [Tue, 18 Oct 2022 09:34:16 +0000 (11:34 +0200)] 
Merge pull request #25007 from keszybz/rename-dbus-dump

manager: rename dbus method

3 years agomanager: use target process context to set socket context
Ted X. Toth [Thu, 13 Oct 2022 19:58:26 +0000 (12:58 -0700)] 
manager: use target process context to set socket context

Use target process context to set socket context when using SELinuxContextFromNet
not systemd's context. Currently when using the SELinuxContextFromNet option for
a socket activated services, systemd calls getcon_raw which returns init_t and
uses the resulting context to compute the context to be passed to the
setsockcreatecon call. A socket of type init_t is created and listened on and
this means that SELinux policy cannot be written to control which processes
(SELinux types) can connect to the socket since the ref policy allows all
'types' to connect to sockets of the type init_t. When security accessors see
that any process can connect to a socket this raises serious concerns. I have
spoken with SELinux contributors in person and on the mailing list and the
consensus is that the best solution is to use the target executables context
when computing the sockets context in all cases.

[zjs review/comment:

This removes the branch that was added in 16115b0a7b7cdf08fb38084d857d572d8a9088dc.
16115b0a7b7cdf08fb38084d857d572d8a9088dc did two things: it had the branch here
in 'socket_determine_selinux_label()' and a code in 'exec_child()' to call
'label_get_child_mls_label(socket_fd, command->path, &label)'.

Before this patch, the flow was:
'''
mac_selinux_get_child_mls_label:
  peercon = getpeercon_raw(socket_fd);
  if (!exec_label)
     exec_label = getfilecon_raw(exe);

socket_open_fds:
  if (params->selinux_context_net)                 #
     label = mac_selinux_get_our_label();          #  this part is removed
  else                                             #
     label = mac_selinux_get_create_label_from_exe(path);
  socket_address_listen_in_cgroup(s, &p->address, label);

exec_child():
   exec_context = mac_selinux_get_child_mls_label(fd, executable, context->selinux_context);
   setexeccon(exec_context);
'''
]

3 years agoanalyze: use DumpUnitsMatchingPatternsByFileDescriptor 25007/head
Zbigniew Jędrzejewski-Szmek [Mon, 17 Oct 2022 13:03:16 +0000 (15:03 +0200)] 
analyze: use DumpUnitsMatchingPatternsByFileDescriptor

Similarly to DumpByFileDescriptor vs Dump,
DumpUnitsMatchingPatternsByFileDescriptor is used in preference. Dissimilarly,
a fallback to DumpUnitsMatchingPatterns is not done on error, because there is
no need for backwards compatibility.

The code is still more verbose than I'd like, but there are four different code
paths with slightly different rules in each case, so it's hard to make this all
very brief. Since we have a separate file dedicated to making those calls, the
verbose-but-easy-to-follow implementation should be OK.

Closes #24989.

I only did a quick test that all both variants works locally and over ssh.

3 years agoMerge pull request #24777 from medhefgo/stub
Zbigniew Jędrzejewski-Szmek [Tue, 18 Oct 2022 05:36:20 +0000 (07:36 +0200)] 
Merge pull request #24777 from medhefgo/stub

stub: Use LoadImage/StartImage

3 years agoMerge pull request #25035 from keszybz/manager-method-names
Luca Boccassi [Mon, 17 Oct 2022 21:11:13 +0000 (23:11 +0200)] 
Merge pull request #25035 from keszybz/manager-method-names

Manager method names

3 years agotest: call sync() before checking the test logs
Frantisek Sumsal [Mon, 17 Oct 2022 16:11:21 +0000 (18:11 +0200)] 
test: call sync() before checking the test logs

Otherwise we might hit a race where we read the test log just before
it's fully written to the disk:

```
======================================================================
FAIL: test_interleaved (__main__.ExecutionResumeTest.test_interleaved)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/systemd/test/test-exec-deserialization.py", line 170, in test_interleaved
    self.check_output(expected_output)
  File "/root/systemd/test/test-exec-deserialization.py", line 111, in check_output
    self.assertEqual(output, expected_output)
AssertionError: 'foo\n' != 'foo\nbar\n'
  foo
+ bar
```

With some debug:
```
test_interleaved (__main__.ExecutionResumeTest.test_interleaved) ...
Assertion failed; file contents just after the assertion:
b'foo\n'

File contents 5 seconds later:
b'foo\nbar\n'
FAIL
```

Seen quite often in CentOS CI on the fast baremetal machines.

3 years agoMerge pull request #25039 from mrc0mmand/test-tewaks
Luca Boccassi [Mon, 17 Oct 2022 19:52:00 +0000 (21:52 +0200)] 
Merge pull request #25039 from mrc0mmand/test-tewaks

A couple of minor tweaks for recent CI fails

3 years agoMerge pull request #24992 from yuwata/sd-device-monitor-receive-buffer
Zbigniew Jędrzejewski-Szmek [Mon, 17 Oct 2022 18:49:18 +0000 (20:49 +0200)] 
Merge pull request #24992 from yuwata/sd-device-monitor-receive-buffer

sd-device-monitor: dynamically allocate receive buffer

3 years agoman: add missing reference to systemd-pcrphase-sysinit.service
Lennart Poettering [Mon, 17 Oct 2022 13:21:49 +0000 (15:21 +0200)] 
man: add missing reference to systemd-pcrphase-sysinit.service

3 years agoMerge pull request #25036 from keszybz/plurals
Luca Boccassi [Mon, 17 Oct 2022 15:12:16 +0000 (17:12 +0200)] 
Merge pull request #25036 from keszybz/plurals

Remove usage of "noun(s)" in messages and docs

3 years agoxdg-autostart-service: Add comments to tilde expansion, use path_join()
David Edmundson [Tue, 11 Oct 2022 10:18:13 +0000 (11:18 +0100)] 
xdg-autostart-service: Add comments to tilde expansion, use path_join()

Follow-ups for https://github.com/systemd/systemd/pull/24658

3 years agoUpdate TODO
Daan De Meyer [Mon, 17 Oct 2022 14:06:39 +0000 (16:06 +0200)] 
Update TODO

3 years agomkosi: Switch to Fedora 37
Daan De Meyer [Mon, 17 Oct 2022 12:53:16 +0000 (14:53 +0200)] 
mkosi: Switch to Fedora 37

Official release date is close so let's switch mkosi CI to it already.

3 years agomeson: drop repeated output in error message 25036/head
Zbigniew Jędrzejewski-Szmek [Mon, 17 Oct 2022 12:01:16 +0000 (14:01 +0200)] 
meson: drop repeated output in error message

3 years agotree-wide: replace "plural(s)" by "plurals"
Zbigniew Jędrzejewski-Szmek [Sat, 15 Oct 2022 14:06:20 +0000 (16:06 +0200)] 
tree-wide: replace "plural(s)" by "plurals"

(s) is just ugly with a vibe of DOS. In most cases just using the normal plural
form is more natural and gramatically correct.

There are some log_debug() statements left, and texts in foreign licenses or
headers. Those are not touched on purpose.

3 years agomanager: add DumpUnitsMatchingPatternsByFileDescriptor()
Zbigniew Jędrzejewski-Szmek [Mon, 17 Oct 2022 12:23:04 +0000 (14:23 +0200)] 
manager: add DumpUnitsMatchingPatternsByFileDescriptor()

3 years agotest: use SIGKILL to kill the container if necessary 25039/head
Frantisek Sumsal [Mon, 17 Oct 2022 13:00:12 +0000 (15:00 +0200)] 
test: use SIGKILL to kill the container if necessary

TEST-69 uses a Python wrapper around the systemd-nspawn call, which on
error calls the `spawn.terminate()` method. However, with no arguments
it will only use SIGHUP and SIGINT signals - this might leave a stuck
container around, causing fails if the test is run again. With `force=True`
SIGKILL is used as well (if necessary).

3 years agotest: add test for large uevent message 24992/head
Yu Watanabe [Mon, 17 Oct 2022 12:48:27 +0000 (21:48 +0900)] 
test: add test for large uevent message

3 years agoboot: Rework shim image verification 24777/head
Jan Janssen [Fri, 14 Oct 2022 09:09:12 +0000 (11:09 +0200)] 
boot: Rework shim image verification

This moves the shim security arch override to the new
ReinstallProtocolInterface based interface. This also has the benefit to
reduce the time window in which we have this override active and also
actually removes it, which was not previously done.

The shim hooks themselves are also modernized too. The upcalls should
really not be neccessary if shim is happy with the provided binary.

3 years agosd-device-monitor: dynamically allocate receive buffer
Yu Watanabe [Thu, 13 Oct 2022 16:18:47 +0000 (01:18 +0900)] 
sd-device-monitor: dynamically allocate receive buffer

If udevd broadcasts a processed device with huge amount of properties,
then clients cannot receive the device.

Fixes #24987.

3 years agostub: Allow loading unsigned kernel images
Jan Janssen [Wed, 21 Sep 2022 10:56:20 +0000 (12:56 +0200)] 
stub: Allow loading unsigned kernel images

3 years agoboot: Use proper security arch protocol names
Jan Janssen [Wed, 21 Sep 2022 10:39:46 +0000 (12:39 +0200)] 
boot: Use proper security arch protocol names

This is how the Platform Intregration Specification defines these.

3 years agoboot: Remove unused parameters from pe_kernel_info
Jan Janssen [Wed, 21 Sep 2022 10:23:36 +0000 (12:23 +0200)] 
boot: Remove unused parameters from pe_kernel_info

Only the compat entry address is used now. This also now only returns
the compat entry address. If the image is native we do not need to try
calling into the entry address again as we would already have done so
from StartImage (and failed).

3 years agostub: Use LoadImage/StartImage to start the kernel
Jan Janssen [Wed, 21 Sep 2022 09:07:53 +0000 (11:07 +0200)] 
stub: Use LoadImage/StartImage to start the kernel

This is the proper way to start any EFI binary. The fact this even ever
worked was because the kernel does not have any PE relocations.

The only downside is that the embedded kernel image has to be signed and
trusted by the firmware under secure boot. A future commit will try to
deal with that.

3 years agostub: Rename image parameter
Jan Janssen [Wed, 21 Sep 2022 08:42:40 +0000 (10:42 +0200)] 
stub: Rename image parameter

This is really the parent image for the kernel that is to be run.
Renaming it as such prevents confusion with any image handles that are
about to be created.

3 years agotest: drop one layer of escaping
Frantisek Sumsal [Mon, 17 Oct 2022 12:38:00 +0000 (14:38 +0200)] 
test: drop one layer of escaping

3 years agotest: ignore gcov errors in TEST-34
Frantisek Sumsal [Mon, 17 Oct 2022 12:31:25 +0000 (14:31 +0200)] 
test: ignore gcov errors in TEST-34

TEST-34 complains in `test_check_writable` when running with gcov, as
the build directory tree is not writable with DynamicUser=true. As I had
no luck with $GCOV_PREFIX and other runtime gcov configuration, let's
just ignore the gcov errors for this test.

3 years agocryptsetup: drop redundant parens/drop ternary op
Lennart Poettering [Sun, 16 Oct 2022 22:14:21 +0000 (00:14 +0200)] 
cryptsetup: drop redundant parens/drop ternary op

A ternary op is a bit weird to use if we end up assigning a variable to
itself in one of the branches. Hence use a plain if check.

3 years agoman: fix method name 25035/head
Zbigniew Jędrzejewski-Szmek [Mon, 17 Oct 2022 09:31:52 +0000 (11:31 +0200)] 
man: fix method name

3 years agocore: simplify the return convention in manager_load_unit()
Zbigniew Jędrzejewski-Szmek [Mon, 17 Oct 2022 08:48:52 +0000 (10:48 +0200)] 
core: simplify the return convention in manager_load_unit()

This function was returning 0 or 1 on success. It has many callers, and it
wasn't clear if any of them care about the distinction. It turns out they don't
and the return values were done for convenience because manager_load_unit_prepare()
returns 0 or 1. Let's invert the code in the static function to follow the usual
pattern where 0 means "no work was done" and 1 means "work was done", and make
the non-static function always return 0 to make the code easier to read, and
also add comments that explain what is happening.

No functional change.

3 years agocore: modernize style of return param naming
Zbigniew Jędrzejewski-Szmek [Mon, 17 Oct 2022 07:01:12 +0000 (09:01 +0200)] 
core: modernize style of return param naming

3 years agoMerge pull request #24919 from anitazha/varlinkserialize
Zbigniew Jędrzejewski-Szmek [Mon, 17 Oct 2022 11:44:28 +0000 (13:44 +0200)] 
Merge pull request #24919 from anitazha/varlinkserialize

varlink/pid1 fixes for systemd-oomd (addresses #20330)

3 years agoMerge pull request #24986 from keszybz/news-systemd-measure
Zbigniew Jędrzejewski-Szmek [Mon, 17 Oct 2022 11:24:07 +0000 (13:24 +0200)] 
Merge pull request #24986 from keszybz/news-systemd-measure

NEWS: rework the description of systemd-measure a bit again

3 years agopcrphase: fix --help text
Lennart Poettering [Mon, 17 Oct 2022 10:27:41 +0000 (12:27 +0200)] 
pcrphase: fix --help text

We don't take a command, we just take a "word" which we'll extend into
PCR 11.

3 years agopcrphase: add two additional phases
Lennart Poettering [Fri, 14 Oct 2022 18:53:42 +0000 (20:53 +0200)] 
pcrphase: add two additional phases

This adds two more phases to the PCR boot phase logic: "sysinit" +
"final".

The "sysinit" one is placed between sysinit.target and basic.target.
It's good to have a milestone in this place, since this is after all
file systems/LUKS volumes are in place (which sooner or later should
result in measurements of their own) and before services are started
(where we should be able to rely on them to be complete).

This is particularly useful to make certain secrets available for
mounting secondary file systems, but making them unavailable later.

This breaks API in a way (as measurements during runtime will change),
but given that the pcrphase stuff wasn't realeased yet should be OK.

3 years agotests: add nspawn's rootidmap integration test
Quentin Deslandes [Tue, 6 Sep 2022 13:42:43 +0000 (14:42 +0100)] 
tests: add nspawn's rootidmap integration test

Add integration test to testsuite-13.sh to ensure rootidmap option map
user IDs as expected.

3 years agoMerge pull request #24938 from msizanoen1/journald-harden-clock-jump
Luca Boccassi [Mon, 17 Oct 2022 10:00:02 +0000 (12:00 +0200)] 
Merge pull request #24938 from msizanoen1/journald-harden-clock-jump

journald: harden against forward clock jumps before unclean shutdown

3 years agoMerge pull request #25003 from DaanDeMeyer/mkosi-fixes
Luca Boccassi [Mon, 17 Oct 2022 09:36:55 +0000 (11:36 +0200)] 
Merge pull request #25003 from DaanDeMeyer/mkosi-fixes

mkosi: Add Centos Stream 8 back to CI

3 years agoupdate TODO
Lennart Poettering [Sun, 16 Oct 2022 16:16:53 +0000 (18:16 +0200)] 
update TODO

3 years agomkosi: Add Centos Stream 8 back to CI 25003/head
Daan De Meyer [Fri, 14 Oct 2022 12:30:12 +0000 (14:30 +0200)] 
mkosi: Add Centos Stream 8 back to CI

We can build all of systemd's features again on CentOS Stream 8, so
let's add it back to CI.

3 years agomkosi: Make sure bpf-framework works on CentOS Stream 8 as well
Daan De Meyer [Fri, 14 Oct 2022 12:53:41 +0000 (14:53 +0200)] 
mkosi: Make sure bpf-framework works on CentOS Stream 8 as well

3 years agoREADME: Fix libbpf minimum version
Daan De Meyer [Fri, 14 Oct 2022 12:27:48 +0000 (14:27 +0200)] 
README: Fix libbpf minimum version

This didn't get properly updated as part of #24511

3 years agomkosi: Reenable bpf-framework
Daan De Meyer [Fri, 14 Oct 2022 12:26:50 +0000 (14:26 +0200)] 
mkosi: Reenable bpf-framework

This got changed by mistake by #24511. Since we still support the
same libbpf version, we can keep this enabled everywhere.

3 years agoqrcode-util: Add support for libqrencode 3.0
Daan De Meyer [Fri, 14 Oct 2022 12:21:43 +0000 (14:21 +0200)] 
qrcode-util: Add support for libqrencode 3.0

They didn't actually change API between major versions, so let's
support the previous version as well so we can add CentOS 8 Stream
back to CI.

3 years agostub: Fix booting with old kernels
Jan Janssen [Sun, 16 Oct 2022 07:36:21 +0000 (09:36 +0200)] 
stub: Fix booting with old kernels

This fixes a regression introduced in e1636807 that removed setting this
value as it seemingly was not used by the kernel and would actively
break above 4G boots. But old kernels (4.18 in particular) will not boot
properly if it is not filled out by us.
The original issue was using the truncated value to then jump into the
kernel entry point, which we do not do anymore. So setting this value
again on newer kernels is fine.

3 years agogpt-auto: rename all functions that operate on a DissectedPartition object add_partit...
Lennart Poettering [Fri, 14 Oct 2022 13:46:04 +0000 (15:46 +0200)] 
gpt-auto: rename all functions that operate on a DissectedPartition object add_partition_xyz()

The function for handling regular mounts based on DissectedPartition
objects is called add_partition_mount(), so let's follow this scheme for
all other functions that handle them, too. This nicely separates out the
low-level functions (which get split up args) from the high-level
functions (which get a DissectedPartition object): the latter are called
add_partition_xyz() the former just add_xyz().

This makes naming a bit more systematic. No change in behaviour.

3 years agogenerator: modernize generator_open_unit_file()
Lennart Poettering [Sun, 16 Oct 2022 20:37:26 +0000 (22:37 +0200)] 
generator: modernize generator_open_unit_file()

3 years agogpt-auto-generator: use our usual ret_xyz parameter naming
Lennart Poettering [Fri, 14 Oct 2022 13:30:06 +0000 (15:30 +0200)] 
gpt-auto-generator: use our usual ret_xyz parameter naming

3 years agoman: mention that pcrphase also measures into PCR 11
Lennart Poettering [Fri, 14 Oct 2022 13:27:53 +0000 (15:27 +0200)] 
man: mention that pcrphase also measures into PCR 11

3 years agocryptsetup: use errno-flavoured logging where we have an errno
Lennart Poettering [Fri, 14 Oct 2022 12:42:37 +0000 (14:42 +0200)] 
cryptsetup: use errno-flavoured logging where we have an errno

3 years agotpm2-util: fix parameter name
Lennart Poettering [Tue, 11 Oct 2022 16:22:21 +0000 (18:22 +0200)] 
tpm2-util: fix parameter name

3 years agoTEST-15: add one more test for drop-in precedence 25004/head
Zbigniew Jędrzejewski-Szmek [Sun, 16 Oct 2022 19:52:43 +0000 (21:52 +0200)] 
TEST-15: add one more test for drop-in precedence

3 years agojournal: fix indentation in managed_journal_file_open_reliably 24938/head
msizanoen1 [Tue, 11 Oct 2022 11:16:41 +0000 (18:16 +0700)] 
journal: fix indentation in managed_journal_file_open_reliably

3 years agojournald: harden against forward clock jumps before unclean shutdown
msizanoen1 [Sat, 8 Oct 2022 12:41:18 +0000 (19:41 +0700)] 
journald: harden against forward clock jumps before unclean shutdown

Try harder to inherit the sequence number and ID from the old journal
file before rotating it away.

This helps the libsystemd journal file selection code make better decisions
even in the face of massive incorrect forward clock jumps prior to an
unclean shutdown.

3 years agoTEST-15: add test for transient units with drop-ins
Zbigniew Jędrzejewski-Szmek [Sun, 16 Oct 2022 12:02:45 +0000 (14:02 +0200)] 
TEST-15: add test for transient units with drop-ins

We want to test four things:
- that the transient units are successfully started when drop-ins exist
- that the transient setings override the defaults
- the drop-ins override the transient settings (the same as for a normal unit)
- that things are the same before and after a reload

To make things more fun, we start and stop units in two different ways: via
systemctl and via a direct busctl invocation. This gives us a bit more coverage
of different code paths.

3 years agoTEST-15: also test hierarchical drop-ins for slices
Zbigniew Jędrzejewski-Szmek [Sun, 16 Oct 2022 10:54:34 +0000 (12:54 +0200)] 
TEST-15: also test hierarchical drop-ins for slices

Slices are worth testing too, because they don't need a fragment path so they
behave slightly differently than service units. I'm making this a separate
patch from the actual tests that I wanted to add later because it's complex
enough on its own.

3 years agoTEST-15: allow helper functions to accept other unit types
Zbigniew Jędrzejewski-Szmek [Sun, 16 Oct 2022 10:42:35 +0000 (12:42 +0200)] 
TEST-15: allow helper functions to accept other unit types

clear_services() is renamed to clear_units() and now takes a full
unit name including the suffix as an argument.

_clear_service() is renamed to clear_unit() and changed likewise.
create_service() didn't have the same underscore prefix, and I don't think
it's useful or needed for a local function, so it is removed.

No functional change.

3 years agomanager: allow transient units to have drop-ins
Zbigniew Jędrzejewski-Szmek [Fri, 14 Oct 2022 13:02:20 +0000 (15:02 +0200)] 
manager: allow transient units to have drop-ins

In https://github.com/containers/podman/issues/16107, starting of a transient
slice unit fails because there's a "global" drop-in
/usr/lib/systemd/user/slice.d/10-oomd-per-slice-defaults.conf (provided by
systemd-oomd-defaults package to install some default oomd policy). This means
that the unit_is_pristine() check fails and starting of the unit is forbidden.

It seems pretty clear to me that dropins at any other level then the unit
should be ignored in this check: we now have multiple layers of drop-ins
(for each level of the cgroup path, and also "global" ones for a specific
unit type). If we install a "global" drop-in, we wouldn't be able to start
any transient units of that type, which seems undesired.

In principle we could reject dropins at the unit level, but I don't think that
is useful. The whole reason for drop-ins is that they are "add ons", and there
isn't any particular reason to disallow them for transient units. It would also
make things harder to implement and describe: one place for drop-ins is good,
but another is bad. (And as a corner case: for instanciated units, a drop-in
in the template would be acceptable, but a instance-specific drop-in bad?)

Thus, $subject.

While at it, adjust the message. All the conditions in unit_is_pristine()
essentially mean that it wasn't loaded (e.g. it might be in an error state),
and that it doesn't have a fragment path (now that drop-ins are acceptable).
If there's a job for it, it necessarilly must have been loaded. If it is
merged into another unit, it also was loaded and found to be an alias.
Based on the discussion in the bugs, it seems that the current message
is far from obvious ;)

Fixes https://github.com/containers/podman/issues/16107,
https://bugzilla.redhat.com/show_bug.cgi?id=2133792.

3 years agoseccomp: add riscv_flush_icache to allow list
Celeste Liu [Sun, 16 Oct 2022 02:47:17 +0000 (10:47 +0800)] 
seccomp: add riscv_flush_icache to allow list

This system call is harmless because it only enforces ordering between stores
and instruction cache fetch.

fixed #24991
Related: https://github.com/felixonmars/archriscv-packages/issues/1840

Signed-off-by: Celeste Liu <CoelacanthusHex@gmail.com>
3 years agoudev: drop unused source file
Yu Watanabe [Sat, 15 Oct 2022 00:30:22 +0000 (09:30 +0900)] 
udev: drop unused source file

Follow-up for 5bbcfbaa11a92732f9bbc8d5f77e9311e6ac3d56.

3 years agoseccomp: drop per arch conditionalization in filter groups
Lennart Poettering [Fri, 14 Oct 2022 16:02:31 +0000 (18:02 +0200)] 
seccomp: drop per arch conditionalization in filter groups

We list plenty of arch-specific syscalls in our filter groups, treat the
s390 syscalls the same.

We handle gracefully anyway if some syscall doesn't exist locally on the
kernel or arch, let's rely on it. This has the benefit that
"systemd-analyze" will comprehensively tell you the syscalls filtered on
any arch for any arch.

And less conditionalization is good anyway.

3 years agoUpdate list of partition type identifiers
Pyfisch [Fri, 14 Oct 2022 19:32:47 +0000 (21:32 +0200)] 
Update list of partition type identifiers

Include verity sig partition identifiers.
List all supported CPU architectures.

3 years agoDocument two systemd-repart options in man page
Pyfisch [Fri, 14 Oct 2022 18:43:16 +0000 (20:43 +0200)] 
Document two systemd-repart options in man page

Note --private-key and --certificate options for configuring
verity signature partitions in the listing of options.

Adjust one error message referring to the --certificate option.

3 years agoupdate TODO
Lennart Poettering [Fri, 14 Oct 2022 11:05:37 +0000 (13:05 +0200)] 
update TODO

3 years agobasic/mountpoint-util: skip dependency on quota services for some filesystems
Thomas Blume [Thu, 29 Sep 2022 12:50:48 +0000 (14:50 +0200)] 
basic/mountpoint-util:  skip dependency on quota services for some filesystems

3 years agoMerge pull request #25002 from poettering/install-type-fix
Luca Boccassi [Fri, 14 Oct 2022 18:56:44 +0000 (20:56 +0200)] 
Merge pull request #25002 from poettering/install-type-fix

install: make InstallChangeType enum a proper enum

3 years agocore: only allow systemd-oomd to use SubscribeManagedOOMCGroups 24919/head
Anita Zhang [Wed, 5 Oct 2022 08:40:40 +0000 (01:40 -0700)] 
core: only allow systemd-oomd to use SubscribeManagedOOMCGroups

Attempt to address
https://github.com/systemd/systemd/issues/20330#issuecomment-1210028422.

Summary of the comment: Unprivileged users can potentially cause a denial of
service during systemd-oomd unit subscriptions by spamming requests to
SubscribeManagedOOMCGroups. As systemd-oomd.service is the only unit that
should be accessing this method, add a check on the caller's unit name to deter
them from successfully using this method.

3 years agocore: serialize/deserialize varlink sockets for pid1
Anita Zhang [Wed, 5 Oct 2022 07:13:32 +0000 (00:13 -0700)] 
core: serialize/deserialize varlink sockets for pid1

Fixes #20330

3 years agomanager: rename dbus method
Zbigniew Jędrzejewski-Szmek [Fri, 14 Oct 2022 16:29:14 +0000 (18:29 +0200)] 
manager: rename dbus method

Fixes #24989.

3 years agoelf-util: drop assertion for metadata in report_module_metadata()
Yu Watanabe [Fri, 14 Oct 2022 08:18:41 +0000 (17:18 +0900)] 
elf-util: drop assertion for metadata in report_module_metadata()

Fixes a bug introduced by 1a0281a3ebf4f8c16d40aa9e63103f16cd23bb2a.

Fixes RHBZ#2134741 (https://bugzilla.redhat.com/show_bug.cgi?id=2134741).

3 years agoshared/logs-show: do not overwrite journal time in export format with source timestamps
msizanoen1 [Wed, 12 Oct 2022 06:40:05 +0000 (13:40 +0700)] 
shared/logs-show: do not overwrite journal time in export format with source timestamps

Using _SOURCE_{MONOTONIC,REALTIME}_TIMESTAMP in place of the results of
sd_journal_get_{monotonic,realtime}_usecs in export formats might cause
internal inconsistency of realtime timestamp values within a journal export,
violating the export file format and causing systemd-journal-remote to
mass-generate journal files.

Fix this by using the real journal timestamps for
__{REALTIME,MONOTONIC}_TIMESTAMP.

3 years agoman: reword some awkward sentences 24986/head
Zbigniew Jędrzejewski-Szmek [Thu, 13 Oct 2022 20:30:48 +0000 (22:30 +0200)] 
man: reword some awkward sentences

3 years agoNEWS: rework the description of systemd-measure a bit again
Zbigniew Jędrzejewski-Szmek [Wed, 12 Oct 2022 15:05:27 +0000 (17:05 +0200)] 
NEWS: rework the description of systemd-measure a bit again

Try to separate the description so that changes are described first, and the
discussion follows separately. Remove some repeated verbose descriptions of the
subject: if one sentence describes that UKI contains an signature and describes
it in detail, the next sentence can just say "the signature" without
elaborating. Also, we don't do version-keying yet, so don't say "future"
kernels — older kernels will work too.

3 years agomanager: reformat boolean expression in unit_is_pristine()
Zbigniew Jędrzejewski-Szmek [Fri, 14 Oct 2022 12:40:24 +0000 (14:40 +0200)] 
manager: reformat boolean expression in unit_is_pristine()

Not not IN_SET(…) is just too much for my poor brain. Let's invert
the expression to make it easier to undertand.

3 years agoudev-builtin-kmod: support to run without arguments
Yu Watanabe [Fri, 14 Oct 2022 07:18:35 +0000 (16:18 +0900)] 
udev-builtin-kmod: support to run without arguments

If no module name is provided, then try to load modules based on the
device modealias.

Previously, MODALIAS property is passed as an argument, but it may
contain quotation. Hence, unfortunately the modalias may be modified
and cannot load expected modules.

Fixes #24715.

3 years agoinstall: include full type name in special UnitFilePresetMode values 25002/head
Lennart Poettering [Fri, 14 Oct 2022 09:12:19 +0000 (11:12 +0200)] 
install: include full type name in special UnitFilePresetMode values

Typically the _MAX and _INVALID special enum values use the full type as
prefix, even if the actual values of the enum might not. Let's follow
this rule here too.

3 years agoinstall: make InstallChange enum type a proper type
Lennart Poettering [Fri, 14 Oct 2022 09:11:53 +0000 (11:11 +0200)] 
install: make InstallChange enum type a proper type

We can just make this an enum, as long as we ensure it has enough range,
which we can do by adding -ERRNO_MAX as one possible value (at least on
GNU C). We already do that at multiple other places, so let's do this
here too.

3 years agoupdate TODO
Lennart Poettering [Fri, 14 Oct 2022 09:32:43 +0000 (11:32 +0200)] 
update TODO

3 years agocore: refactor manager varlink init
Anita Zhang [Wed, 5 Oct 2022 07:12:53 +0000 (00:12 -0700)] 
core: refactor manager varlink init

Split out per-socket code into a separate function to use as part of
serialize/deserialize in the next commit.

3 years agovarlink: refactor adding socket event source to the event loop
Anita Zhang [Tue, 11 Oct 2022 09:36:32 +0000 (02:36 -0700)] 
varlink: refactor adding socket event source to the event loop