]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agopid1: voidify manager_override_watchdog() 22037/head
Yu Watanabe [Thu, 6 Jan 2022 12:21:41 +0000 (21:21 +0900)] 
pid1: voidify manager_override_watchdog()

As it always returns 0.

3 years agowatchdog: rebreak comments
Yu Watanabe [Thu, 6 Jan 2022 12:11:21 +0000 (21:11 +0900)] 
watchdog: rebreak comments

3 years agowatchdog: shorten watchdog_set_device()
Franck Bui [Fri, 7 Jan 2022 08:28:44 +0000 (09:28 +0100)] 
watchdog: shorten watchdog_set_device()

3 years agobpf: do not freeze if bpf lsm fails to set up
Julia Kartseva [Thu, 6 Jan 2022 00:34:56 +0000 (16:34 -0800)] 
bpf: do not freeze if bpf lsm fails to set up

BPF LSM is cgroup unaware and it's set up is happening in core manager.
It occures that the current implementation is too restrictive and causes
pid 1 to freeze.
Instead:
* in bpf_lsm_setup set manager->restrict_fs pointer last,
so it is an indicator that the set up was successful
* check for manager->restrict_fs before applying unit options

3 years agoMerge pull request #22031 from floppym/issue22001-1
Yu Watanabe [Fri, 7 Jan 2022 03:28:47 +0000 (12:28 +0900)] 
Merge pull request #22031 from floppym/issue22001-1

test-watchdog adjustments

3 years agotest-watchdog: set timeout to 2 seconds by default 22031/head
Mike Gilbert [Thu, 6 Jan 2022 19:12:33 +0000 (14:12 -0500)] 
test-watchdog: set timeout to 2 seconds by default

Some hardware/drivers do not handle a 1 second timeout properly.

Fixes: https://github.com/systemd/systemd/issues/22001
3 years agotest-watchdog: use watchdog_runtime_wait() to determine sleep interval
Mike Gilbert [Thu, 6 Jan 2022 19:09:30 +0000 (14:09 -0500)] 
test-watchdog: use watchdog_runtime_wait() to determine sleep interval

As sugggested in
https://github.com/systemd/systemd/issues/22001#issuecomment-1006755438.

