]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agodoc: document how we expect empty lines to be used
Lennart Poettering [Tue, 17 Jan 2023 14:49:01 +0000 (15:49 +0100)] 
doc: document how we expect empty lines to be used

2 years agoboot: Fix missed argument to Print()
Jan Janssen [Tue, 17 Jan 2023 14:51:42 +0000 (15:51 +0100)] 
boot: Fix missed argument to Print()

This fixes 3e87a057a796b57bf9540b948823fbefef6693d7, which passed the
path to the wrong Print() call. Miraculously, this was printing the
correct path during testing and was therefore missed.

2 years agounits: don't install pcrphase-related units without gnu-efi
Frantisek Sumsal [Tue, 17 Jan 2023 11:14:13 +0000 (12:14 +0100)] 
units: don't install pcrphase-related units without gnu-efi

since we don't have systemd-pcrphase built anyway, which breaks the tests:

...
I: Attempting to install /usr/lib/systemd/systemd-networkd-wait-online (based on unit file reference)
I: Attempting to install /usr/lib/systemd/systemd-network-generator (based on unit file reference)
I: Attempting to install /usr/lib/systemd/systemd-oomd (based on unit file reference)
I: Attempting to install /usr/lib/systemd/systemd-pcrphase (based on unit file reference)
W: Failed to install '/usr/lib/systemd/systemd-pcrphase'
make: *** [Makefile:4: setup] Error 1
make: Leaving directory '/root/systemd/test/TEST-01-BASIC'

Follow-up to 04959faa632272a8fc9cdac3121b2e4af721c1b6.

2 years agosend dhcpv6 release when stopping
chris [Sat, 7 Jan 2023 20:11:28 +0000 (21:11 +0100)] 
send dhcpv6 release when stopping

2 years agotpm2: replace magic number
Dan Streetman [Fri, 9 Dec 2022 20:05:49 +0000 (15:05 -0500)] 
tpm2: replace magic number

2 years agoMerge pull request #25006 from poettering/pcr15
Lennart Poettering [Tue, 17 Jan 2023 10:04:03 +0000 (11:04 +0100)] 
Merge pull request #25006 from poettering/pcr15

cryptsetup: measure LUKS volume keys to PCR 15

2 years agoMerge pull request #26005 from medhefgo/boot-hypervisor
Lennart Poettering [Tue, 17 Jan 2023 09:53:23 +0000 (10:53 +0100)] 
Merge pull request #26005 from medhefgo/boot-hypervisor

boot: Detect hypervisors using SMBIOS info

2 years agoupdate TODO 25006/head
Lennart Poettering [Fri, 14 Oct 2022 19:21:46 +0000 (21:21 +0200)] 
update TODO

2 years agotest: add simple integration test for checking PCR extension works as it should
Lennart Poettering [Fri, 16 Dec 2022 15:25:34 +0000 (16:25 +0100)] 
test: add simple integration test for checking PCR extension works as it should

2 years agoman: document new machine-id/fs measurement options
Lennart Poettering [Mon, 17 Oct 2022 13:20:53 +0000 (15:20 +0200)] 
man: document new machine-id/fs measurement options

2 years agotpm2: add common helper for checking if we are running on UKI with TPM measurements
Lennart Poettering [Mon, 17 Oct 2022 12:50:56 +0000 (14:50 +0200)] 
tpm2: add common helper for checking if we are running on UKI with TPM measurements

Let's introduce a common implementation of a function that checks
whether we are booted on a kernel with systemd-stub that has TPM PCR
measurements enabled. Do our own userspace measurements only if we
detect that.

PCRs are scarce and most likely there are projects which already make
use of them in other ways. Hence, instead of blindly stepping into their
territory let's conditionalize things so that people have to explicitly
buy into our PCR assignments before we start measuring things into them.
Specifically bind everything to an UKI that reported measurements.

This was previously already implemented in systemd-pcrphase, but with
this change we expand this to all tools that process PCR measurement
settings.

