]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
8 months agoMerge pull request #24570 from topimiettinen/nft-sets-v2
Yu Watanabe [Fri, 1 Sep 2023 11:13:39 +0000 (20:13 +0900)] 
Merge pull request #24570 from topimiettinen/nft-sets-v2

network: firewall integration with NFT sets

8 months agoglyph-util: bring glyphs into same order everywhere
Lennart Poettering [Wed, 12 Jul 2023 20:28:12 +0000 (22:28 +0200)] 
glyph-util: bring glyphs into same order everywhere

The enum definition, the two string tables and the test all were using
different orders (and in case of the test even missed entries).

Let's unify this, and make sure we always use the same order. This
settles the confusion, and makes the order used for the unicode string
table the canonical one, adjusting the other lists to match it. And adds
the missing entries to the tets.

8 months agoMerge pull request #29004 from poettering/measure-log
Lennart Poettering [Thu, 31 Aug 2023 07:47:35 +0000 (09:47 +0200)] 
Merge pull request #29004 from poettering/measure-log

tpm2: whenever we measure, also write a tpm log record

8 months agoNEWS: Typo
Milton D. Miller II [Wed, 30 Aug 2023 19:22:46 +0000 (14:22 -0500)] 
NEWS: Typo

Let's not encourage the lawyers.

8 months agobusctl: do not print start/stop monitoring messages with --quiet/--json
Luca Boccassi [Wed, 30 Aug 2023 17:56:07 +0000 (18:56 +0100)] 
busctl: do not print start/stop monitoring messages with --quiet/--json

8 months agomkosi: pin CentOS9 kernel to working version
Luca Boccassi [Wed, 30 Aug 2023 11:57:49 +0000 (12:57 +0100)] 
mkosi: pin CentOS9 kernel to working version

Newer kernels are affected by a regression that causes a kernel panic
on shutdown, so pin them for now. Can be reverted once that problem is
fixed.

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

8 months agotest: add test for new measurement log 29004/head
Lennart Poettering [Wed, 30 Aug 2023 10:53:06 +0000 (12:53 +0200)] 
test: add test for new measurement log

8 months agotpm2: whenever we measure, also write a tpm log record
Lennart Poettering [Fri, 7 Jul 2023 19:45:54 +0000 (21:45 +0200)] 
tpm2: whenever we measure, also write a tpm log record

Previously we only logged our measurements to the journal. This is not a
great solution though, since regular logs are subject to rotation, which
is something we really cannot have for measurements (as it means we can
never reproduce the PCR values from the data). Hence, let's maintain an
explicit log.