3 years agouserdbctl: fix "Password OK" shown even when password is empty or locked (#21308)
Pigmy-penguin [Thu, 6 Jan 2022 16:01:38 +0000 (17:01 +0100)] 
userdbctl: fix "Password OK" shown even when password is empty or locked (#21308)

userdbctl: fix "Password OK" shown even when password is empty or locked

3 years agotree-wide: fix typo
Yu Watanabe [Thu, 6 Jan 2022 13:20:11 +0000 (22:20 +0900)] 
tree-wide: fix typo

3 years agoNEWS: sort entries
Yu Watanabe [Thu, 6 Jan 2022 13:18:05 +0000 (22:18 +0900)] 
NEWS: sort entries

3 years agooomd: move oomctl to bindir
Michael Biebl [Wed, 5 Jan 2022 21:14:14 +0000 (22:14 +0100)] 
oomd: move oomctl to bindir

We don't really need oomctl during early boot, so bindir seems like a
more suitable place for the binary.

3 years agotest-watchdog: mark as unsafe
Mike Gilbert [Wed, 5 Jan 2022 04:43:10 +0000 (23:43 -0500)] 
test-watchdog: mark as unsafe

If something goes wrong with this test it may result in an unsafe
system restart. Let's avoid running it automatically.

See https://github.com/systemd/systemd/issues/22001.

3 years agorandom-seed: cleanup code nits
Jason A. Donenfeld [Wed, 5 Jan 2022 13:36:13 +0000 (14:36 +0100)] 
random-seed: cleanup code nits

This incorporates various nits from the post-merge review on #21986.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
3 years agoMerge pull request #22018 from keszybz/logind-survive-aborted-suspend
Yu Watanabe [Wed, 5 Jan 2022 17:08:14 +0000 (02:08 +0900)] 
Merge pull request #22018 from keszybz/logind-survive-aborted-suspend

Make logind survive aborted suspend

3 years agoMerge pull request #22016 from yuwata/small-cleanups
Yu Watanabe [Wed, 5 Jan 2022 16:18:34 +0000 (01:18 +0900)] 
Merge pull request #22016 from yuwata/small-cleanups

assorted trivial cleanups

3 years agotest: use full date & time when checking for coredumps
Frantisek Sumsal [Wed, 5 Jan 2022 11:06:52 +0000 (12:06 +0100)] 
test: use full date & time when checking for coredumps

Otherwise we might hit a window where the coredump happens before
midnight, but we check for it after midnight, which yields no results.

E.g.:

```
$ coredumpctl --no-legend --no-pager --file system.journal
Wed 2022-01-05 01:00:06 CET 359 0 0 SIGABRT journal /usr/bin/udevadm n/a
$ coredumpctl --since 23:59:55 --no-legend --no-pager --file system.journal
No coredumps found.
$ coredumpctl --since "2022-01-04 23:59:59" --no-legend --no-pager --file system.journal
Wed 2022-01-05 01:00:06 CET 359 0 0 SIGABRT journal /usr/bin/udevadm n/a
```

3 years agoMerge pull request #22012 from DaanDeMeyer/journal-full-message
Yu Watanabe [Wed, 5 Jan 2022 16:17:31 +0000 (01:17 +0900)] 
Merge pull request #22012 from DaanDeMeyer/journal-full-message

journal: Log a better message when we're rotating because a file is full

3 years agoMerge pull request #22014 from keszybz/networkd-reduce-append-logging
Yu Watanabe [Wed, 5 Jan 2022 16:17:09 +0000 (01:17 +0900)] 
Merge pull request #22014 from keszybz/networkd-reduce-append-logging

Drop detailed error messages for netlink message append operations

3 years agologind: do not propagate error in delayed action 22018/head
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jan 2022 14:10:33 +0000 (15:10 +0100)] 
logind: do not propagate error in delayed action

If the action failed, we should log about the issue, and continue.
Exiting would bring the graphical session down, which of course is not
appreciated by users.

As documented in previous commits, a non-negative return from the callback
doesn't matter, so the callback is simplified a bit.

Fixes #21991.

3 years agoman: add example of sd_event_add_child()
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jan 2022 14:04:06 +0000 (15:04 +0100)] 
man: add example of sd_event_add_child()

The thing with blocking SIGCHLD is rather annoying. I think we could/should
make this automatic.

3 years agoman: add better descriptions of what event handlers do
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jan 2022 13:00:59 +0000 (14:00 +0100)] 
man: add better descriptions of what event handlers do

The meaning of the return value, the default handlers, and loop exiting are now
described.

3 years agobacklight: ignore error if the backlight device is already removed
Yu Watanabe [Wed, 5 Jan 2022 09:26:46 +0000 (18:26 +0900)] 
backlight: ignore error if the backlight device is already removed

Fixes #21997.

3 years agoMerge pull request #21974 from yuwata/test-repart-find-sfdisk
Frantisek Sumsal [Wed, 5 Jan 2022 12:40:11 +0000 (12:40 +0000)] 
Merge pull request #21974 from yuwata/test-repart-find-sfdisk

test-repart: find sfdisk

3 years agoMerge pull request #21981 from medhefgo/boot-cleanup
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jan 2022 11:55:59 +0000 (12:55 +0100)] 
Merge pull request #21981 from medhefgo/boot-cleanup

boot: Cleanup

3 years agojournal: Log filename when we fail to write an entry 22012/head
Daan De Meyer [Wed, 5 Jan 2022 10:46:39 +0000 (10:46 +0000)] 
journal: Log filename when we fail to write an entry

3 years agojournal: Log a better message when we're rotating because a file is full
Daan De Meyer [Wed, 5 Jan 2022 10:24:20 +0000 (10:24 +0000)] 
journal: Log a better message when we're rotating because a file is full

The previous message was confusing errors. When we're rotating because
we've reached the file size limit, let's log a better message.

Fixes #22007.

3 years agosd-boot: select newest kernel entry matching with the default glob pattern
Yu Watanabe [Wed, 5 Jan 2022 06:09:43 +0000 (15:09 +0900)] 
sd-boot: select newest kernel entry matching with the default glob pattern

This fixes a bug introduced by 0c674ce5f24a6e52561ec6520e43a1ca45d90f01.