The env var to override the check is renamed to SYSTEMD_FORCE_MEASURE,
to make it more generic (since we'll use it at multiple places now).
This is not a compat break, since the original env var for that was not
included in any stable release yet.

2 years agogenerators: optionally, measure file systems at boot
Lennart Poettering [Sun, 16 Oct 2022 21:25:04 +0000 (23:25 +0200)] 
generators: optionally, measure file systems at boot

If we use gpt-auto-generator, automatically measure root fs and /var.

Otherwise, add x-systemd.measure option to request this.

2 years agounits: rework growfs units to be just a regular unit that is instantiated
Lennart Poettering [Sun, 16 Oct 2022 20:45:17 +0000 (22:45 +0200)] 
units: rework growfs units to be just a regular unit that is instantiated

The systemd-growfs@.service units are currently written in full for each
file system to grow. Which is kinda pointless given that (besides an
optional ordering dep) they contain always the same definition. Let's
fix that and add a static template for this logic, that the generator
simply instantiates (and adds an ordering dep for).

This mimics how systemd-fsck@.service is handled. Similar to the wait
that for root fs there's a special instance systemd-fsck-root.service
we also add a special instance systemd-growfs-root.service for the root
fs, since it has slightly different deps.

Fixes: #20788
See: #10014

2 years agogenerator: teach generator_add_symlink() to instantiate specified unit
Lennart Poettering [Sun, 16 Oct 2022 20:39:31 +0000 (22:39 +0200)] 
generator: teach generator_add_symlink() to instantiate specified unit

if we want generators to instantiate a template service, we need to
teach generator_add_symlink() the concept.

Just some preparation for a later commit.

While we are at it, modernize the function around
path_extract_filename() + path_extract_directory()

2 years agounits: measure /etc/machine-id into PCR 15 during early boot
Lennart Poettering [Sun, 16 Oct 2022 16:21:12 +0000 (18:21 +0200)] 
units: measure /etc/machine-id into PCR 15 during early boot

We want PCR 15 to be useful for binding per-system policy to. Let's
measure the machine ID into it, to ensure that every OS we can
distinguish will get a different PCR (even if the root disk encryption
key is already measured into it).

2 years agopcrphase: make tool more generic, reuse for measuring machine id/fs uuids
Lennart Poettering [Fri, 14 Oct 2022 21:29:48 +0000 (23:29 +0200)] 
pcrphase: make tool more generic, reuse for measuring machine id/fs uuids

See: #24503

2 years agogpt-auto-generator: automatically measure root/var volume keys into PCR 15
Lennart Poettering [Fri, 14 Oct 2022 13:54:09 +0000 (15:54 +0200)] 
gpt-auto-generator: automatically measure root/var volume keys into PCR 15

let's enable PCR 15 measurements automatically if gpt-auto discovery is
used and systemd-stub is also used.

2 years agoman: document the new crypttab measurement options
Lennart Poettering [Fri, 14 Oct 2022 13:27:34 +0000 (15:27 +0200)] 
man: document the new crypttab measurement options

2 years agocryptsetup: add tpm2-measure-pcr= and tpm2-measure-bank= crypttab options
Lennart Poettering [Wed, 12 Oct 2022 07:56:32 +0000 (09:56 +0200)] 
cryptsetup: add tpm2-measure-pcr= and tpm2-measure-bank= crypttab options

These options allow measuring the volume key used for unlocking the
volume to a TPM2 PCR. This is ideally used for the volume key of the
root file system and can then be used to bind other resources to the
root file system volume in a secure way.

See: #24503

2 years agotpm2-util: optionally do HMAC in tpm2_extend_bytes() in case we process sensitive...
Lennart Poettering [Fri, 14 Oct 2022 12:38:35 +0000 (14:38 +0200)] 
tpm2-util: optionally do HMAC in tpm2_extend_bytes() in case we process sensitive data

When measuring data into a PCR we are supposed to hash the data on the
CPU and then pass the hash value over the wire to the TPM2. That's all
good as long as the data we intend to measure is not sensitive.

Let's be extra careful though if we want to measure sensitive data, for
example the root file system volume key. Instead of just hashing that
and passing it over the wire to the TPM2, let's do a HMAC signature
instead. It's also a hash operation, but should protect our secret
reasonably well and not leak direct information about it to wiretappers.

2 years agotpm2-util: split out code that extends a PCR from pcrphase
Lennart Poettering [Tue, 11 Oct 2022 16:20:14 +0000 (18:20 +0200)] 
tpm2-util: split out code that extends a PCR from pcrphase

This way we can reuse it later outside of pcrphase

2 years agotpm2-util: split out code that derives "good" TPM2 banks into an strv from pcrphase...
Lennart Poettering [Tue, 11 Oct 2022 16:07:46 +0000 (18:07 +0200)] 
tpm2-util: split out code that derives "good" TPM2 banks into an strv from pcrphase and generalize it in tpm2-util.c

That way we can reuse it later from different places.

2 years agoMerge pull request #26004 from poettering/cleanuo-erase-moar
Yu Watanabe [Tue, 17 Jan 2023 05:04:02 +0000 (14:04 +0900)] 
Merge pull request #26004 from poettering/cleanuo-erase-moar

tree-wide: use CLEANUP_ERASE() at many places

2 years agosd-dhcp-client: gracefully handle invalid ether type client ID
Yu Watanabe [Mon, 16 Jan 2023 04:08:55 +0000 (13:08 +0900)] 
sd-dhcp-client: gracefully handle invalid ether type client ID

Currently, sd-dhcp-server accepts spurious client IDs, then the leases
exposed by networkd may be invalid. Let's make networkctl gracefully
show such leases.

Fixes #25984.

2 years agobusctl: simplify peeking the type
Lennart Poettering [Mon, 16 Jan 2023 13:16:14 +0000 (14:16 +0100)] 
busctl: simplify peeking the type

let's peek the type before we enter the variant, not after, so that we
can reuse it as-is, instead having to recombine it later.

Follow-up for: #26049

2 years agosd-dhcp6: always append the default status message generated from status code
Yu Watanabe [Mon, 16 Jan 2023 03:40:53 +0000 (12:40 +0900)] 
sd-dhcp6: always append the default status message generated from status code

Fixes #25988.

2 years agonetwork: fix memleak
Yu Watanabe [Mon, 16 Jan 2023 13:07:06 +0000 (22:07 +0900)] 
network: fix memleak

Fixes a bug introduced by af2aea8bb64b0dc42ecbe5549216eb567681a803.

Fixes #25883 and #25891.

2 years agoMerge pull request #26071 from yuwata/network-dhcp-quick-ack
Luca Boccassi [Mon, 16 Jan 2023 19:41:03 +0000 (19:41 +0000)] 
Merge pull request #26071 from yuwata/network-dhcp-quick-ack

network: make TCP quick ACK mode for dynamic routes configurable

2 years agoMerge pull request #26054 from aplanas/fix_user_creds
Luca Boccassi [Mon, 16 Jan 2023 19:40:05 +0000 (19:40 +0000)] 
Merge pull request #26054 from aplanas/fix_user_creds

creds-util: some fixes related with TPM2 and capabilities

2 years agoMerge pull request #26051 from YHNdnzj/systemctl-list-dependencies-type
Luca Boccassi [Mon, 16 Jan 2023 19:38:58 +0000 (19:38 +0000)] 
Merge pull request #26051 from YHNdnzj/systemctl-list-dependencies-type

systemctl: list-dependencies: support --type= and --state=

2 years agoboot: Skip soft-brick warning when in a VM 26005/head
Jan Janssen [Mon, 16 Jan 2023 15:22:17 +0000 (16:22 +0100)] 
boot: Skip soft-brick warning when in a VM

This part of the warning is annoying to look at not really true when
running inside of a VM.

2 years agoboot: Detect hypervisors using SMBIOS info
Jan Janssen [Tue, 10 Jan 2023 13:44:29 +0000 (14:44 +0100)] 
boot: Detect hypervisors using SMBIOS info

This allows skipping secure boot enrollment wait time on other arches.

2 years agomemory-util: add CLEANUP_ERASE_PTR() macro and use it 26004/head
Lennart Poettering [Tue, 10 Jan 2023 11:39:14 +0000 (12:39 +0100)] 
memory-util: add CLEANUP_ERASE_PTR() macro and use it

2 years agotree-wide: use CLEANUP_ERASE() at various places
Lennart Poettering [Tue, 10 Jan 2023 11:39:58 +0000 (12:39 +0100)] 
tree-wide: use CLEANUP_ERASE() at various places

Let's use this new macro wherever it makes sense, as it allows us to
shorten or clean-up paths, and makes it less likely to miss a return
path.

2 years agoupdate TODO
Lennart Poettering [Mon, 16 Jan 2023 13:05:54 +0000 (14:05 +0100)] 
update TODO

2 years agoMerge pull request #25999 from DaanDeMeyer/mkosi
Daan De Meyer [Mon, 16 Jan 2023 13:24:04 +0000 (14:24 +0100)] 
Merge pull request #25999 from DaanDeMeyer/mkosi

ci: Update mkosi action to latest commit

2 years agomount: handle bind mount of file with non-existing target
David Tardon [Fri, 13 Jan 2023 14:58:39 +0000 (15:58 +0100)] 
mount: handle bind mount of file with non-existing target

When the target (Where=) of a mount does not exist, systemd tries to
create it. But previously, it'd always been created as a directory. That
doesn't work if one wants to bind-mount a file to a target that doesn't
exist.

Fixes: #17184
2 years agocreds-util: merge the TPM2 detection for initrd 26054/head
Alberto Planas [Mon, 16 Jan 2023 12:35:49 +0000 (13:35 +0100)] 
creds-util: merge the TPM2 detection for initrd

This patch merge the TPM2 detection paths when we are inside and outside
an initrd.

Signed-off-by: Alberto Planas <aplanas@suse.com>
2 years agocreds-util: do not try TPM2 if there is not support
Alberto Planas [Mon, 16 Jan 2023 10:16:53 +0000 (11:16 +0100)] 
creds-util: do not try TPM2 if there is not support

During the credentials encryption, if systemd it is compiled with TPM2
support, it will try to use it depending on the key flags passed.

The current code only checks if the system has a functional TPM2 if the
case of the INITRD flag.

This patch do a similar check in the case that it is outside initrd (but
still automatic).

Signed-off-by: Alberto Planas <aplanas@suse.com>
2 years agocreds-util: check for CAP_DAC_READ_SEARCH
Alberto Planas [Fri, 13 Jan 2023 14:31:39 +0000 (15:31 +0100)] 
creds-util: check for CAP_DAC_READ_SEARCH

In make_credential_host_secret, the credential.secret file is generated
first as a temporary anonymous file that is later instantiated with
linkat(2).  This system call requires CAP_DAC_READ_SEARCH capability
when the flag AT_EMPTY_PATH is used.

This patch check if the capability is effective, and if not uses the
alternative codepath for creating named temporary files.

Non-root users can now create per-user credentials with:

  export SYSTEMD_CREDENTIAL_SECRET=$HOME/.config/systemd/credential.secret
  systemd-creds setup

Signed-off-by: Alberto Planas <aplanas@suse.com>
2 years agosystemctl: list-dependencies: support --type= and --state= 26051/head
Mike Yuan [Fri, 13 Jan 2023 08:52:29 +0000 (16:52 +0800)] 
systemctl: list-dependencies: support --type= and --state=

Closes #25975

2 years agoman: clarify applicability of IPv6AcceptRA option
Łukasz Stelmach [Mon, 16 Jan 2023 07:33:55 +0000 (08:33 +0100)] 
man: clarify applicability of IPv6AcceptRA option

There is no reason to not accept RAs on bondX devices (devices that
aggregate other devices). It makes sense for aggregated devies though.

2 years agogpt-auto: harden ESP/XBOOTLDR mounts with "noexec,nosuid,nodev"
Mike Yuan [Mon, 16 Jan 2023 06:57:24 +0000 (14:57 +0800)] 
gpt-auto: harden ESP/XBOOTLDR mounts with "noexec,nosuid,nodev"

When these partitions are probed by gpt-auto,
they will always be hardened with such options.

See also: https://github.com/systemd/systemd/issues/25776#issuecomment-1364115711

Closes #25776

2 years agoman: udev_enumerate_new: fix typo
Ulrich Ölmann [Sun, 15 Jan 2023 17:24:39 +0000 (18:24 +0100)] 
man: udev_enumerate_new: fix typo

2 years agoNEWS: mention QuickAck= 26071/head
Yu Watanabe [Mon, 16 Jan 2023 05:37:11 +0000 (14:37 +0900)] 
NEWS: mention QuickAck=

2 years agoNEWS: move one entry to the correct section
Yu Watanabe [Mon, 16 Jan 2023 05:36:53 +0000 (14:36 +0900)] 
NEWS: move one entry to the correct section

2 years agonetwork: introduce QuickAck= for [DHCPv4] and [IPv6AcceptRA]
Yu Watanabe [Mon, 16 Jan 2023 05:31:58 +0000 (14:31 +0900)] 
network: introduce QuickAck= for [DHCPv4] and [IPv6AcceptRA]

Closes #25906.

2 years agoukify: Fix version string
Daan De Meyer [Sun, 15 Jan 2023 16:08:11 +0000 (17:08 +0100)] 
ukify: Fix version string

Let's make sure we mimick the version of our other CLI tooling.

2 years agodocs/man: remove reference to default vsock CID
Luca Boccassi [Sun, 15 Jan 2023 20:11:23 +0000 (20:11 +0000)] 
docs/man: remove reference to default vsock CID

This was dropped on reviewers' request in the revision that got merged,
but reference in two documents was not updated. Fix it.

Follow-up for: https://github.com/systemd/systemd/pull/25918

2 years agomkosi: Use meson setup 25999/head
Daan De Meyer [Sun, 15 Jan 2023 19:41:33 +0000 (20:41 +0100)] 
mkosi: Use meson setup

2 years agoboot: Remove -O1 workaround
Daan De Meyer [Sun, 15 Jan 2023 19:35:52 +0000 (20:35 +0100)] 
boot: Remove -O1 workaround

Now that we have ukify and mkosi has been updated to use it, we
have a solution in place to make sure that PE sections don't overlap
in a UKI so let's drop the workaround to avoid overlapping PE sections.

2 years agoci: Update mkosi action to latest commit
Daan De Meyer [Tue, 10 Jan 2023 11:04:10 +0000 (12:04 +0100)] 
ci: Update mkosi action to latest commit

Let's make sure we're testing with the latest changes in mkosi. This
includes both the switch to systemd-repart and ukify, making sure we
get extra testing coverage for those components.

This also drops options from the centos config that have been removed
in the newer mkosi.

For some reason idmapping runs into some issues so we disable it for
now.

2 years agoman: libudev: fix typo
Ulrich Ölmann [Sun, 15 Jan 2023 17:04:35 +0000 (18:04 +0100)] 
man: libudev: fix typo

2 years agobusctl: fix introspecting DBus properties
Yu Watanabe [Fri, 13 Jan 2023 05:12:31 +0000 (14:12 +0900)] 
busctl: fix introspecting DBus properties

Follow-up for f2f7785d7a47ffa48ac929648794e1288509ddd8.

Fixes #26033.

2 years agotest: support a non-default SysV directory
Frantisek Sumsal [Fri, 13 Jan 2023 19:10:42 +0000 (20:10 +0100)] 
test: support a non-default SysV directory

Since the directory is configurable via -Dsysvinit-path= during build,
it makes the test fail on Fedora/RHEL/CentOS, where it's set to
/etc/rc.d/init.d, instead of the default /etc/init.d. Since we can't get
the value at runtime (in a reasonable manner), let's just support the
two most common paths for now.

Follow up to 7fcf0fab078ed92a4f6c3c3658c0a9dfd67c9601.

2 years agoopen-file: Fix user-after-free
Daan De Meyer [Fri, 13 Jan 2023 10:40:40 +0000 (11:40 +0100)] 
open-file: Fix user-after-free

2 years agosystemctl: list-dependencies: pass bool where appropriate
Mike Yuan [Fri, 13 Jan 2023 08:15:32 +0000 (16:15 +0800)] 
systemctl: list-dependencies: pass bool where appropriate

2 years agoMerge pull request #26047 from yuwata/udev-node-cleanups
Yu Watanabe [Fri, 13 Jan 2023 05:46:58 +0000 (14:46 +0900)] 
Merge pull request #26047 from yuwata/udev-node-cleanups

udev: several cleanups

2 years agoudev: simplify a bit stack_directory_find_prioritized_devnode() 26047/head
Franck Bui [Wed, 4 Jan 2023 13:59:00 +0000 (14:59 +0100)] 
udev: simplify a bit stack_directory_find_prioritized_devnode()

And make the new format the one we expect as it should replace the old one
pretty quickly.

2 years agoudev: return ENODEV if link_directory_read_one() can't find the devnode
Franck Bui [Tue, 3 Jan 2023 16:38:59 +0000 (17:38 +0100)] 
udev: return ENODEV if link_directory_read_one() can't find the devnode

That's usually the errno code we return when a device cannot be found because
it's been unplugged.

2 years agoudev: let stack_directory_open() convert a slink into a dirname itself
Franck Bui [Wed, 14 Dec 2022 18:04:16 +0000 (19:04 +0100)] 
udev: let stack_directory_open() convert a slink into a dirname itself

We likely always want to open the directory via a slink.

There's currently only one caller so it doesn't make any difference in practice
but I think it's still nicer.

No functional change.

2 years agoudev: merge link_directory_lock() into link_directory_open()
Franck Bui [Tue, 3 Jan 2023 17:34:11 +0000 (18:34 +0100)] 
udev: merge link_directory_lock() into link_directory_open()

These 2 operations are inseparable.

2 years agobootspec: show efi entry too
Ludwig Nussel [Thu, 12 Jan 2023 12:56:08 +0000 (13:56 +0100)] 
bootspec: show efi entry too

2 years agotest: explicitly create the /etc/init.d directory
Frantisek Sumsal [Thu, 12 Jan 2023 18:19:28 +0000 (19:19 +0100)] 
test: explicitly create the /etc/init.d directory

On RHEL/CentOS/Fedora this directory is provided by the chkconfig or
initscripts package, which might not be installed:

testsuite-26.sh[1225]: + [[ -x /usr/lib/systemd/system-generators/systemd-sysv-generator ]]
testsuite-26.sh[1225]: + cat
testsuite-26.sh[2330]: /usr/lib/systemd/tests/testdata/units/testsuite-26.sh: line 299: /etc/init.d/issue-24990: No such file or directory

Follow-up to 5f882cc3ab32636d9242effb2cefad20d92d2ec2.

2 years agocgroup: Do not emit compat message without memory limit
Michal Koutný [Thu, 29 Sep 2022 11:34:21 +0000 (13:34 +0200)] 
cgroup: Do not emit compat message without memory limit

Previously mere MemoryLow= directive would lead to emitting the compat
message 'Applying MemoryMax=18446744073709551615 as MemoryLimit=' even
though it carries little information.

2 years agodissect-image: Notify btrfs when we're done using a loop device
Daan De Meyer [Wed, 11 Jan 2023 15:21:01 +0000 (16:21 +0100)] 
dissect-image: Notify btrfs when we're done using a loop device

Let's explicitly let btrfs know when we're done using a loop device.
Otherwise, btrfs will keep the device UUID cached which will result
in mount() failures if we ever generate a device or filesystem with
the same UUID again.

2 years agoci: Fix PR labeling
Daan De Meyer [Thu, 12 Jan 2023 10:11:12 +0000 (11:11 +0100)] 
ci: Fix PR labeling

Make sure we only add labels to open pull request and remove labels
from closed pull requests.

2 years agoMerge pull request #25661 from yuwata/systemctl-suppress-warning
Zbigniew Jędrzejewski-Szmek [Thu, 12 Jan 2023 07:41:05 +0000 (08:41 +0100)] 
Merge pull request #25661 from yuwata/systemctl-suppress-warning

systemctl: suppress warning about missing /proc/ when --no-warn

2 years agonetwork: Show network and link file dropins in networkctl status
Daan De Meyer [Wed, 30 Nov 2022 15:13:23 +0000 (16:13 +0100)] 
network: Show network and link file dropins in networkctl status

Fixes #24428

2 years agonetwork: fix race between RTM_NEWLINK and NL82011_CMD_NEW_INTERFACE
Alvin Šipraga [Wed, 21 Dec 2022 15:14:28 +0000 (16:14 +0100)] 
network: fix race between RTM_NEWLINK and NL82011_CMD_NEW_INTERFACE

When a new wireless network interface is created by the kernel, it emits
both RTM_NEWLINK and NL80211_CMD_NEW_INTERFACE. These events can arrive
in either order and networkd must behave correctly in both cases.

The typical case is that RTM_NEWLINK is handled first, in which case
networkd creates a Link object and starts tracking it. When the
NL80211_CMD_NEW_INTERFACE message is handled, networkd then populates
the Link object with relevant wireless properties such as wireless
interface type (managed, AP, etc.).

In the event that the order is reversed however, networkd will fail to
populate these wireless properties because at the time of processing the
nl80211 message, the link is considered unknown. In that case, a debug
message is emitted:

  systemd-networkd[467]: nl80211: received new_interface(7) message for link '109' we don't know about, ignoring.

This is problematic because after the subsequent RTM_NEWLINK message,
networkd will have an incomplete view of the link. In particular, if a
.network configuration matches on some of the missing wireless
properties, such as WLANInterfaceType=, then it will never match.

The above race can be reproduced by using the mac80211_hwsim driver.
Suppose that there exists a .network configuration:

  [Match]
  WLANInterfaceType=ap
  ...

Now loop the creation/destruction of such an AP interface:

  while true
  do
    iw dev wlan0 interface add uap0 type __ap
    iw dev uap0 del
  done

The above debug message from networkd will then be observed very
quickly. And in that event, the .network file will fail to match.

To address the above race, have the nl80211 message handler store the
interface index in a set in case a Link object is not found on
NL80211_CMD_NEW_INTERFACE. The handler for RTM_NEWLINK can then query
this set, and explicitly request the wireless properties from nl80211
upon the creation of the Link object.

2 years agooptionally set socket priority on DHCPv4 raw socket
chris [Sun, 1 Jan 2023 13:59:20 +0000 (14:59 +0100)] 
optionally set socket priority on DHCPv4 raw socket

2 years agoshell-completion: systemctl: add --no-warn 25661/head
Yu Watanabe [Tue, 13 Dec 2022 00:05:11 +0000 (09:05 +0900)] 
shell-completion: systemctl: add --no-warn

2 years agosystemctl: suppress warning about missing /proc/ when --no-warn
Yu Watanabe [Wed, 7 Dec 2022 04:59:01 +0000 (13:59 +0900)] 
systemctl: suppress warning about missing /proc/ when --no-warn

Follow-up for 0f958c8d4fc13ed1c1af928b2a7d91d31c7576eb.

systemctl is called many times by dnf or so, and missing /proc/ is not
a user's fault, but package manager's issue.
With this commit, we can suppress the warning by updating rpm macros if
necessary.

2 years agoMerge pull request #26023 from keszybz/man-page-updates
Luca Boccassi [Wed, 11 Jan 2023 23:05:27 +0000 (23:05 +0000)] 
Merge pull request #26023 from keszybz/man-page-updates

Man page updates

2 years agocoredump: re-document raised default dump sizes
Jan Engelhardt [Wed, 11 Jan 2023 17:05:29 +0000 (18:05 +0100)] 
coredump: re-document raised default dump sizes

Commit v250-767-ge677041e7a updated the built-in configuration, but
missed the accompanying documentation.

2 years agoman: explain what kind of data is actually included in "systemd-analyze plot" output
Lennart Poettering [Wed, 11 Jan 2023 12:52:12 +0000 (13:52 +0100)] 
man: explain what kind of data is actually included in "systemd-analyze plot" output

Prompted by: https://lists.freedesktop.org/archives/systemd-devel/2023-January/048736.html

2 years agoman: Use ukify instead of objcopy in examples
Jan Janssen [Tue, 10 Jan 2023 15:00:49 +0000 (16:00 +0100)] 
man: Use ukify instead of objcopy in examples

These hardcoded VMA section offsets are a terrible thing and should
vanish from earth.

2 years agojournal: give the ability to enable/disable systemd-journald-audit.socket
Franck Bui [Tue, 6 Dec 2022 19:15:43 +0000 (20:15 +0100)] 
journal: give the ability to enable/disable systemd-journald-audit.socket

Before this patch the only way to prevent journald from reading the audit
messages was to mask systemd-journald-audit.socket. However this had main
drawback that downstream couldn't ship the socket disabled by default (beside
the fact that masking units is not supposed to be the usual way to disable
them).

