Luca Boccassi [Tue, 3 Oct 2023 09:12:36 +0000 (10:12 +0100)]
docs: rephrase sentence about UKIs in UEFI_SECURITY.md
Luca Boccassi [Tue, 3 Oct 2023 09:08:33 +0000 (10:08 +0100)]
docs: rephrase sentence about addons measuring in UEFI_SECURITY.md
Yu Watanabe [Tue, 3 Oct 2023 04:19:50 +0000 (13:19 +0900)]
man: update the list of ignored options by Anonymize=yes
Closes #29362.
Luca Boccassi [Mon, 2 Oct 2023 21:59:07 +0000 (22:59 +0100)]
Merge pull request #29390 from yuwata/sd-netlink-make-default-timeout-configurable
sd-netlink: make the default timeout configurable
NRK [Mon, 2 Oct 2023 19:26:48 +0000 (01:26 +0600)]
udevadm: avoid side-effect in assert()
this was found when trying to use __builtin_assume() with clang:
https://github.com/systemd/systemd/pull/29409#issuecomment-
1743575402
Dan Streetman [Mon, 2 Oct 2023 20:25:10 +0000 (16:25 -0400)]
tpm2: edit tpm2_get_or_create_srk() comment
Adjust the comment to correct the return value, i.e. 1 for SRK created, 0 for
SRK already exists, <0 on error.
Luca Boccassi [Mon, 2 Oct 2023 17:51:39 +0000 (18:51 +0100)]
docs: rename src/boot/efi/SECURITY.md as UEFI_SECURITY.md
Luca Boccassi [Mon, 2 Oct 2023 16:44:50 +0000 (17:44 +0100)]
doc: add compiler hardening details to UEFI SECURITY.md
dependabot[bot] [Sun, 1 Oct 2023 18:16:06 +0000 (18:16 +0000)]
build(deps): bump systemd/mkosi
Bumps [systemd/mkosi](https://github.com/systemd/mkosi) from
adaa41512aa30c952daae5ba0abcf2622d66b93b to
a8ecff0defa132d729dcdab38380dcae31138e7e.
- [Release notes](https://github.com/systemd/mkosi/releases)
- [Changelog](https://github.com/systemd/mkosi/blob/main/NEWS.md)
- [Commits](https://github.com/systemd/mkosi/compare/
adaa41512aa30c952daae5ba0abcf2622d66b93b...
a8ecff0defa132d729dcdab38380dcae31138e7e)
---
updated-dependencies:
- dependency-name: systemd/mkosi
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Luca Boccassi [Mon, 2 Oct 2023 15:30:39 +0000 (16:30 +0100)]
Merge pull request #29407 from CM4all/test-kernel-acl-dummy
src/test: fixups for kernels without ACL and net-dummy
Luca Boccassi [Mon, 2 Oct 2023 15:04:26 +0000 (16:04 +0100)]
Merge pull request #29339 from bluca/mount_namespace_new_api
Use new mount API for bind/image mount tunnel
Benjamin Peterson [Mon, 25 Sep 2023 14:23:27 +0000 (07:23 -0700)]
resolve: tolerate merging a zero-ttl RR and a nonzero-ttl RR if not mDNS
resolved rejected RRsets containing a RR with a zero TTL and a RR with a nonzero TTL. In practice—see the linked issues—, this case triggered when an AF_UNSPEC query to a CNAMEd domain returned a zero TTL for the CNAME on one address family and a nonzero TTL for the CNAME on the other address family.
The zero-nonzero TTL check cites RFC 2181 § 5.2 in a comment. That section says DNS clients should reject any RRset containing differing TTLs, which the check only implements a very special case of. That the old behavior caused real-world false NXDOMAIN results is reason enough to completely ignore the RFC's recommendation. However, mDNS treats zero TTLs specially, so the error case needs to be kept for mDNS.
Fixes https://github.com/systemd/systemd/issues/22177
Fixes https://github.com/systemd/systemd/issues/20617
Fixes https://github.com/systemd/systemd/issues/19118
Lennart Poettering [Mon, 2 Oct 2023 14:45:40 +0000 (16:45 +0200)]
Merge pull request #29405 from poettering/boot-xmalloc0
boot: add xmalloc0() + memzero() helpers
Max Kellermann [Mon, 2 Oct 2023 12:24:56 +0000 (14:24 +0200)]
test/test-execute: skip PrivateNetwork tests if kernel has no dummy netdevice support
Max Kellermann [Mon, 2 Oct 2023 12:05:25 +0000 (14:05 +0200)]
test/test-chown-rec: skip ACL tests if kernel has no ACL support
The second half of `chown_recursive` works only if the kernel has ACL support.
Luca Boccassi [Wed, 27 Sep 2023 00:37:25 +0000 (01:37 +0100)]
mount-util: use new mount API for image mount tunnel
Luca Boccassi [Sun, 1 Oct 2023 17:55:12 +0000 (18:55 +0100)]
docs: add document about UEFI security posture in src/boot/efi/
This is not intended as a user guide, but to describe the generic security
posture of the UEFI components. Hence we do not publish it on systemd.io
but only in the repository.
Luca Boccassi [Mon, 2 Oct 2023 13:23:51 +0000 (14:23 +0100)]
Merge pull request #29400 from yuwata/network-limit-read-size
network: limit read size
Yu Watanabe [Mon, 2 Oct 2023 01:42:58 +0000 (10:42 +0900)]
fuzz: limit size for fuzz-manager-serialize
Fixes #29357 and oss-fuzz#62756
(https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=62756).
Luca Boccassi [Wed, 27 Sep 2023 00:04:44 +0000 (01:04 +0100)]
dissect-image: support verity_dissect_and_mount() in two steps too
With the new mount API first the image is opened, and later mounted
Lennart Poettering [Tue, 14 Mar 2023 10:09:46 +0000 (11:09 +0100)]
dissect-image: optionally allow mounting via new kernel mount API in two steps
This adds support for the new fsmount() logic of the kernel: we'll first
create an unattached fsmount fd, and then in a second step attach this
to some real file system inode – as opposed to attaching file system
directly. The benefit of this is that we can pass the open fsmount fds
over some sockets if need be, to isolate the mounting code from the
attaching code.
Lennart Poettering [Tue, 14 Mar 2023 10:09:57 +0000 (11:09 +0100)]
mount-util: add make_fsmount()
Luca Boccassi [Tue, 26 Sep 2023 23:01:45 +0000 (00:01 +0100)]
mount-util: use new mount API for bind mount tunnel
If we have the new mount API we can simplify bind mounting into a namespace
a lot
Luca Boccassi [Thu, 28 Sep 2023 12:19:45 +0000 (13:19 +0100)]
mountpoint-util: add bool mount_new_api_supported() helper
Luca Boccassi [Wed, 27 Sep 2023 00:37:59 +0000 (01:37 +0100)]
test: fix check in test unit in TEST-50-DISSECT
'[[ not found'
Lennart Poettering [Mon, 2 Oct 2023 11:12:11 +0000 (13:12 +0200)]
util: add xmalloc0() helper
Lennart Poettering [Mon, 2 Oct 2023 11:06:27 +0000 (13:06 +0200)]
memory-util: move memzero() to src/fundamental/ to share with UEFI
(and while we are at it, make sure it returns the input pointer as
output)
Daan De Meyer [Mon, 2 Oct 2023 12:29:32 +0000 (14:29 +0200)]
Merge pull request #29343 from DaanDeMeyer/tmp
Use a subdirectory of /run/systemd for PrivateDevices=
Daan De Meyer [Wed, 27 Sep 2023 08:52:50 +0000 (10:52 +0200)]
core: Use a subdirectory of /run/ for PrivateDevices=
When we're starting early boot services such as systemd-userdbd.service,
/tmp might not yet be mounted, so let's use a directory in /run instead
which is guaranteed to be available.
Luca Boccassi [Mon, 2 Oct 2023 09:56:15 +0000 (10:56 +0100)]
Merge pull request #29335 from abderrahim/version-info-check
man: add checks for missing version information
Daan De Meyer [Sun, 1 Oct 2023 18:40:45 +0000 (20:40 +0200)]
mount: Log when we can't create the mount point
Debugging mount unit failures caused by systemd not being able to
create the mount point is currently rather hard. Let's log about
failures to create mount points to simplify debugging.
Yu Watanabe [Wed, 27 Sep 2023 21:04:53 +0000 (06:04 +0900)]
journalctl: find boot ID more gracefully in corrupted journal
In discover_next_boot(), first we find a new boot ID based on the value
stored in the entry object. Then, find the tail (or head when we are going
upwards) entry of the boot based on the _BOOT_ID= field data.
If boot IDs of an entry in the entry object and _BOOT_ID field data
are inconsistent, which may happen on corrupted journal, then previously
discover_next_boot() failed with -ENODATA.
This makes the function check if the two boot IDs in each entry are
consistent, and skip the entry if not.
Fixes the failure of `journalctl -b -1` for 'truncated' journal:
https://github.com/systemd/systemd/pull/29334#issuecomment-
1736567951
Yu Watanabe [Mon, 2 Oct 2023 01:28:55 +0000 (10:28 +0900)]
network: set maximum length to be read by read_full_file_full()
Fixes #29264 and oss-fuzz#62556
(https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=62556).
Yu Watanabe [Sun, 1 Oct 2023 07:48:36 +0000 (16:48 +0900)]
fileio: make read_full_file_full() usable with size and READ_FULL_FILE_UNBASE64
When READ_FULL_FILE_UNBASE64 (or READ_FULL_FILE_UNHEX) is specified,
setting size argument by caller is difficult, as it is hard to estimate
the encoded length.
This makes when size is specified with decoding option, let's read file
more, and check decoded size later with the specified size.
dependabot[bot] [Sun, 1 Oct 2023 10:00:38 +0000 (10:00 +0000)]
build(deps): bump meson from 1.2.1 to 1.2.2 in /.github/workflows
Bumps [meson](https://github.com/mesonbuild/meson) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/1.2.1...1.2.2)
---
updated-dependencies:
- dependency-name: meson
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
dependabot[bot] [Sun, 1 Oct 2023 09:14:31 +0000 (09:14 +0000)]
build(deps): bump actions/checkout from 3.6.0 to 4.1.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.6.0 to 4.1.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/
f43a0e5ff2bd294095638e18286ca9a3d1956744...
8ade135a41bc03ea155e62e844d188df1ea18608)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
dependabot[bot] [Sun, 1 Oct 2023 09:14:38 +0000 (09:14 +0000)]
build(deps): bump github/codeql-action from 2.21.5 to 2.21.9
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.21.5 to 2.21.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/
00e563ead9f72a8461b24876bee2d0c2e8bd2ee8...
ddccb873888234080b77e9bc2d4764d5ccaaccf9)
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Abderrahim Kitouni [Sun, 1 Oct 2023 10:49:44 +0000 (11:49 +0100)]
man: add version info for newly added systemd-tpm2-setup.service
Abderrahim Kitouni [Sun, 1 Oct 2023 09:34:51 +0000 (10:34 +0100)]
man: re-add some version info for sd_pid_get_owner_uid.xml
These were mistakenly removed in
00f95506e2523a9c120d9c38cc78d15bb56b8ec7
Abderrahim Kitouni [Sun, 1 Oct 2023 09:27:59 +0000 (10:27 +0100)]
man: add a couple missing version annotations
These were discovered by the newly added checks
Abderrahim Kitouni [Tue, 26 Sep 2023 17:25:06 +0000 (18:25 +0100)]
man: add checks for missing version information
This adds a new script tools/check-version-history.py and a corresponding
test when building in developer mode. It checks manpages (except dbus
documentation which is handled by update-dbus-docs) for missing version
history information.
It also adds ignore lists based on version 183 (the version that our version
annotations go back to). These can be augmented if we want to ignore other
elements if it doesn't make sense for them to have version annotations.
Jan Janssen [Sun, 1 Oct 2023 07:55:48 +0000 (09:55 +0200)]
meson: Pass all -static-pie args to linker
Fixes: #29381
Luca Boccassi [Sun, 1 Oct 2023 10:28:32 +0000 (11:28 +0100)]
Merge pull request #29384 from yuwata/sd-journal-cleanups-for-generic-array-get
sd-journal: cleanups for generic_array_get()
Yu Watanabe [Sat, 30 Sep 2023 11:09:53 +0000 (20:09 +0900)]
meson: drop unused home_includes
Yu Watanabe [Sun, 1 Oct 2023 03:04:59 +0000 (12:04 +0900)]
sd-netlink: make the default timeout configurable by environment variable
On normal systems, triggering a timeout should be a bug in code or
configuration error, so I do not think we should extend the default
timeout. Also, we should not introduce a 'first class' configuration
option about that. But, making it configurable may be useful for cases
such that "an extremely highly utilized system (lots of OOM kills,
very high CPU utilization, etc)".
Closes #25441.
Yu Watanabe [Sun, 1 Oct 2023 03:04:52 +0000 (12:04 +0900)]
sd-netlink: make calc_elapse() return USEC_INFINITY when no timeout is requested
Then, timout_compare() becomes simplar, the timeout value becomes
consistent with what sd_netlink_get_timeout() provides.
This also drop unnecessary assignment of reply_callback.timeout after
the slot is dropped from the prioq.
Yu Watanabe [Wed, 27 Sep 2023 05:52:21 +0000 (14:52 +0900)]
sd-journal: merge journal_file_next_entry_for_data() with generic_array_get_plus_one()
Because journal_file_next_entry_for_data() provides the first entry, while
journal_file_next_entry() actually provides the next entry of the input,
this also renames it to journal_file_move_to_entry_for_data().
Also, previously, on DIRECTION_UP the function did not fall back to the
'extra' entry when all entries linked in the chained array are broken.
This also fixes the issue, and now it fall back to the extra entry.
Yu Watanabe [Wed, 27 Sep 2023 17:12:00 +0000 (02:12 +0900)]
sd-journal: add/update comments
Yu Watanabe [Tue, 26 Sep 2023 16:35:31 +0000 (01:35 +0900)]
sd-journal: add missing 'error' handling
When we reach an empty array, there are at least two possibilities:
- journal file is corrupted,
- invalid index is requested.
We cannot distinguish them here, let's simply return earlier.
Yu Watanabe [Mon, 25 Sep 2023 02:10:01 +0000 (11:10 +0900)]
sd-journal: fix calculation of number of 'total' entries in the chained arrays
If there's corruption and we are going upwards, then the 'total'
must be decreased when we go to the previous array. However,
previously, we wrongly kept or increased the number. This fixes
the behavior.
Yu Watanabe [Tue, 26 Sep 2023 16:29:11 +0000 (01:29 +0900)]
sd-journal: merge two bump_entry_array() calls
No functional changes, just refactoring.
Yu Watanabe [Tue, 26 Sep 2023 16:14:58 +0000 (01:14 +0900)]
sd-journal: make bump_entry_array() return positive when a valid offset found
When it returns 0 offset, then the subsequent
journal_file_move_to_object() will fail. Let's return
generic_array_get() earlier in such situation.
Yu Watanabe [Mon, 25 Sep 2023 01:44:50 +0000 (10:44 +0900)]
sd-journal: drop redundant re-read of entry array object
This effectively reverts
d9b61db922404a216de018cc5ddff9b69bcaf1db.
In the do-while loop, we do not read any other entry array object, hence
the current object is always in the mmap cache and not necessary to re-read it.
Lennart Poettering [Fri, 29 Sep 2023 20:17:12 +0000 (22:17 +0200)]
logind: add HANDLE_ACTION_IS_SLEEP() and HANDLE_ACTION_IS_SHUTDOWN() helpers
Let's group this HandleAction types in nice little helpers.
Prompted by #28579
Luca Boccassi [Sat, 30 Sep 2023 08:51:58 +0000 (09:51 +0100)]
Merge pull request #29380 from medhefgo/ms-certs
man: man: Adjust Microsoft UEFI certificate links
Frantisek Sumsal [Sat, 30 Sep 2023 07:35:35 +0000 (07:35 +0000)]
Merge pull request #29378 from mrc0mmand/more-test-tweaks
test: a couple of TEST-82-SOFTREBOOT tweaks
Jan Janssen [Sat, 30 Sep 2023 07:30:24 +0000 (09:30 +0200)]
man: Verify Microsoft keys
Jan Janssen [Sat, 30 Sep 2023 07:19:57 +0000 (09:19 +0200)]
man: Adjust Microsoft UEFI certificate links
The files were fixed to all be properly der encoded.
Luca Boccassi [Fri, 29 Sep 2023 22:01:53 +0000 (23:01 +0100)]
Merge pull request #29363 from medhefgo/elf2efi
elf2efi: Rework to allow using any linker
Frantisek Sumsal [Fri, 29 Sep 2023 21:26:15 +0000 (23:26 +0200)]
test: don't pipe the whole journal through jq
Doing that in VMs without acceleration is prohibitively expensive (i.e.
20+ seconds in the C8S job). Thankfully, the recent [0] --lines=+n syntax
makes this all quite easy to fix.
[0]
8d6791d2aa9
Frantisek Sumsal [Fri, 29 Sep 2023 20:10:42 +0000 (22:10 +0200)]
test: use Type=exec for the auxiliary services
To make sure the respective binaries are exec()ed before moving further
with the test.
Frantisek Sumsal [Fri, 29 Sep 2023 20:07:12 +0000 (22:07 +0200)]
test: shutdown the machine on fail after soft-reboot
Since the soft-reboot drops the enqueued end.service, we won't shutdown
the test VM if the test fails and have to wait for the watchdog to kill
us (which may take quite a long time). Let's just forcibly kill the
machine instead to save CI resources.
Lennart Poettering [Fri, 29 Sep 2023 19:56:28 +0000 (21:56 +0200)]
Merge pull request #29344 from poettering/tpm2-setup
tpm2-setup: set up TPM2 Storage Root Key (SRK) in a separate service
Lennart Poettering [Fri, 29 Sep 2023 16:28:42 +0000 (18:28 +0200)]
sysext: validate against the right API level
Let's ake sure we check confexts against the confext api level, and
sysext against the sysext api level.
Previously the test would simply be skipped for confexts...
Lennart Poettering [Fri, 29 Sep 2023 16:55:31 +0000 (18:55 +0200)]
pe-binary: actually check if PE binary is UEFI binary when determining if UKI
If it's not a UEFI binary, then it's not a UKI.
Luca Boccassi [Fri, 29 Sep 2023 18:07:59 +0000 (19:07 +0100)]
Merge pull request #29374 from mrc0mmand/test-tweaks
test: use "test-" prefix for units
Lennart Poettering [Wed, 27 Sep 2023 07:33:48 +0000 (09:33 +0200)]
update TODO
Lennart Poettering [Tue, 26 Sep 2023 19:25:53 +0000 (21:25 +0200)]
tpm2-setup: add new early boot tool for initializing the SRK
This adds an explicit service for initializing the TPM2 SRK. This is
implicitly also done by systemd-cryptsetup, hence strictly speaking
redundant, but doing this early has the benefit that we can parallelize
this in a nicer way. This also write a copy of the SRK public key in PEM
format to /run/ + /var/lib/, thus pinning the disk image to the TPM.
Making the SRK public key is also useful for allowing easy offline
encryption for a specific TPM.
Sooner or later we should probably grow what this service does, the
above is just the first step. For example, the service should probably
offer the ability to reset the TPM (clear the owner hierarchy?) on a
factory reset, if such a policy is needed. And we might want to install
some default AK (?).
Fixes: #27986
Also see: #22637
Lennart Poettering [Fri, 29 Sep 2023 17:15:15 +0000 (19:15 +0200)]
Merge pull request #29234 from ddstreet/tpm2_marshal_serialize_handle_index
add tpm2 functions for marshalling blobs, serializing handles, and handle/index conversion
Jan Janssen [Thu, 28 Sep 2023 15:54:35 +0000 (17:54 +0200)]
elf2efi: Add GNU_RELRO support
Jan Janssen [Mon, 25 Sep 2023 15:24:26 +0000 (17:24 +0200)]
ci: Update compiler build matrix
Given that gold is pretty much unmaintained and does not support
`-static-pie` for bootloader components it should be safe to drop.
Also switch to clang-17 while we're at it.
Jan Janssen [Fri, 22 Sep 2023 12:41:47 +0000 (14:41 +0200)]
boot: Lift linker requirements
The biggest reason for forcing bfd was the use of linker scrips. Since
we don't rely on those anymore we can lift the requirement.
The biggest issue is gold as it does not understand -static-pie. Given
that it's pretty much on life support it's safe to just declare it not
supported anymore.
Don't link addons with libefi as clang/lld is sometimes very eager to
include memset etc., causing needless binary bloat and link errors with
LTO.
Fixes: #29165
Jan Janssen [Fri, 22 Sep 2023 10:15:55 +0000 (12:15 +0200)]
elf2efi: Add --copy-sections option
This makes the special PE sections available again in our output EFI
images.
Since the compiler provides no way to mark a section as not allocated,
we use GNU assembler syntax to emit the sections instead. This ensures
the section data isn't emitted twice as load segments will only contain
allocating input sections.
Jan Janssen [Fri, 22 Sep 2023 10:13:09 +0000 (12:13 +0200)]
elf2efi: Add next_section_address helper
Jan Janssen [Thu, 28 Sep 2023 14:22:13 +0000 (16:22 +0200)]
elf2efi: Check ELF image base if possible
Jan Janssen [Thu, 28 Sep 2023 14:09:42 +0000 (16:09 +0200)]
elf2efi: Rework ELF section conversion
The main reason we need to apply a whole lot of logic to the section
conversion logic is because PE sections have to be aligned to the page
size (although, currently not even EDK2 enforces this). The process of
achieving this with a linker script is fraught with errors, they are a
pain to set up correctly and suck in general. They are also not
supported by mold, which requires us to forcibly use bfd, which also
means that linker feature detection is easily at odds as meson has a
differnt idea of what linker is in use.
Instead of forcing a manual ELF segment layout with a linker script we
just let the linker do its thing. We then simply copy/concatenate the
sections while observing proper page boundaries.
Note that we could just copy the ELF load *segments* directly and
achieve the same result. Doing this manually allows us to strip sections
we don't need at runtime like the dynamic linking information (the
elf2efi conversion is effectively the dynamic loader).
Important sections like .sbat that we emit directly from code will
currently *not* be exposed as individual PE sections as they are
contained within the ELF segments. A future commit will fix this.
Dan Streetman [Fri, 30 Jun 2023 16:52:10 +0000 (12:52 -0400)]
tpm2: add tpm2_index_to_handle() and tpm2_index_from_handle()
Adjust the tpm2_esys_handle_from_tpm_handle() function into better-named
tpm2_index_to_handle(), which operates like tpm2_get_srk() but allows using any
handle index. Also add matching tpm2_index_from_handle().
Also change the references to 'location' in tpm2_persist_handle() to more
appropriate 'handle index'.
Dan Streetman [Fri, 30 Jun 2023 17:42:25 +0000 (13:42 -0400)]
tpm2: add tpm2_serialize() and tpm2_deserialize()
Add functions to perform serialization and deserialization of ESYS_TR objects.
Dan Streetman [Wed, 28 Jun 2023 15:46:31 +0000 (11:46 -0400)]
tpm2: add tpm2_marshal_blob() and tpm2_unmarshal_blob()
Add functions to marshal and unmarshal our 'blob' object.
Frantisek Sumsal [Fri, 29 Sep 2023 14:07:05 +0000 (16:07 +0200)]
test: use /run/ for test configuration
Frantisek Sumsal [Fri, 29 Sep 2023 13:55:53 +0000 (15:55 +0200)]
test: use "test-" prefix for units
So the coverage-related drop-in [0] can kick in to avoid errors with
DynamicUser=true. Also, to not make the test confusing with this change,
replace "nft-test" with "test-nft" everywhere.
[0] See test/README.testsuite, section "Code coverage"
Lennart Poettering [Fri, 29 Sep 2023 09:59:40 +0000 (11:59 +0200)]
tpm2: move measurement log to /run/log/ (from /var/log/)
I have no idea what went on in my mind when I used a path in /var/ for
the tpm2 event log we now keep for userspace measurements. The
measurements are only valid for the current boot, hence should not be
persisted (in particular as they cannot be rotated, hence should not
grow without bounds).
Fix that, simply move from /var/log/ to /run/log/.
Daan De Meyer [Fri, 29 Sep 2023 09:33:12 +0000 (11:33 +0200)]
Merge pull request #29193 from keszybz/path-util-adjustment
Make unit mangling follow paths
Daan De Meyer [Fri, 29 Sep 2023 09:32:19 +0000 (11:32 +0200)]
Merge pull request #29241 from poettering/pidref-watch
pid1: move unit_watch_pid()/unit_unwatch_pid() logic over to PidRef
Valentin Lefebvre [Wed, 27 Sep 2023 14:41:58 +0000 (16:41 +0200)]
ukify: explicitly import attribute
* Explicitly import attributes rsa and serialization from cryptography.hazmat
Signed-off-by: Valentin Lefebvre <valentin.lefebvre@suse.com>
Daan De Meyer [Wed, 27 Sep 2023 09:55:59 +0000 (11:55 +0200)]
core: Make private /dev read-only after populating it
Daan De Meyer [Fri, 29 Sep 2023 08:25:39 +0000 (10:25 +0200)]
Merge pull request #29183 from ddstreet/tpm2_openssl_functions
Add openssl functions for use by TPM2 sealing calculations
Luca Boccassi [Fri, 29 Sep 2023 01:00:34 +0000 (02:00 +0100)]
automount: fix unused value coverity warnings
'r' is no longer used, so no point in setting it before returning
CID#
1522310
CID#
1522312
Follow-up for
bfeb10911e58bf8890eb7687cf12eddb09ab0c5d
Maanya Goenka [Wed, 27 Sep 2023 15:44:04 +0000 (15:44 +0000)]
fix: do not check/verify slice units if recursive errors are to be ignored
Before this fix, when recursive-errors was set to 'no' during a systemd-analyze
verification, the parent slice was checked regardless. The 'no' setting means that,
only the specified unit should be looked at and verified and errors in the slices should be
ignored. This commit fixes that issue.
Example:
Say we have a sample.service file:
[Unit]
Description=Sample Service
[Service]
ExecStart=/bin/echo "a"
Slice=support.slice
Before Change:
systemd-analyze verify --recursive-errors=no maanya/sample.service
Assertion 'u' failed at src/core/unit.c:153, function unit_has_name(). Aborting.
Aborted (core dumped)
After Change:
systemd-analyze verify --recursive-errors=no maanya/sample.service
{No errors}
Lennart Poettering [Tue, 19 Sep 2023 14:22:05 +0000 (16:22 +0200)]
update TODO
Lennart Poettering [Tue, 19 Sep 2023 19:58:55 +0000 (21:58 +0200)]
core: move pid watch/unwatch logic of the service manager to pidfd
This makes sure unit_watch_pid() and unit_unwatch_pid() will track
processes by pidfd if supported. Also ports over some related code.
Should not really change behaviour.
Note that this does *not* add support waiting for POLLIN on the pidfds
as additional exit notification. This is left for a later commit (this
commit is already large enough), in particular as that would add new
logic and not just convert existing logic.
Lennart Poettering [Wed, 20 Sep 2023 09:34:57 +0000 (11:34 +0200)]
test-watch-pid: use a real PID, not a made up one
This matters once we track processes with pidfds rather than just pid_t,
because made up PIDs likely won't exist.
The essence of the test remains unmodified, we just use a real, existing
PID instead of 4711.
Lennart Poettering [Tue, 19 Sep 2023 14:22:29 +0000 (16:22 +0200)]
pidref: add pidref_verify() helper
This new helper can be used after reading process info from procfs, to
verify that the data that was just read actually matches the pidfd, and
does not belong to some new process that just reused the numeric PID of
the process we originally pinned.
Lennart Poettering [Tue, 19 Sep 2023 14:11:34 +0000 (16:11 +0200)]
pidref: add pidref_hash_ops
This adds a "hash_ops" structure, which allows using PidRef structures
as keys in Hashmap and Set objects.
Lennart Poettering [Tue, 19 Sep 2023 14:15:00 +0000 (16:15 +0200)]
pidref: add helpers for managing PidRef on the heap
Usually we want to embed PidRef in other structures, but sometimes it
makes sense to allocate it on the heap in case it should be used
standalone. Add helpers for that.
Primary usecase: use as key in Hashmap objects, that for example map
process to unit objects in PID 1.
This adds pidref_free()/pidref_freep() for freeing such an allocated
struct, as well as pidref_dup() (for duplicating an existing PidRef
on the heap 1:1), and pidref_new_pid() (for allocating a new PidRef from a
PID).
Lennart Poettering [Tue, 19 Sep 2023 14:05:42 +0000 (16:05 +0200)]
pidref: add PIDREF_MAKE_FROM_PID()
This helper truns a pid_t into a PidRef. It's different from
pidref_set_pid() in being "passive", i.e. it does not attempt to acquire
a pidfd for the pid.
This is useful when using the PidRef as a lookup key that shall also
work after a process is already dead, and hence no conversion to a pidfd
is possible anymore.
Lennart Poettering [Tue, 19 Sep 2023 14:05:01 +0000 (16:05 +0200)]
cgroup-util: add cg_read_pidref() helper
Just like cg_read_pid() but returns a PidRef
Luca Boccassi [Thu, 28 Sep 2023 21:18:15 +0000 (22:18 +0100)]
Merge pull request #29249 from poettering/pid1-error-message
pid1: refactoring of unit state machine logging and unit timer refactoring
Bertrand Jacquin [Wed, 27 Sep 2023 18:39:52 +0000 (19:39 +0100)]
resolved: register ipv4only.arpa are private domain
From RFC 8880:
Because the 'ipv4only.arpa' zone has to be an insecure delegation,
DNSSEC cannot be used to protect these answers from tampering by
malicious devices on the path.
Consequently, the 'ipv4only.arpa' zone MUST be an insecure delegation to
give DNS64/NAT64 gateways the freedom to synthesize answers to those
queries at will, without the answers being rejected by DNSSEC-capable
resolvers. DNSSEC-capable resolvers that follow this specification MUST
NOT attempt to validate answers received in response to queries for the
IPv6 AAAA address records for 'ipv4only.arpa'. Note that the name
'ipv4only.arpa' has no use outside of being used for this special DNS
pseudo-query used to learn the DNS64/NAT64 address synthesis prefix, so
the lack of DNSSEC security for that name is not a problem.
See: https://datatracker.ietf.org/doc/html/rfc8880#name-security-considerations
Dan Streetman [Fri, 7 Jul 2023 14:13:27 +0000 (10:13 -0400)]
openssl: add kdf_ss_derive()
Add function to perform KDF-SS ("concat" KDF).
While Openssl allows a digest, HMAC, or KMAC for the auxiliary function H, this
currently only allows using a digest for H.