Fixes #22004.

3 years agowatchdog: adjust comment 22016/head
Yu Watanabe [Wed, 5 Jan 2022 11:13:59 +0000 (20:13 +0900)] 
watchdog: adjust comment

3 years agoresolve: add missing initialization of libgcrypt
Yu Watanabe [Wed, 5 Jan 2022 02:33:26 +0000 (11:33 +0900)] 
resolve: add missing initialization of libgcrypt

Fixes #21951.

3 years agooss-fuzz: drop line-tables-only
Evgeny Vereshchagin [Tue, 4 Jan 2022 22:47:46 +0000 (22:47 +0000)] 
oss-fuzz: drop line-tables-only

It was copy-pasted directly from OSS-Fuzz where it makes sense to
kind of strip binaries to get nice backtraces but when the fuzzers
are built and run locally with gdb it would be nice to have a little
bit more than that.

It was initially discovered in elfutils where I put the same flags
and was surprised when I couldn't run the fuzzer comfortably step
by step, which led to the same change there: https://github.com/google/oss-fuzz/pull/7092
:-)

3 years agotests: log_tests_skipped() already appends ", skipping tests" 22014/head
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 11:02:11 +0000 (12:02 +0100)] 
tests: log_tests_skipped() already appends ", skipping tests"

We would say:
test-bpf-lsm: Can't use mlock(), skipping., skipping tests.

3 years agonetwork: move logging from route_set_netlink_message() to the callers
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jan 2022 10:34:55 +0000 (11:34 +0100)] 
network: move logging from route_set_netlink_message() to the callers

Overall size change for the whole series:
$ size build/systemd-networkd{.0,}
   text    data     bss     dec     hex filename
1878634  394016      36 2272686  22adae build/systemd-networkd.0
1755066  394080      36 2149182  20cb3e build/systemd-networkd

i.e. 121 kb.

3 years agonetwork: move logging from routing_policy_rule_set_netlink_message() to the callers
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jan 2022 10:20:12 +0000 (11:20 +0100)] 
network: move logging from routing_policy_rule_set_netlink_message() to the callers

3 years agonetwork: move logging from qdisc_configure()/tclass_configure() to the caller
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jan 2022 10:16:22 +0000 (11:16 +0100)] 
network: move logging from qdisc_configure()/tclass_configure() to the caller

3 years agonetwork: simplify logging in request_process_bridge_fdb()
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jan 2022 09:52:17 +0000 (10:52 +0100)] 
network: simplify logging in request_process_bridge_fdb()

3 years agonetwork: move logging from tc .fill_message to the callers
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jan 2022 09:35:19 +0000 (10:35 +0100)] 
network: move logging from tc .fill_message to the callers

Structured initialization is used a bit more.

There were two kinds of log messages: about failed size calculations and
about failed appends to the message. I "downgraded" the first type to log_debug,
and moved the latter to the caller. This way there should be at most one high-priority
message.

I also changed sizeof(<type>) to sizeof(var) — there is less chance of select-and-paste
error in the second form.

3 years agonetwork: split out neighbor_configure_message(), simplify logging
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 21:29:50 +0000 (22:29 +0100)] 
network: split out neighbor_configure_message(), simplify logging

3 years agonetwork: split out dhcp4_pd_create_6rd_tunnel_message(), simplify logging
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 21:17:45 +0000 (22:17 +0100)] 
network: split out dhcp4_pd_create_6rd_tunnel_message(), simplify logging

3 years agonetwork: adjust log message about MACsec associations
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 21:06:44 +0000 (22:06 +0100)] 
network: adjust log message about MACsec associations

3 years agonetwork: simplify logging in macsec netdev code
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 21:05:42 +0000 (22:05 +0100)] 
network: simplify logging in macsec netdev code

3 years agonetwork: simplify logging in l2tp_create_session() and l2tp_create_tunnel()
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 20:56:42 +0000 (21:56 +0100)] 
network: simplify logging in l2tp_create_session() and l2tp_create_tunnel()

All the detailed logging is replaced by a simple "Failed to create netlink message",
which should be enough for the user in the unlikely case that this ever fails.