Fixes #15777

2 years agoman: reword "string is extended into PCR" 26023/head
Zbigniew Jędrzejewski-Szmek [Wed, 11 Jan 2023 16:03:48 +0000 (17:03 +0100)] 
man: reword "string is extended into PCR"

Originally, people used "extend a PCR with a measurement" or
"measure some blob into the PCR". In our docs those uses got merged
into "extend a string into a PCR". The meaning is clear to developers, but
it's a very jargony syntax that wouldn't make any sense to somebody who encounters
it the first time. Let's return to the more natural original phrasing.

Also, change various "this is supposed to act as" to "this acts as". If it
doesn't work, we have a bug to fix. This indirection is not useful.

Also, "boot path" → "phase path" and other smaller cleanups.

2 years agoman: fix issues reported by the manpage-l10n project
Zbigniew Jędrzejewski-Szmek [Wed, 11 Jan 2023 15:45:59 +0000 (16:45 +0100)] 
man: fix issues reported by the manpage-l10n project

Fixes #25780.

> Man page: crypttab.5
> Issue 1:  Missing fullstop
> Issue 2:  I<cipher=>, I<hash=>, I<size=> → B<cipher=>, B<hash=>, B<size=>
>
> "Force LUKS mode\\&. When this mode is used, the following options are "
> "ignored since they are provided by the LUKS header on the device: "
> "I<cipher=>, I<hash=>, I<size=>"