Ideally, we'd just use the TCG Canonical Event Log format 1:1
(https://trustedcomputinggroup.org/resource/canonical-event-log-format/).
However it's not a perfect fit fo us, for various reasons. But let's
follow it (in its JSON incantation) as closely at it makes sense, so
that it can easily be converted to the full format by programs consuming
it.

Code comments explain where we deviate from the TCG CEL-JSON, and what
to do about it when reading the data.

8 months agoMerge pull request #29013 from yuwata/sd-dhcp-client-ensure-iaid-and-duid
Luca Boccassi [Wed, 30 Aug 2023 10:51:39 +0000 (11:51 +0100)] 
Merge pull request #29013 from yuwata/sd-dhcp-client-ensure-iaid-and-duid

sd-dhcp-client: set IAID and DUID earlier

8 months agoRevert "test-dhcp-client: add temporary workaround for assertion failure" 29013/head
Yu Watanabe [Wed, 30 Aug 2023 08:26:57 +0000 (17:26 +0900)] 
Revert "test-dhcp-client: add temporary workaround for assertion failure"

This reverts commit 1686c884bfa846f8da87621e87870eb18dd8107c.

The issue should be fixed by the previous commit. Let's drop the
workaround.

8 months agosd-dhcp-client: ensure IAID and DUID being set on start
Yu Watanabe [Wed, 30 Aug 2023 08:33:01 +0000 (17:33 +0900)] 
sd-dhcp-client: ensure IAID and DUID being set on start

After b2851e8d6287ab9bb3cd6e42395271c45ce0e377, if IAID and DUID are not
set on start, calling sd_dhcp_client_set_iaid_duid_en() in
client_message_init() triggers assertion, as the client is already
running at the stage. Let's set IAID and DUID earlier.

Fixes #28990.

8 months agoMerge pull request #29007 from tormath1/tormath1/reload
Mike Yuan [Tue, 29 Aug 2023 16:39:30 +0000 (00:39 +0800)] 
Merge pull request #29007 from tormath1/tormath1/reload

sysext: fix around `--root` support

8 months agoMerge pull request #28955 from poettering/generic-pe
Luca Boccassi [Tue, 29 Aug 2023 15:09:54 +0000 (16:09 +0100)] 
Merge pull request #28955 from poettering/generic-pe

unify two disparate PE executable parsers we currently have into one

8 months agoMerge pull request #28999 from keszybz/two-man-ukify-fixe
Luca Boccassi [Tue, 29 Aug 2023 15:08:49 +0000 (16:08 +0100)] 
Merge pull request #28999 from keszybz/two-man-ukify-fixe

Make ukify non-experimental

8 months agoMerge pull request #28900 from abderrahim/version-info
Zbigniew Jędrzejewski-Szmek [Tue, 29 Aug 2023 13:59:48 +0000 (16:59 +0300)] 
Merge pull request #28900 from abderrahim/version-info

man: add version info

8 months agomkfs-util: propagate SOURCE_DATE_EPOCH to mcopy
Malte Poll [Mon, 28 Aug 2023 15:20:36 +0000 (17:20 +0200)] 
mkfs-util: propagate SOURCE_DATE_EPOCH to mcopy

Co-authored-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
8 months agoman: add version info 28900/head
Abderrahim Kitouni [Tue, 22 Aug 2023 16:52:36 +0000 (17:52 +0100)] 
man: add version info

This tries to add information about when each option was added. It goes
back to version 183.

The version info is included from a separate file to allow generating it,
which would allow more control on the formatting of the final output.

8 months agoukify: fail if the config file was not read 28999/head
Zbigniew Jędrzejewski-Szmek [Mon, 28 Aug 2023 15:44:42 +0000 (18:44 +0300)] 
ukify: fail if the config file was not read

Inspired by https://github.com/systemd/systemd/pull/28997.
Noticed by Alvin Alvarado <alvin@striczkof.io>.

8 months agoukify: move to /usr/bin and mark as non non-experimental
Zbigniew Jędrzejewski-Szmek [Mon, 28 Aug 2023 15:22:43 +0000 (18:22 +0300)] 
ukify: move to /usr/bin and mark as non non-experimental

The notice in the man page is removed and the tool is moved into the $PATH.
A compat symlink is provided.

It is fairly widely used now, and realistically we need to keep backwards
compat or people will be very unhappy.

8 months agoman/ukify: fix synopsis
Zbigniew Jędrzejewski-Szmek [Mon, 28 Aug 2023 15:20:56 +0000 (18:20 +0300)] 
man/ukify: fix synopsis

Fixup for 7d481546acc8dbd9be05fe7a901e5598487aec02 and
a3f758b3104ee1161d2dbf5a8c1be653340b1672.

8 months agosysext: skip the reload if `--root=` is provided 29007/head
Mathieu Tortuyaux [Tue, 29 Aug 2023 08:52:38 +0000 (10:52 +0200)] 
sysext: skip the reload if `--root=` is provided

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
8 months agosysext: fix `--root=` support
Mathieu Tortuyaux [Tue, 29 Aug 2023 11:42:16 +0000 (13:42 +0200)] 
sysext: fix `--root=` support

when provided `--root=` was failing for `status`:
```
$ systemd-sysext --root=/mnt status
Failed to open '/usr/.systemd-sysext/extensions': No such file or directory
```

path was not relative to the given `--root` - same goes for the `need_reload`
as it was inspired from the `verb_status` section.

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
8 months agoshared: remove now unused pe-header.h 28955/head
Lennart Poettering [Thu, 24 Aug 2023 13:42:06 +0000 (15:42 +0200)] 
shared: remove now unused pe-header.h

8 months agoshared: port kernel-image.c over to new common PE parser
Lennart Poettering [Thu, 24 Aug 2023 13:41:32 +0000 (15:41 +0200)] 
shared: port kernel-image.c over to new common PE parser

8 months agoshared: port bootspec.c over to new common PE parser
Lennart Poettering [Thu, 24 Aug 2023 13:41:09 +0000 (15:41 +0200)] 
shared: port bootspec.c over to new common PE parser

8 months agoshared: add common implementation of PE parser
Lennart Poettering [Thu, 24 Aug 2023 13:40:41 +0000 (15:40 +0200)] 
shared: add common implementation of PE parser

8 months agoMerge pull request #28998 from YHNdnzj/logind-vt-handling
Luca Boccassi [Tue, 29 Aug 2023 00:09:10 +0000 (01:09 +0100)] 
Merge pull request #28998 from YHNdnzj/logind-vt-handling

logind: several cleanups

8 months agomeson: Fix version script
Jan Janssen [Mon, 28 Aug 2023 17:18:37 +0000 (19:18 +0200)] 
meson: Fix version script

Apparently, the `|` has a higher priority…

8 months agotest: fix debugging of nspawn tests
Frantisek Sumsal [Mon, 28 Aug 2023 20:42:36 +0000 (22:42 +0200)] 
test: fix debugging of nspawn tests

The pipe stuff introduced in 701e0c2660 causes nspawn to switch the
console from 'interactive' into 'read-only' which is a bit useless when
debugging. Let's set --console=interactive explicitly in such case.

Follow-up to 701e0c2660.

8 months agoman: Add xinclude namespace
Abderrahim Kitouni [Tue, 22 Aug 2023 16:52:02 +0000 (17:52 +0100)] 
man: Add xinclude namespace

This will be used by the next commit to add version information to the
nodes.

8 months agoMerge pull request #28328 from yuwata/network-ndisc-limit-captive-portal
Luca Boccassi [Mon, 28 Aug 2023 16:45:22 +0000 (17:45 +0100)] 
Merge pull request #28328 from yuwata/network-ndisc-limit-captive-portal

network: limit number of captive portals by RA

8 months agoRevert "Revert "test: add test case for systemd-update-utmp vs daemon-reexec""
Mike Yuan [Mon, 28 Aug 2023 09:29:31 +0000 (17:29 +0800)] 
Revert "Revert "test: add test case for systemd-update-utmp vs daemon-reexec""

This reverts commit 837773add465bd0a0d1f598203d297cf0129468b.

The original issue #27287 is fixed by #28123. Let's
reintroduce the test for systemd-update-utmp.

8 months agoMerge pull request #28948 from poettering/tpm2-duplicate-pcr-names
Luca Boccassi [Mon, 28 Aug 2023 16:43:10 +0000 (17:43 +0100)] 
Merge pull request #28948 from poettering/tpm2-duplicate-pcr-names

tpm2: unify tpm2 PCR symbolic identifiers

8 months agoMerge pull request #28916 from ddstreet/tpm2_pcr_value_post_merge
Luca Boccassi [Mon, 28 Aug 2023 16:42:48 +0000 (17:42 +0100)] 
Merge pull request #28916 from ddstreet/tpm2_pcr_value_post_merge

Tpm2 pcr value post merge

8 months agologind-session: generalize EIO handling for {restore,leave}_vt 28998/head
Mike Yuan [Mon, 28 Aug 2023 14:33:33 +0000 (22:33 +0800)] 
logind-session: generalize EIO handling for {restore,leave}_vt

Replaces #28949

8 months agologind: add missing asserts
Mike Yuan [Mon, 28 Aug 2023 13:21:06 +0000 (21:21 +0800)] 
logind: add missing asserts

8 months agologind: use hashmap value destructors
Mike Yuan [Mon, 28 Aug 2023 13:20:44 +0000 (21:20 +0800)] 
logind: use hashmap value destructors

8 months agologind: rephrase log messages
Mike Yuan [Mon, 28 Aug 2023 12:44:19 +0000 (20:44 +0800)] 
logind: rephrase log messages

8 months agologin: Properly handle -EIO in session_leave_vt
msizanoen [Thu, 24 Aug 2023 09:42:37 +0000 (16:42 +0700)] 
login: Properly handle -EIO in session_leave_vt

session_leave_vt may be called after the VT device was hung up, which
will cause vt_release to fail with -EIO. This is known to cause an issue
with GNOME 44 on Fedora where gdm-session-worker sometimes freezes when
trying to switch to VT 1 after a `loginctl terminate-user` operation.

Fix this by reopening the VT in session_leave_vt if we get an -EIO.

8 months agosd-radv: fix memory leak
Susant Sahani [Mon, 28 Aug 2023 10:21:22 +0000 (15:51 +0530)] 
sd-radv: fix memory leak

8 months agomeson: restore specifications of dependency on version_h
Zbigniew Jędrzejewski-Szmek [Mon, 28 Aug 2023 11:46:24 +0000 (14:46 +0300)] 
meson: restore specifications of dependency on version_h

This partially reverts 3c1eee5beda642707037b189481c3c30d1668da7.
I thought that it is not necessary, but
https://mesonbuild.com/Reference-manual_functions.html#vcs_tag says:

> This method returns a custom_tgt should be used to signal dependencies if
> other targets use the file outputted by this.
>
> For example, if you generate a header with this and want to use that in a
> build target, you must add the return value to the sources of that build
> target. Without that, Meson will not know the order in which to build the
> targets.

We can use version_h directly, since we already have it.

Hopefully fixes https://github.com/systemd/systemd/issues/28994.

8 months agotest-dhcp-client: add temporary workaround for assertion failure
Luca Boccassi [Mon, 28 Aug 2023 10:03:45 +0000 (11:03 +0100)] 
test-dhcp-client: add temporary workaround for assertion failure

Workaround for https://github.com/systemd/systemd/issues/28990

Introduced by https://github.com/systemd/systemd/pull/28932 but CI was
green there. Add a workaround to get the CI back in shape while it is
being investigated.

8 months agoboot: don't pass kernel cmdline option to UKIs which have the very same line built-in
Lennart Poettering [Mon, 21 Aug 2023 16:18:41 +0000 (18:18 +0200)] 
boot: don't pass kernel cmdline option to UKIs which have the very same line built-in

There's really no point in first extracting a command line from an UKI
to just pass it unmodified to the UKI. In particular as this is
systematically ignored in SecureBoot is enabled.

Let's drop this, so that unless the user actually edits the cmdline we
pass nothing to the invoked kernel.

Note that this low-key is a compat break, since the passed cmdline gets
measured. However, in the interest of minimized the difference between
systems with and without sd-boot to behave the same i think we should
suppress the command line anyway.

8 months ago99-systemd.rules.in: tag PTP devices with systemd
Chris Patterson [Fri, 25 Aug 2023 21:23:40 +0000 (17:23 -0400)] 
99-systemd.rules.in: tag PTP devices with systemd

Chronyd and similar time services, when using PTP devices, may need
the BindsTo/After directives to ensure the devices are available
before starting.  Tag PTP devices with systemd to allow for wider
adoption.

Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
8 months agosd-dhcp-client: make client initially in stopped state
Yu Watanabe [Wed, 23 Aug 2023 04:25:35 +0000 (13:25 +0900)] 
sd-dhcp-client: make client initially in stopped state

Previously, DHCP_STATE_STOPPED and DHCP_STATE_INIT are both handled as
not-running. Moreover, previously after sd_dhcp_client_start() is
called, the client still in INIT state (and thus handled as not-running)
even if its internal timer event sources are initialized.

Let's make only STOPPED state handled as not-running, and make the
client initially in STOPPED state.

Prompted by #28896.

8 months agopkg.m4 macro needs brackets
Michael Vasseur [Thu, 24 Aug 2023 19:47:05 +0000 (21:47 +0200)] 
pkg.m4 macro needs brackets

See documentation at: https://manpages.debian.org/testing/pkgconf/pkg.m4.7.en.html

Without this the macro was not always correctly resolved so the correct command was not used in the rest of the snippet.

8 months agoMerge pull request #28977 from keszybz/drop-versiondep
Luca Boccassi [Mon, 28 Aug 2023 09:02:01 +0000 (10:02 +0100)] 
Merge pull request #28977 from keszybz/drop-versiondep

meson: simplify handling of the version tag

8 months agoman/gpt-auto-generator: avoid saying "negative" for boolean
Zbigniew Jędrzejewski-Szmek [Sun, 27 Aug 2023 14:10:38 +0000 (17:10 +0300)] 
man/gpt-auto-generator: avoid saying "negative" for boolean

Fixes #28928.

8 months agoMerge pull request #28968 from DaanDeMeyer/rlimit
Zbigniew Jędrzejewski-Szmek [Sun, 27 Aug 2023 14:06:58 +0000 (16:06 +0200)] 
Merge pull request #28968 from DaanDeMeyer/rlimit

Limit rlim_max in rlimit_nofile_safe() to nr_open

8 months agoman: Fix typo in config file example for ukify
Alvin Alvarado [Sat, 26 Aug 2023 13:25:46 +0000 (23:25 +1000)] 
man: Fix typo in config file example for ukify

or else it would output 'Unknown config setting [UKI] SecureBootCerificate=' or just an error outright if not overrode.

8 months agoshared/firewall-util: promote failure to init ipv6 NAT to error 24570/head
Topi Miettinen [Wed, 9 Aug 2023 19:53:29 +0000 (22:53 +0300)] 
shared/firewall-util: promote failure to init ipv6 NAT to error

8 months agotest: testing for networkd NFTSet feature
Topi Miettinen [Wed, 9 Aug 2023 20:16:24 +0000 (23:16 +0300)] 
test: testing for networkd NFTSet feature

8 months agonetwork: firewall integration with NFT sets
Topi Miettinen [Wed, 9 Aug 2023 20:07:21 +0000 (23:07 +0300)] 
network: firewall integration with NFT sets

New directive `NFTSet=` provides a method for integrating network configuration
into firewall rules with NFT sets. The benefit of using this setting is that
static network configuration or dynamically obtained network addresses can be
used in firewall rules with the indirection of NFT set types. For example,
access could be granted for hosts in the local subnetwork only. Firewall rules
using IP address of an interface are also instantly updated when the network
configuration changes, for example via DHCP.

This option expects a whitespace separated list of NFT set definitions. Each
definition consists of a colon-separated tuple of source type (one of
"address", "prefix", or "ifindex"), NFT address family (one of "arp", "bridge",
"inet", "ip", "ip6", or "netdev"), table name and set name. The names of tables
and sets must conform to lexical restrictions of NFT table names. The type of
the element used in the NFT filter must match the type implied by the
directive ("address", "prefix" or "ifindex") and address type (IPv4 or IPv6)
as shown type implied by the directive ("address", "prefix" or "ifindex") and
address type (IPv4 or IPv6) must also match the set definition.

When an interface is configured with IP addresses, the addresses, subnetwork
masks or interface index will be appended to the NFT sets. The information will
be removed when the interface is deconfigured. systemd-networkd only inserts
elements to (or removes from) the sets, so the related NFT rules, tables and
sets must be prepared elsewhere in advance. Failures to manage the sets will be
ignored.

/etc/systemd/network/eth.network
```
[DHCPv4]
...
NFTSet=prefix:netdev:filter:eth_ipv4_prefix
```

Example NFT rules:
```
table netdev filter {
        set eth_ipv4_prefix {
                type ipv4_addr
                flags interval
        }
        chain eth_ingress {
                type filter hook ingress device "eth0" priority filter; policy drop;
                ip saddr != @eth_ipv4_prefix drop
                accept
        }
}
```
```
$ sudo nft list set netdev filter eth_ipv4_prefix
table netdev filter {
        set eth_ipv4_prefix {
                type ipv4_addr
                flags interval
                elements = { 10.0.0.0/24 }
        }
}
```

8 months agomeson: drop "versiondep" object 28977/head
Zbigniew Jędrzejewski-Szmek [Sat, 26 Aug 2023 09:36:02 +0000 (11:36 +0200)] 
meson: drop "versiondep" object

It was added to make sure that the version tag was built early
enough. Now that we use vcs_tag, meson should take care of building
it early enough.

8 months agomeson: simplify version_tag handling
Zbigniew Jędrzejewski-Szmek [Sat, 26 Aug 2023 07:17:44 +0000 (09:17 +0200)] 
meson: simplify version_tag handling

Let's also use vcs_tag() when we're doing a non-git build. In those scenarios,
the build would normally be done just once in a given copy, so doing an extra
call does not matter. We can save a few lines of meson config.

The special path was added in 064b8e2c99ceb348c515353cc5c7d7bd05c49fcb, with
the justifaction that vcs_tag() is slow and -Dversion-tag=foo can be used to
fix the version tag and speed up partial rebuilds. I think the justification
for this is weak: having an accurate version tag is particularly useful when
developing the code. Shaving of a fraction of a second at the cost of having to
manually update the version seems iffy.

Secondly, with vcs_tag() we can be pretty sure that meson will build the
version file first and that it'll be available to all build steps. Because we
didn't use version tag, we had to manually specify the dependency on version.h
in various places. It seems nicer to use vcs_tag() and not have to deal with
this problem at all.

Finally, the savings in time seem much smaller than back when
064b8e2c99ceb348c515353cc5c7d7bd05c49fcb was made. It reported a change
from 94 ms to 521 ms. But now the difference seems to be about 50 ms:

Before this patch:
$ time ninja -C build
ninja: Entering directory `build'
ninja: no work to do.
ninja -C build  0.04s user 0.02s system 97% cpu 0.057 total
ninja -C build  0.03s user 0.01s system 97% cpu 0.049 total
ninja -C build  0.03s user 0.02s system 96% cpu 0.051 total
ninja -C build  0.03s user 0.01s system 96% cpu 0.049 total
ninja -C build  0.03s user 0.01s system 97% cpu 0.046 total

With the two patches in this PR:
systemd-stable [drop-versiondep] time ninja -C build
ninja: Entering directory `build'
[1/669] Generating version.h with a custom command
ninja -C build  0.08s user 0.03s system 98% cpu 0.106 total
ninja -C build  0.08s user 0.03s system 98% cpu 0.104 total
ninja -C build  0.09s user 0.02s system 98% cpu 0.116 total
ninja -C build  0.08s user 0.02s system 97% cpu 0.108 total

Overall, I think the tiny time savings are not worth the complexity.

8 months agoUpdate 60-sensor.hwdb (#28804)
Juno Computers [Sat, 26 Aug 2023 13:35:57 +0000 (09:35 -0400)] 
Update 60-sensor.hwdb (#28804)

Updated T11/Juno Tab 2.

8 months agomeson: Bring back use of vcs_tag
Jan Janssen [Fri, 25 Aug 2023 11:07:55 +0000 (13:07 +0200)] 
meson: Bring back use of vcs_tag

The use of vcs_tag was dropped in #28567, which results in builds having
stale version information once new commit are made.

This also fixes a case where CI builds would have no version information
because they are checked out without any tags for git-describe to use.

Additionally, use `--git-dir` now, as that particular issues seems to
have been fixed by now.

8 months agomount/mount-tool: return correct errno
Mike Yuan [Fri, 25 Aug 2023 17:11:55 +0000 (01:11 +0800)] 
mount/mount-tool: return correct errno

Follow-up for 9269296df05a724c6b121bcbb0b420c8b4088f2f

8 months agoMerge pull request #28913 from keszybz/tmpfs-top-level-dir-mode
Zbigniew Jędrzejewski-Szmek [Fri, 25 Aug 2023 16:36:30 +0000 (18:36 +0200)] 
Merge pull request #28913 from keszybz/tmpfs-top-level-dir-mode

systemd-mount: do not create tmpfs mounts with sticky permission bit

8 months agonetwork: sd-radv - Introduce pref64 support (RFC8781)
Susant Sahani [Fri, 28 Jul 2023 17:21:50 +0000 (22:51 +0530)] 
network: sd-radv - Introduce pref64 support (RFC8781)

Implements: https://datatracker.ietf.org/doc/html/rfc8781

```

[IPv6PREF64Prefix]
Prefix=2003:da8:1:0::/64
ValidLifetimeSec=30m

Frame 16: 126 bytes on wire (1008 bits), 126 bytes captured (1008 bits) on interface veth99, id 0
Ethernet II, Src: 06:c7:41:95:1d:7f (06:c7:41:95:1d:7f), Dst: IPv6mcast_01 (33:33:00:00:00:01)
Internet Protocol Version 6, Src: fe80::4c7:41ff:fe95:1d7f, Dst: ff02::1
Internet Control Message Protocol v6
    Type: Router Advertisement (134)
    Code: 0
    Checksum: 0x0ca0 [correct]
    [Checksum Status: Good]
    Cur hop limit: 0
    Flags: 0x00, Prf (Default Router Preference): Medium
    Router lifetime (s): 1800
    Reachable time (ms): 0
    Retrans timer (ms): 0
    ICMPv6 Option (Source link-layer address : 06:c7:41:95:1d:7f)
    ICMPv6 Option (Prefix information : 2002:da8:1::/64)
    ICMPv6 Option (PREF64 Option)
        Type: PREF64 Option (38)
        Length: 2 (16 bytes)
        0000 0111 0000 1... = Scaled Lifetime: 225
        .... .... .... .001 = PLC (Prefix Length Code): 64 bits prefix length (0x1)
        Prefix: 64:ff9b::

```

8 months agoLimit rlim_max in rlimit_nofile_safe() to nr_open 28968/head
Daan De Meyer [Fri, 25 Aug 2023 11:55:36 +0000 (13:55 +0200)] 
Limit rlim_max in rlimit_nofile_safe() to nr_open

We might inherit a max rlim value that's larger than the kernel's
maximum (nr_open). This will cause setrlimit() to fail as the given
maximum is larger than the kernel's maximum. To get around this,
let's limit the max rlim we pass to rlimit() to the value of nr_open.

Should fix #28965

8 months agomkfs-util: Set FORK_REOPEN_LOG
Daan De Meyer [Fri, 25 Aug 2023 12:25:33 +0000 (14:25 +0200)] 
mkfs-util: Set FORK_REOPEN_LOG

We set FORK_CLOSE_ALL_FDS, so we should also set FORK_REOPEN_LOG to
reopen the log in the child process so we don't miss any logging
messages.

8 months agocryptenroll: change man page example to remove leading 0x and lowercase hex 28916/head
Dan Streetman [Mon, 21 Aug 2023 23:25:49 +0000 (19:25 -0400)] 
cryptenroll: change man page example to remove leading 0x and lowercase hex

8 months agotpm2: wrap (7) in UINT32_C()
Dan Streetman [Mon, 21 Aug 2023 23:21:21 +0000 (19:21 -0400)] 
tpm2: wrap (7) in UINT32_C()

8 months agotpm2: add tpm2_pcr_values_has_(any|all)_values() functions
Dan Streetman [Mon, 21 Aug 2023 23:18:40 +0000 (19:18 -0400)] 
tpm2: add tpm2_pcr_values_has_(any|all)_values() functions

8 months agotpm2: remove unnecessary void* cast
Dan Streetman [Mon, 21 Aug 2023 23:07:38 +0000 (19:07 -0400)] 
tpm2: remove unnecessary void* cast

8 months agotpm2: make logging level consistent at debug for some functions
Dan Streetman [Mon, 21 Aug 2023 23:06:38 +0000 (19:06 -0400)] 
tpm2: make logging level consistent at debug for some functions

8 months agotpm2: use switch() instead of if-else
Dan Streetman [Mon, 21 Aug 2023 23:02:18 +0000 (19:02 -0400)] 
tpm2: use switch() instead of if-else

8 months agotpm2: use table for openssl<->tpm2 ecc curve id mappings
Dan Streetman [Mon, 21 Aug 2023 22:40:13 +0000 (18:40 -0400)] 
tpm2: use table for openssl<->tpm2 ecc curve id mappings

8 months agoopenssl: use new(char, size) instead of malloc(size)
Dan Streetman [Mon, 21 Aug 2023 22:14:07 +0000 (18:14 -0400)] 
openssl: use new(char, size) instead of malloc(size)

8 months agotpm2: use memcpy_safe() instead of memcpy()
Dan Streetman [Mon, 21 Aug 2023 22:10:56 +0000 (18:10 -0400)] 
tpm2: use memcpy_safe() instead of memcpy()

8 months agotpm2: remove ret_ prefix from input/output params
Dan Streetman [Mon, 21 Aug 2023 22:09:52 +0000 (18:09 -0400)] 
tpm2: remove ret_ prefix from input/output params

8 months agotpm2: split TPM2_PCR_VALUE_MAKE() over multiple lines
Dan Streetman [Mon, 21 Aug 2023 21:42:39 +0000 (17:42 -0400)] 
tpm2: split TPM2_PCR_VALUE_MAKE() over multiple lines

8 months agotpm2: use strempty()
Dan Streetman [Mon, 21 Aug 2023 21:39:20 +0000 (17:39 -0400)] 
tpm2: use strempty()

8 months agotpm2: check pcr value hash != 0 before looking up hash algorithm name
Dan Streetman [Mon, 21 Aug 2023 21:37:40 +0000 (17:37 -0400)] 
tpm2: check pcr value hash != 0 before looking up hash algorithm name

8 months agotpm2: simplify call to asprintf()
Dan Streetman [Mon, 21 Aug 2023 21:31:56 +0000 (17:31 -0400)] 
tpm2: simplify call to asprintf()

8 months agotpm2: put !isempty() check inside previous !isempty() check
Dan Streetman [Mon, 21 Aug 2023 21:29:28 +0000 (17:29 -0400)] 
tpm2: put !isempty() check inside previous !isempty() check

8 months agotpm2: use SIZE_MAX instead of strlen() for unhexmem()
Dan Streetman [Mon, 21 Aug 2023 20:29:44 +0000 (16:29 -0400)] 
tpm2: use SIZE_MAX instead of strlen() for unhexmem()

8 months agotpm2: in tpm2_pcr_values_valid() use FOREACH_ARRAY()
Dan Streetman [Mon, 21 Aug 2023 15:02:55 +0000 (11:02 -0400)] 
tpm2: in tpm2_pcr_values_valid() use FOREACH_ARRAY()

8 months agotpm2: in validator functions, return false instead of assert failure
Dan Streetman [Mon, 21 Aug 2023 14:48:20 +0000 (10:48 -0400)] 
tpm2: in validator functions, return false instead of assert failure

8 months agotpm2: move cast from lhs to rhs in uint16_t/int comparison
Dan Streetman [Mon, 21 Aug 2023 14:42:35 +0000 (10:42 -0400)] 
tpm2: move cast from lhs to rhs in uint16_t/int comparison

8 months agotpm2: lowercase TPM2_PCR_VALUE[S]_VALID functions
Dan Streetman [Mon, 21 Aug 2023 14:38:48 +0000 (10:38 -0400)] 
tpm2: lowercase TPM2_PCR_VALUE[S]_VALID functions

As these are not macros, they should be lowercase.

8 months agotpm2: change *alg_to_* functions to use switch()
Dan Streetman [Mon, 21 Aug 2023 14:34:57 +0000 (10:34 -0400)] 
tpm2: change *alg_to_* functions to use switch()

8 months agoMerge pull request #28917 from yuwata/network-address-pool
Zbigniew Jędrzejewski-Szmek [Thu, 24 Aug 2023 13:58:31 +0000 (15:58 +0200)] 
Merge pull request #28917 from yuwata/network-address-pool

undefined

8 months agonspawn: check validity of the internal interface name only explicitly specified
Yu Watanabe [Wed, 23 Aug 2023 03:13:44 +0000 (12:13 +0900)] 
nspawn: check validity of the internal interface name only explicitly specified

Follow-up for 2f091b1b49543aade4aad9ec3b35b3665abac3e7.

Fixes #28844.

8 months agoman/repart: use <filename> and add missing <para>
Zbigniew Jędrzejewski-Szmek [Thu, 24 Aug 2023 11:43:42 +0000 (13:43 +0200)] 
man/repart: use <filename> and add missing <para>

8 months agoMerge pull request #28918 from yuwata/network-dhcp-custom-duid
Zbigniew Jędrzejewski-Szmek [Thu, 24 Aug 2023 13:45:07 +0000 (15:45 +0200)] 
Merge pull request #28918 from yuwata/network-dhcp-custom-duid

network/dhcp: allow to specify custom duid type

8 months agogpt: move basic header/partition structure of GPT into common code
Lennart Poettering [Tue, 15 Aug 2023 07:52:38 +0000 (09:52 +0200)] 
gpt: move basic header/partition structure of GPT into common code

This way we can use it at other places too, not just when dissecting
images.

8 months agoalloc-util: add free_many() helper
Lennart Poettering [Wed, 23 Aug 2023 12:29:40 +0000 (14:29 +0200)] 
alloc-util: add free_many() helper

We often free an array of things. Let's create a common helper for this,
and port some potential users over. (Not all, too lazy for that for
now).

8 months agofundamental: rename tpm-pcr.h → tpm2-pcr.h 28948/head
Lennart Poettering [Thu, 24 Aug 2023 09:24:02 +0000 (11:24 +0200)] 
fundamental: rename tpm-pcr.h → tpm2-pcr.h

I always found it confusing that most of our TPM related definitions are
in tpm2-util.h, but the PCR names in tpm-pcr.h, without the "2". Let's
fix that and make this systematic, in particular as the definitions in
the file all start with TPM2_ already.

No code flow changes, just some renaming.

8 months agofundemental: split out UKI defines into its own header
Lennart Poettering [Thu, 24 Aug 2023 09:22:01 +0000 (11:22 +0200)] 
fundemental: split out UKI defines into its own header

The UKI sections have little to do with the PCRs, hence give them their
own header.

8 months agotpm2: unify symbolic name infra for PCRs
Lennart Poettering [Thu, 24 Aug 2023 09:16:14 +0000 (11:16 +0200)] 
tpm2: unify symbolic name infra for PCRs

We so far maintained two places for symboic names for PCRs. One in
tpm2-util.h and one in tpm-pcr.h.

Let's unify this into one, i.e. move the full list from tpm2-util.h into
tpm-pcr.h, replacing the short list placed so far there.

Systematically prefix the definitions with TPM2_ or tpm2_, to follow how
we do this for all other defines in this context.

No change in behaviour, just unification of tables.

8 months agoMerge pull request #28946 from poettering/json-variant-append-arrayb
Lennart Poettering [Thu, 24 Aug 2023 11:37:10 +0000 (13:37 +0200)] 
Merge pull request #28946 from poettering/json-variant-append-arrayb

add json_variant_append_arrayb() helper + more related

8 months agojson: add json_variant_set_fieldb() helper 28946/head
Lennart Poettering [Thu, 24 Aug 2023 07:55:48 +0000 (09:55 +0200)] 
json: add json_variant_set_fieldb() helper

Let's a "b" helper for json_variant_set_field() that combines
json_build() with json_variant_set_field(), similar to the
json_variant_merge_objectb(), json_variant_append_arrayb().

8 months agojson: rename json_append() → json_variant_merge_objectb()
Lennart Poettering [Thu, 24 Aug 2023 07:41:48 +0000 (09:41 +0200)] 
json: rename json_append() → json_variant_merge_objectb()

json_append() is a useful wrapper around json_variant_merge(). However,
I think the naming sould be cleaned up a bit of both functions.

I thinker "merge" is the better word than "append", since it does
decidedly more than just append: it replaces existing fields of the same
name, hence "merge" sounds more appropriate. This is as opposed to the
similar operations for arrays, where no such override logic is applied
and we really just append, hence those functions are called "append"
already.

To make clearer that "merge" is about objects, and "append" about
arrays, also include "object" in the name.

Also, include "json_variant" in the name, like we do for almost all
other functions in the JSON API that take a JSON object as primary
input, and hence are kinda object methods.

Finally, let's follow the logic that helpers that combine json_build()
with some other operation get suffixed with "b" like we already have in
some cases.

Hence:

json_variant_merge() → json_variant_merge_object()
       json_append() → json_variant_merge_objectb()

This mirrors nicely the existing:
                       json_variant_append_array()
                       json_vairant_append_arrayb()

This also drops the variant of json_append() that takes a va_arg
parameter (i.e. json_appendv()). We have no user of that so far, and
given the nature as a helper function only I don#t see that happening,
and if it happens after all it's trivial to bring back.

8 months agotree-wide: use json_variant_append_arrayb() at many places
Lennart Poettering [Thu, 24 Aug 2023 07:28:42 +0000 (09:28 +0200)] 
tree-wide: use json_variant_append_arrayb() at many places

8 months agojson: add json_variant_append_arrayb() helper
Lennart Poettering [Wed, 16 Aug 2023 07:35:07 +0000 (09:35 +0200)] 
json: add json_variant_append_arrayb() helper

8 months agoutf8: automatically determine length of string if SIZE_MAX is specified
Lennart Poettering [Mon, 14 Aug 2023 11:15:52 +0000 (13:15 +0200)] 
utf8: automatically determine length of string if SIZE_MAX is specified

Let's make utf8_to_utf16() and utf16_to_utf8() a bit nicer to use by
adding shortcuts for common cases.

This is particularly relevant for utf16_to_utf8() since the
multiplication with 2 is easy to forget.

8 months agonetwork/ndisc: use the first captive portal in each RA 28328/head
Yu Watanabe [Mon, 10 Jul 2023 04:37:46 +0000 (13:37 +0900)] 
network/ndisc: use the first captive portal in each RA

To handle malicious RA packets gracefully.

Also prompted by https://github.com/systemd/systemd/pull/28285#issuecomment-1627585140.

8 months agonetwork/ndisc: do not store too many captive portals provided through RA
Yu Watanabe [Mon, 10 Jul 2023 04:28:59 +0000 (13:28 +0900)] 
network/ndisc: do not store too many captive portals provided through RA

Prompted by https://github.com/systemd/systemd/pull/28285#issuecomment-1627585140.