3 years agonetwork: split out link_configure_fill_message(), simplify logging
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 20:47:48 +0000 (21:47 +0100)] 
network: split out link_configure_fill_message(), simplify logging

3 years agonetwork: move logging from can_set_netlink_message() to the caller
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 20:43:39 +0000 (21:43 +0100)] 
network: move logging from can_set_netlink_message() to the caller

3 years agonetwork: de-duplicate logging in bridge_vlan_append_info() and the caller
Zbigniew Jędrzejewski-Szmek [Wed, 5 Jan 2022 10:05:02 +0000 (11:05 +0100)] 
network: de-duplicate logging in bridge_vlan_append_info() and the caller

The remaining message is changed, because the user would most likely not
understand that "append VLANs" is just talking about the netlink message.

3 years agonetwork: move logging from ipoib_set_netlink_message() to the caller
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 20:34:21 +0000 (21:34 +0100)] 
network: move logging from ipoib_set_netlink_message() to the caller

3 years agocoredump: drop unnecessary initialization
Yu Watanabe [Wed, 5 Jan 2022 10:41:42 +0000 (19:41 +0900)] 
coredump: drop unnecessary initialization

3 years agonetwork: split out netdev_fill_fou_tunnel_message(), simplify logging
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 20:28:23 +0000 (21:28 +0100)] 
network: split out netdev_fill_fou_tunnel_message(), simplify logging

3 years agonetwork: split out netdev_create_message(), simplify logging
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 20:20:54 +0000 (21:20 +0100)] 
network: split out netdev_create_message(), simplify logging

3 years agonetwork: replace more detailed netlink append messages
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 18:37:55 +0000 (19:37 +0100)] 
network: replace more detailed netlink append messages

Some refactoring was needed here to avoid duplicate messages.
Some select-and-paste errors were fixed on the way.

systemd-networkd is thinner by 8k.

3 years agonetwork: use SYNTHETIC_ERRNO in one more place
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 18:16:16 +0000 (19:16 +0100)] 
network: use SYNTHETIC_ERRNO in one more place

3 years agonetwork: replace detailed netlink append messages with a single generic message
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 18:16:01 +0000 (19:16 +0100)] 
network: replace detailed netlink append messages with a single generic message

This commit is the first in the series, and they generally follow the same
idea: we had very detailed logging for message append operations which would
only fail either with some type error or intrinsic limit (and then they would
fail everywhere, so this would be noticed during development or in CI), or they
would fail with ENOMEM, in which case the exact location is not very interesting
since this is not repeatable.

I am in general in favour of detailed logging messages, because it helps with
diagnosis of errors, but I think case is an exception. Despite not being very
useful, those messages required a lot of effort, because they were customized
for each and every append operation. In fact some of the messages contained copy
errors. The text of the messages (since they are generally unique) also added up
to a considerable size.

This removes the log messages after each sd_netlink_message_append_*() in
fill_message_create() with a single line in netdev_create(). As described
above, we are just appending fields to a message, so those calls would almost
never fail.

A forgotten 'return' was added in one place.

$ size build/systemd-networkd{.0,}
   text    data     bss     dec     hex filename
1878634  394016      36 2272686  22adae build/systemd-networkd.0
1842450  394080      36 2236566  222096 build/systemd-networkd

… so we save 30k too.

3 years agotest-repart: append /sbin and /usr/sbin to $PATH= to make sfdisk can be found 21974/head
Yu Watanabe [Sun, 2 Jan 2022 20:13:59 +0000 (05:13 +0900)] 
test-repart: append /sbin and /usr/sbin to $PATH= to make sfdisk can be found

Fixes #21972.

3 years agotest-repart: disable pager
Yu Watanabe [Sun, 2 Jan 2022 20:03:45 +0000 (05:03 +0900)] 
test-repart: disable pager

3 years agorandom-seed: hash together old seed and new seed before writing out file
Jason A. Donenfeld [Mon, 3 Jan 2022 17:11:32 +0000 (18:11 +0100)] 
random-seed: hash together old seed and new seed before writing out file

If we're consuming an on-disk seed, we usually write out a new one after
consuming it. In that case, we might be at early boot and the randomness
could be rather poor, and the kernel doesn't guarantee that it'll use
the new randomness right away for us. In order to prevent the new
entropy from getting any worse, hash together the old seed and the new
seed, and replace the final bytes of the new seed with the hash output.
This way, entropy strictly increases and never regresses.