Seems OK to me. The full stop is there and has been for at least a few years. And we use <option> for the markup, which is appropriate here.

> Man page: crypttab.5
> Issue 1:  Missing fullstop
> Issue 2:  I<cipher=>, I<hash=>, I<keyfile-offset=>, I<keyfile-size=>, I<size=> → B<cipher=>, B<hash=>, B<keyfile-offset=>, B<keyfile-size=>, B<size=>
>
> "Use TrueCrypt encryption mode\\&. When this mode is used, the following "
> "options are ignored since they are provided by the TrueCrypt header on the "
> "device or do not apply: I<cipher=>, I<hash=>, I<keyfile-offset=>, I<keyfile-"
> "size=>, I<size=>"

Same.

> Man page: journalctl.1
> Issue 1:  make be → may be

Fixed.

> Issue 2:  below\\&. → below:

Fixed.

> Man page: journalctl.1
> Issue:    Colon at the end?
>
> "The following commands are understood\\&. If none is specified the default "
> "is to display journal records\\&."
> msgstr ""
> "Die folgenden Befehle werden verstanden\\&. Falls keiner festgelegt ist, ist "
> "die Anzeige von Journal-Datensätzen die Vorgabe\\&."

This is a bit awkward, but I'm not sure how to fix it.

> Man page: kernel-install.8
> Issue:    methods a fallback → methods fallback