Fixes: https://github.com/systemd/systemd/issues/21983
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
3 years agoboot: Add gdb support and documentation
Jan Janssen [Sun, 19 Dec 2021 17:05:44 +0000 (18:05 +0100)] 
boot: Add gdb support and documentation

This will finally allow debugging issues in systemd without resorting to
Print() calls all over the place.

3 years agoMerge pull request #21977 from systemd/wip/hadess/minipro-uaccess
Luca Boccassi [Tue, 4 Jan 2022 15:51:28 +0000 (15:51 +0000)] 
Merge pull request #21977 from systemd/wip/hadess/minipro-uaccess

hwdb: Allow end-users root-less access to TL866 EPROM readers

3 years agotest: build fuzzers with --werror if set
Frantisek Sumsal [Tue, 4 Jan 2022 11:51:44 +0000 (12:51 +0100)] 
test: build fuzzers with --werror if set

to catch issues like systemd/systemd#21996.

3 years agofuzz-bcd: silence warning about always-true comparison
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 08:31:25 +0000 (09:31 +0100)] 
fuzz-bcd: silence warning about always-true comparison

Occurs with gcc-11.2.1-7.fc35.x86_64.

3 years agohwdb: Allow end-users root-less access to TL866 EPROM readers 21977/head
Bastien Nocera [Mon, 3 Jan 2022 09:14:39 +0000 (10:14 +0100)] 
hwdb: Allow end-users root-less access to TL866 EPROM readers

As is currently done in the upstream minipro tool:
https://gitlab.com/DavidGriffith/minipro/-/tree/master/udev

3 years agoRevert "udev: Import hwdb matches for USB devices"
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 09:48:16 +0000 (10:48 +0100)] 
Revert "udev: Import hwdb matches for USB devices"

This reverts commit 94cb45d57f6e94dd4c93bd4706f9be70634bf03f.

This rule set up a duplicate import:

$ udevadm test /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4.1/2-4.1.3
...
2-4.1.3: /usr/lib/udev/rules.d/40-libgphoto2.rules:9 Importing properties from results of builtin command 'usb_id'
2-4.1.3: /usr/lib/udev/rules.d/50-udev-default.rules:13 Skipping builtin 'usb_id' in IMPORT key
2-4.1.3: /usr/lib/udev/rules.d/50-udev-default.rules:13 Importing properties from results of builtin command 'hwdb --subsystem=usb'
2-4.1.3: hwdb modalias key: "usb:v17EFp3054:OneLink+ Giga"
2-4.1.3: /usr/lib/udev/rules.d/50-udev-default.rules:15 Importing properties from results of builtin command 'hwdb 'usb:v17efp3054''
2-4.1.3: No entry found from hwdb.
2-4.1.3: /usr/lib/udev/rules.d/50-udev-default.rules:15 Failed to run builtin 'hwdb 'usb:v17efp3054'': No data available
2-4.1.3: /usr/lib/udev/rules.d/50-udev-default.rules:52 MODE 0664

except that the existing one was done with uppercase digits and the full match pattern,
and the second one was done with lowercase digits.

With the previous commit we only have uppercase digits in our match patterns, so we can
drop the duplicate import. (Some other projects might have rules that used the lowercase
match patterns, and people might have some local rules that did that too. But the second
import was only added recently so I think it's better to rip off the bandaid quickly.)

3 years agohwdb: make usb match patterns uppercase
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 09:47:57 +0000 (10:47 +0100)] 
hwdb: make usb match patterns uppercase

Those patterns were always supposed to be uppercase.

3 years agohwdb: fix check for uppercasedness of match patterns
Zbigniew Jędrzejewski-Szmek [Tue, 4 Jan 2022 09:39:53 +0000 (10:39 +0100)] 
hwdb: fix check for uppercasedness of match patterns

The check was added in 77547d5313ea916d2fb64ca5a8812734e9b50f92, but
it doesn't work as expected. Because the second part is wrapped in Optional(),
it would silently "succeed" when the lowercase digits were in the second part:

>>> from parse_hwdb import *
>>> g = 'v' + upperhex_word(4) + Optional('p' + upperhex_word(4))
>>> g.parseString('v04D8pE11C*')
(['v', '04D8', 'p', 'E11C'], {})
>>> g.parseString('v04D8pe11c*')
(['v', '04D8'], {})

The following matches are OK:
usb:v0627p0001:*QEMU USB Keyboard*
usb:v0627p0001:*
usb:v0627p0001*
usb:v0627*

3 years agoMerge pull request #21778 from evverx/test-cifuzz
Yu Watanabe [Tue, 4 Jan 2022 09:46:58 +0000 (18:46 +0900)] 
Merge pull request #21778 from evverx/test-cifuzz

tests: run nss-{users|hosts} by default

3 years agofuzz: no longer skip empty files
Evgeny Vereshchagin [Mon, 3 Jan 2022 12:31:07 +0000 (12:31 +0000)] 
fuzz: no longer skip empty files

Empty files and empty strings seem to have triggered various
issues in the past so it seems they shouldn't be ignore by the
fuzzers just because fmemopen can't handle them.

Prompted by https://github.com/systemd/systemd/pull/21939#issuecomment-1003113669

3 years agopo: Update translation files
Weblate [Tue, 4 Jan 2022 00:18:19 +0000 (01:18 +0100)] 
po: Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/
Translation: systemd/main

3 years agomeson: generate better arch defines for clang bpf compilation
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jan 2022 17:38:23 +0000 (18:38 +0100)] 
meson: generate better arch defines for clang bpf compilation

The code assume that meson's cpu_family can be mapped directly to
'-D__<cpu_family>__'. This works in a surprising number of cases, but not for a
few architectures. PPC uses "powerpc", and RISC-V omits the trailing underscores.
ARM and RISC-V require a second define too.

Fixes #21900.

(I don't think this matters too much: we need *something* so that gnu/stubs.h
can be successfully included. But we don't actually call syscalls or depend too
much on the host environment, so things should be fine as long as we don't get
a compilation error.)

3 years agoMerge pull request #21990 from keszybz/indentation-and-comments
Luca Boccassi [Tue, 4 Jan 2022 00:18:10 +0000 (00:18 +0000)] 
Merge pull request #21990 from keszybz/indentation-and-comments

Indentation and comments

3 years agobasic/log: allow errno values higher than 255
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jan 2022 16:53:29 +0000 (17:53 +0100)] 
basic/log: allow errno values higher than 255

When the support for "synthetic errno" was added, we started truncating
the errno value to just the least significant byte. This is generally OK,
because errno values are defined up to ~130.

The docs don't really say what the maximum value is. But at least in principle
higher values could be added in the future. So let's stop truncating
the values needlessly.

The kernel (or libbpf?) have an error where they return 524 as an errno
value (https://bugzilla.redhat.com/show_bug.cgi?id=2036145). We would
confusingly truncate this to 12 (ENOMEM). It seems much nicer to let
strerror() give us "Unknown error 524" rather than to print the bogus
message about ENOMEM.

3 years agocoredump: do not crash if we failed to acquire exe path
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jan 2022 08:24:03 +0000 (09:24 +0100)] 
coredump: do not crash if we failed to acquire exe path

The COREDUMP_EXE attribute is "optional", i.e. we continue to process the
crash even if we didn't acquire it. The coredump generation code assumed
that it is always available:

 #5 endswith at ../src/fundamental/string-util-fundamental.c:41
 [ endswith() is called with NULL here, and an assertion fails. ]
 #6 submit_coredump at ../src/coredump/coredump.c:823
 #7 process_socket at ../src/coredump/coredump.c:1038
 #8 run at ../src/coredump/coredump.c:1413

We use the exe path for loop detection, and also (ultimately) pass it to
dwfl_core_file_report(). The latter seems to be fine will NULL, so let's just
change our code to look at COMM, which should be more reliable anyway.

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

3 years agoMerge pull request #21985 from yuwata/elf-util-cleanups
Luca Boccassi [Mon, 3 Jan 2022 22:44:20 +0000 (22:44 +0000)] 
Merge pull request #21985 from yuwata/elf-util-cleanups

elf-util: several cleanups

3 years agopo: drop Project-Id-Version from header template 21990/head
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jan 2022 20:19:06 +0000 (21:19 +0100)] 
po: drop Project-Id-Version from header template

Since they were pretty inconsistent anyway, let's assume that they
don't matter.

3 years agovarious: fix three spelling issues found by fossies
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jan 2022 20:15:06 +0000 (21:15 +0100)] 
various: fix three spelling issues found by fossies

3 years agodocs: update branch names
Zbigniew Jędrzejewski-Szmek [Thu, 23 Dec 2021 20:25:31 +0000 (21:25 +0100)] 
docs: update branch names

Also use --atomic when pushing multiple items with git;
adjust some external URLs.

3 years agocoredump: drop unnecessary parentheses 21985/head
Yu Watanabe [Mon, 3 Jan 2022 19:11:26 +0000 (04:11 +0900)] 
coredump: drop unnecessary parentheses

3 years agoelf-util: add missing assertion
Yu Watanabe [Mon, 3 Jan 2022 17:02:12 +0000 (02:02 +0900)] 
elf-util: add missing assertion

3 years agoelf-util: reduce variable scope
Yu Watanabe [Mon, 3 Jan 2022 16:55:32 +0000 (01:55 +0900)] 
elf-util: reduce variable scope

3 years agoelf-util: executable argument for parse_elf() may be NULL
Yu Watanabe [Mon, 3 Jan 2022 16:55:03 +0000 (01:55 +0900)] 
elf-util: executable argument for parse_elf() may be NULL

Fixes assertion triggered by parse_package_metadata() and json_build().

3 years agoelf-util: reduce variable scope and indentation
Yu Watanabe [Mon, 3 Jan 2022 16:22:11 +0000 (01:22 +0900)] 
elf-util: reduce variable scope and indentation

3 years agoelf-util: reduce variable scope and indentation
Yu Watanabe [Mon, 3 Jan 2022 16:12:16 +0000 (01:12 +0900)] 
elf-util: reduce variable scope and indentation

3 years agoMerge pull request #21941 from yuwata/hostname-handle-empty
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jan 2022 18:56:57 +0000 (19:56 +0100)] 
Merge pull request #21941 from yuwata/hostname-handle-empty

hostname-setup: support kernel with empty CONFIG_DEFAULT_HOSTNAME

3 years agoboot: Do not warn if an initializing driver returns EFI_ABORTED
Jan Janssen [Sun, 2 Jan 2022 13:37:32 +0000 (14:37 +0100)] 
boot: Do not warn if an initializing driver returns EFI_ABORTED

Fixes: #21965
3 years agobasic: adjust wording and wrapping of comments
Zbigniew Jędrzejewski-Szmek [Tue, 28 Dec 2021 14:47:08 +0000 (15:47 +0100)] 
basic: adjust wording and wrapping of comments

3 years agotest-bpf-lsm: drop some parens
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jan 2022 13:33:35 +0000 (14:33 +0100)] 
test-bpf-lsm: drop some parens

3 years agotest-job-type: modernize code a bit
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jan 2022 10:29:22 +0000 (11:29 +0100)] 
test-job-type: modernize code a bit

3 years agocore/bpf: tighten handling of return values, improve messages
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jan 2022 10:14:18 +0000 (11:14 +0100)] 
core/bpf: tighten handling of return values, improve messages

The code was written unidiomatically, using r as a boolean value, and
confusing errno and r in some places. AFAICS, there wasn't any actual
problem: even in the one place where errno was used instead of r, it would
almost certainly be initialized.

It seems that some libbpf functions set errno, while others return the
error, possibly encoded. Since there are almost no docs, the only way to
know is to read the code of the function. To make matters worse, there is
a global libbpf_mode which can be set to change the convention. With
LIBBPF_STRICT_DIRECT_ERRS in libbpf_mode, some functions set errno while others
return a negative error, and the only way to know is to read the code, except
that the split is now different. We currently don't set
LIBBPF_STRICT_DIRECT_ERRS, but even the possibility makes everything harder
to grok.

This is all very error-prone. Let's at least add some asserts to make sure that
the returned values are as expected.

3 years agocore/bpf: avoid unnecessary initialization of variables, tighten scope
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jan 2022 09:29:13 +0000 (10:29 +0100)] 
core/bpf: avoid unnecessary initialization of variables, tighten scope