It was correct, but I added a comma to make the sense clearer.

> Man page: loader.conf.5
> Issue 1:  secure boot variables → Secure Boot variables
> Issue 2:  one → one for (multiple times)
>
> "Supported secure boot variables are one database for authorized images, one "
> "key exchange key (KEK) and one platform key (PK)\\&. For more information, "
> "refer to the \\m[blue]B<UEFI specification>\\m[]\\&\\s-2\\u[2]\\d\\s+2, "
> "under Secure Boot and Driver Signing\\&. Another resource that describe the "
> "interplay of the different variables is the \\m[blue]B<EDK2 "
> "documentation>\\m[]\\&\\s-2\\u[3]\\d\\s+2\\&."

"one of" would sound strange. "One this and one that" is OK.

> Man page: loader.conf.5
> Issue:    systemd-boot → B<systemd-boot>(7)

Fixed.

> Man page: logind.conf.5
> Issue:    systemd-logind → B<systemd-logind>(8)

We use <filename>systemd-logind</> on subsequent references… I think that's good enough.

> Man page: nss-myhostname.8
> Issue:    B<getent> → B<getent>(1)

Fixed.

> Man page: nss-resolve.8
> Issue:    B<systemd-resolved> → B<systemd-resolved>(8)

The first reference does this, subsequent are shorter.