No funtional change.

3 years agoMerge pull request #21970 from yuwata/seccomp-util-fix-build
Zbigniew Jędrzejewski-Szmek [Mon, 3 Jan 2022 15:44:10 +0000 (16:44 +0100)] 
Merge pull request #21970 from yuwata/seccomp-util-fix-build

seccomp-util: fix build failure

3 years agoci: bump mkosi to v12 with libsolv workaround
Frantisek Sumsal [Mon, 3 Jan 2022 12:07:21 +0000 (13:07 +0100)] 
ci: bump mkosi to v12 with libsolv workaround

Replaces: https://github.com/systemd/systemd/pull/21574
Related:
    * https://github.com/systemd/mkosi/issues/861
    * https://github.com/systemd/mkosi/pull/878

3 years agoboot: Prevent stub command line editing under secure boot 21981/head
Jan Janssen [Mon, 3 Jan 2022 10:29:49 +0000 (11:29 +0100)] 
boot: Prevent stub command line editing under secure boot

3 years agoboot: Unify idx type handling
Jan Janssen [Mon, 3 Jan 2022 09:41:45 +0000 (10:41 +0100)] 
boot: Unify idx type handling

This replaces several inconsistent use of types and unsound
signed comparisons.
The added max entry count is just for paranoia. Anyone with that
many boot entries deserves a medal.

3 years agoboot: Convert goto into loop
Jan Janssen [Mon, 3 Jan 2022 09:20:23 +0000 (10:20 +0100)] 
boot: Convert goto into loop

3 years agoboot: Rename cleanup functions
Jan Janssen [Mon, 3 Jan 2022 09:15:24 +0000 (10:15 +0100)] 
boot: Rename cleanup functions

3 years agotests: no longer load libnss_{files|dns} 21778/head
Evgeny Vereshchagin [Fri, 31 Dec 2021 23:14:59 +0000 (23:14 +0000)] 
tests: no longer load libnss_{files|dns}

Those libraries aren't provided by systemd so they shouldn't be
included here

3 years agoMerge pull request #21960 from medhefgo/boot-gap
Evgeny Vereshchagin [Sun, 2 Jan 2022 23:35:15 +0000 (02:35 +0300)] 
Merge pull request #21960 from medhefgo/boot-gap

boot: Use objcopy to align sections

3 years agoseccomp-util: include missing_syscall_def.h to make __SNR_foo mapped to __NR_foo 21970/head
Yu Watanabe [Sun, 2 Jan 2022 18:47:27 +0000 (03:47 +0900)] 
seccomp-util: include missing_syscall_def.h to make __SNR_foo mapped to __NR_foo

Fixes #21969.

3 years agotests: run nss-{users|hosts} by default
Evgeny Vereshchagin [Fri, 31 Dec 2021 23:12:36 +0000 (23:12 +0000)] 
tests: run nss-{users|hosts} by default

to prevent issues like https://github.com/systemd/systemd/issues/21935
by testing the code under ASan/UBSan

3 years agoMerge pull request #21944 from yuwata/nss-systemd-fix-pointer
Yu Watanabe [Sun, 2 Jan 2022 20:32:05 +0000 (05:32 +0900)] 
Merge pull request #21944 from yuwata/nss-systemd-fix-pointer

nss-systemd: fix pointer calculation

3 years agoci: Test efi binaries for section table gaps 21960/head
Jan Janssen [Sun, 2 Jan 2022 19:05:58 +0000 (20:05 +0100)] 
ci: Test efi binaries for section table gaps

3 years agoboot: Use objcopy to align sections
Jan Janssen [Sat, 1 Jan 2022 15:37:27 +0000 (16:37 +0100)] 
boot: Use objcopy to align sections

Not aligning these can create gaps in the section table. Some
firmware does not handle this nicely resulting in secure boot
signature fails.
Using objcopy ensures that any new sections in the future will be
properly aligned.

Fixes: #21956
3 years agomissing-syscall: add __NR_openat2
Yu Watanabe [Sun, 2 Jan 2022 18:44:50 +0000 (03:44 +0900)] 
missing-syscall: add __NR_openat2