> Man page: os-release.5
> Issue:    Portable Services → Portable Services Documentation?

Updated.

> Man page: pam_systemd_home.8
> Issue:    auth and account use "reason", while session and password do not?

Reworded.

> Man page: portablectl.1
> Issue:    In systemd-portabled.service(8): Portable Services Documentation

Updated.

> Man page: repart.d.5
> Issue:    The partition → the partition

Fixed.

> Man page: repart.d.5
> Issue:    B<systemd-repart> → B<systemd-repart>(8)

The first reference does this. I also change this one, because it's pretty far down in the text.

> Man page: systemd.1
> Issue:    kernel command line twice?
>
> "Takes a boolean argument\\&. If false disables importing credentials from "
> "the kernel command line, qemu_fw_cfg subsystem or the kernel command line\\&."

Apparently this was fixed already.

> Man page: systemd-boot.7
> Issue:    enrollement → enrollment

Fixed.

> Man page: systemd-cryptenroll.1
> Issue:    multiple cases: any specified → the specified

Reworded.

> Man page: systemd-cryptenroll.1
> Issue:    If this this → If this

Fixed tree-wide.

> Man page: systemd-cryptsetup-generator.8
> Issue:    and the initrd → and in the initrd

"Is honoured by the initrd" is OK, because we often speak about the initrd as a single unit. But in the same paragraph we also used "in the initrd", which makes the other use look sloppy. I changed it to "in the initrd" everywhere in that file.

> Man page: systemd.directives.7
> Issue:    Why are these two quoted (but not others)?
>
> "B<\\*(Aqh\\*(Aq>"
>
> B<\\*(Aqs\\*(Aq>"
>
> "B<\\*(Aqy\\*(Aq>"

This is autogenerated from files… We use slightly different markup in different files, and it's just too hard to make it consistent. We gave up on this.

> Man page: systemd.exec.5
> Issue 1:  B<at>(1p) → B<at>(1)
> Issue 2:  B<crontab>(1p) → B<crontab>(1)

Fixed.

> Man page: systemd.exec.5
> Issue:    B<select()> → B<select>(2)

Fixed.

> Man page: systemd.exec.5
> Issue:   qemu → B<qemu>(1)

The man page doesn't seem to be in any of the canonical places on the web.
I added a link to online docs.

> Man page: systemd.exec.5
> Issue:    variable → variables

Seems to be fixed already.

> Man page: systemd-integritysetup-generator.8
> Issue:    systemd-integritysetup-generator → B<systemd-integritysetup-generator>

I changed <filename> to <command>.

> Man page: systemd-integritysetup-generator.8
> Issue:    superfluous comma at the end

Already fixed.

> Man page: systemd-measure.1
> Issue:    (see B<--pcr-bank=>) below → (see B<--pcr-bank=> below)

Reworded.

> Man page: systemd-measure.1
> Issue:    =PATH> → =>I<PATH>

Fixed.

> Man page: systemd-measure.1.po
> Issue:    B<--bank=DIGEST> → B<--bank=>I<DIGEST>

Fixed.

> Man page: systemd.netdev.5
> Issue:    os the → on the

Appears to have been fixed already.

> Man page: systemd.netdev.5
> Issue:    Onboard → On-board (as in previous string)

Updated.

> Man page: systemd.network.5
> Issue:    B<systemd-networkd> -> B<systemd-networkd>(8)

First reference does this, subsequent do not.

> Man page: systemd.network.5
> Issue:    B<netlabelctl> → B<netlabelctl>(8)

First reference does this, subsequent do not.

> Man page: systemd.network.5
> Issue:    Missing verb (aquired? configured?) in the half sentence starting with "or by a "

I dropped the comma.

> Man page: systemd-nspawn.1
> Issue:    All host users outside of that range → All other host users

Reworded.

> # FIXME no effect → no effect\\&.
> #. type: Plain text
> #: archlinux debian-unstable fedora-rawhide mageia-cauldron opensuse-tumbleweed
> msgid ""
> "Whichever ID mapping option is used, the same mapping will be used for users "
> "and groups IDs\\&. If B<rootidmap> is used, the group owning the bind "
> "mounted directory will have no effect"

A period is added. Not sure if there's some other issue.

> Man page: systemd-oomd.service.8
> Issue:    B<systemd> → B<systemd>(1)

Done.

> Man page: systemd.path.5
> Issue 1:  B<systemd.exec>(1) → B<systemd.exec>(5)
> Issue 2:  This section does not (yet?) exist

Fixed.

> Man page: systemd-pcrphase.service.8
> Issue 1:  indicate phases into TPM2 PCR 11 ??
> Issue 2: Colon at the end of the paragraph?

Fixed.

> Man page: systemd-pcrphase.service.8
> Issue:    final boot phase → final shutdown phase?

Updated.

> Man page: systemd-pcrphase.service.8
> Issue:    for the the → for the

Fixed tree-wide.

> Man page: systemd-portabled.service.8
> Issue:    In systemd-portabled.service(8): Portable Services Documentation

Updated.

> Man page: systemd-pstore.service.8
> Issue:    Here and the following paragraphs: . → \\&. // Upstream: What does this comment mean? // You normally write \\&. for a full dot (full stop etc.); here you write only "." (i.e. a plain dot).
>
> "and we look up \"localhost\", nss-dns will send the following queries to "
> "systemd-resolved listening on 127.0.0.53:53: first \"localhost.foobar.com\", "
> "then \"localhost.barbar.com\", and finally \"localhost\". If (hopefully) the "
> "first two queries fail, systemd-resolved will synthesize an answer for the "
> "third query."

Looks all OK to me.

> Man page: systemd.resource-control.5
> Issue:    Missing closing bracket after link to Control Groups version 1

Fixed.

> Man page: systemd-sysext.8
> Issue:    In systemd-portabled.service(8): Portable Services Documentation

Updated.

> Man page: systemd.timer.5
> Issue 1:  B<systemd.exec>(1) → B<systemd.exec>(5)
> Issue 2:  This section does not (yet?) exist

Fixed.

> Man page: systemd.unit.5
> Issue:    that is → that are

Fixed.

> Man page: systemd-veritysetup-generator.8
> Issue:    systemd-veritysetup-generator → B<systemd-veritysetup-generator>
>
 > "systemd-veritysetup-generator implements B<systemd.generator>(7)\\&."
>
> "systemd-veritysetup-generator understands the following kernel command line "
> "parameters:"

Updated.

> Man page: systemd-volatile-root.service.8
> Issue:    initrdyes → Initrd

Fixed.

> Man page: sysupdate.d.5
> Issue:    : → \\&. (As above in TRANSFER)

Updated.

> Man page: sysupdate.d.5
> Issue:    some → certain

Updated.

> Man page: sysupdate.d.5
> Issue 1:  i\\&.e\\& → I\\&.e\\&

Fixed.

> Issue 2:  the image → the system

"image" seems correct.

> Man page: tmpfiles.d.5
> Issue:    systemd-tmpfiles → B<systemd-tmpfiles>(8)

Updated.

2 years agogithub: use 'meson setup'
Zbigniew Jędrzejewski-Szmek [Wed, 11 Jan 2023 14:04:11 +0000 (15:04 +0100)] 
github: use 'meson setup'

Meson started warning when 'setup' is not used:
WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.

Also add more quoting in output to make the message clearer.

2 years agohwdb: Add mount matrix for Linx 1020
Spindle Security [Wed, 11 Jan 2023 09:57:20 +0000 (09:57 +0000)] 
hwdb: Add mount matrix for Linx 1020

2 years agoMerge pull request #26016 from poettering/base64mem-ret-fix
Lennart Poettering [Wed, 11 Jan 2023 12:57:03 +0000 (13:57 +0100)] 
Merge pull request #26016 from poettering/base64mem-ret-fix

base64mem() return type fix

2 years agotree-wide: fix return value handling of base64mem() 26016/head
Lennart Poettering [Wed, 11 Jan 2023 09:42:05 +0000 (10:42 +0100)] 
tree-wide: fix return value handling of base64mem()

This returns an ssize_t, not an int. On populare archs that's the
difference between 64bit and 32bit. hence, let's be more careful here,
and not silently drop half the bits on the ground by assigning the
return value to "int".

As noticed by @malikabhi05:

https://github.com/systemd/systemd/pull/24754#discussion_r1062903159

2 years agohexdecoct: modernize base64mem() variable naming a bit
Lennart Poettering [Wed, 11 Jan 2023 09:44:16 +0000 (10:44 +0100)] 
hexdecoct: modernize base64mem() variable naming a bit

Just some renaming addressing the fact we otherwise always call return
parameters "ret", and the local error variable "r".

no change in behaviour.

2 years agoMerge pull request #26014 from yuwata/network-l2tp-fixes
Luca Boccassi [Wed, 11 Jan 2023 09:32:50 +0000 (09:32 +0000)] 
Merge pull request #26014 from yuwata/network-l2tp-fixes

network: L2TP fixlets

2 years agoukify: Fix tools detection if --tools was not passed
Jan Janssen [Tue, 10 Jan 2023 14:13:22 +0000 (15:13 +0100)] 
ukify: Fix tools detection if --tools was not passed

In 789a642738d28cf2a8ad3f65df9c0c136e83af09 llvm-objcopy was given
higher priority over objcopy, but this would only work if --tools was
also passed.

2 years agoMerge pull request #25916 from poettering/reload-notify
Lennart Poettering [Wed, 11 Jan 2023 08:23:47 +0000 (09:23 +0100)] 
Merge pull request #25916 from poettering/reload-notify

pid1: add new Type=notify-reload service type for a service reload protocol based on SIGHUP

2 years agonetwork/l2tp: parse address or address type from correct string 26014/head
Yu Watanabe [Wed, 11 Jan 2023 04:11:36 +0000 (13:11 +0900)] 
network/l2tp: parse address or address type from correct string

Fixes a bug introduced by 8b49ee2dcda04f8147650f7d9fb93662caf3ea2e.

Fixes #26011.

2 years agonetwork/l2tp: fix error code in log message
Yu Watanabe [Wed, 11 Jan 2023 04:11:00 +0000 (13:11 +0900)] 
network/l2tp: fix error code in log message

2 years agoMerge pull request #25986 from yuwata/test-netlink
Luca Boccassi [Tue, 10 Jan 2023 21:21:24 +0000 (21:21 +0000)] 
Merge pull request #25986 from yuwata/test-netlink

test-netlink: cleanups

2 years agoupdate TODO 25916/head
Lennart Poettering [Mon, 2 Jan 2023 15:48:51 +0000 (16:48 +0100)] 
update TODO

2 years agotest: add Type=notify-reload testcase
Lennart Poettering [Tue, 3 Jan 2023 11:56:53 +0000 (12:56 +0100)] 
test: add Type=notify-reload testcase

2 years agonotify: add --stopping + --reloading switches
Lennart Poettering [Tue, 3 Jan 2023 11:55:50 +0000 (12:55 +0100)] 
notify: add --stopping + --reloading switches

These wrap RELOADING=1 and STOPPING=1 messages. The former is
particularly useful, since we want to insert the MONOTONIC_USEC= field
into the message automatically, which is easy from C but harder from
shell.

2 years agologind: implement Type=notify-reload protocol properly
Lennart Poettering [Mon, 2 Jan 2023 16:35:23 +0000 (17:35 +0100)] 
logind: implement Type=notify-reload protocol properly

So close already. Let's add the two missing notifications too.

Fixes: #18484
2 years agoudevd: implement the full Type=notify-reload protocol
Lennart Poettering [Mon, 2 Jan 2023 16:21:16 +0000 (17:21 +0100)] 
udevd: implement the full Type=notify-reload protocol

We are basically already there, just need to add MONOTONIC_USEC= to the
RELOADING=1 message, and make sure the message is generated in really
all cases.

2 years agonetworkd: implement Type=notify-reload protocol
Lennart Poettering [Mon, 2 Jan 2023 16:25:46 +0000 (17:25 +0100)] 
networkd: implement Type=notify-reload protocol

2 years agopid1: make sure we send our calling service manager RELOADING=1 when reloading
Lennart Poettering [Mon, 2 Jan 2023 14:01:56 +0000 (15:01 +0100)] 
pid1: make sure we send our calling service manager RELOADING=1 when reloading

And send READY=1 again when we are done with it.

We do this not only for "daemon-reload" but also for "daemon-reexec" and
"switch-root", since from the perspective of an encapsulating service
manager these three operations are not that different.

2 years agoman: document Type=notify-reload
Lennart Poettering [Mon, 2 Jan 2023 17:13:27 +0000 (18:13 +0100)] 
man: document Type=notify-reload

2 years agopid1: add new Type=notify-reload service type
Lennart Poettering [Mon, 2 Jan 2023 15:49:23 +0000 (16:49 +0100)] 
pid1: add new Type=notify-reload service type

Fixes: #6162