1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-09 13:57:42 +03:00

67610 Commits

Author SHA1 Message Date
Benjamin Peterson
8ec951e8d5 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
2023-10-02 16:47:36 +02:00
Lennart Poettering
015d19e3ac
Merge pull request #29405 from poettering/boot-xmalloc0
boot: add xmalloc0() + memzero() helpers
2023-10-02 16:45:40 +02:00
Luca Boccassi
858a0dfce6 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.
2023-10-02 14:29:10 +01:00
Luca Boccassi
e428f1dd8a
Merge pull request #29400 from yuwata/network-limit-read-size
network: limit read size
2023-10-02 14:23:51 +01:00
Yu Watanabe
7233c679d4 fuzz: limit size for fuzz-manager-serialize
Fixes #29357 and oss-fuzz#62756
(https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=62756).
2023-10-02 14:23:34 +01:00
Lennart Poettering
5a71b83002 util: add xmalloc0() helper 2023-10-02 15:02:26 +02:00
Lennart Poettering
4ac79c2b77 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)
2023-10-02 15:00:13 +02:00
Daan De Meyer
1e5e902f60
Merge pull request #29343 from DaanDeMeyer/tmp
Use a subdirectory of /run/systemd for PrivateDevices=
2023-10-02 14:29:32 +02:00
Daan De Meyer
cd7f3702eb 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.
2023-10-02 12:23:13 +02:00
Luca Boccassi
34d4181fbb
Merge pull request #29335 from abderrahim/version-info-check
man: add checks for missing version information
2023-10-02 10:56:15 +01:00
Daan De Meyer
ce427d0e73 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.
2023-10-02 11:24:03 +09:00
Yu Watanabe
185e201690 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
2023-10-02 10:59:33 +09:00
Yu Watanabe
4ed95fafad 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).
2023-10-02 10:36:43 +09:00
Yu Watanabe
7e2a5fbd85 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.
2023-10-02 10:36:43 +09:00
dependabot[bot]
b503c76689 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>
2023-10-01 18:16:06 +00:00
dependabot[bot]
8ee09da6e8 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](f43a0e5ff2...8ade135a41)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-01 18:15:04 +00:00
dependabot[bot]
a14438a85c 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](00e563ead9...ddccb87388)

---
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>
2023-10-01 18:14:32 +00:00
Abderrahim Kitouni
b8f7a53751 man: add version info for newly added systemd-tpm2-setup.service 2023-10-01 11:54:29 +01:00
Abderrahim Kitouni
8074a03656 man: re-add some version info for sd_pid_get_owner_uid.xml
These were mistakenly removed in 00f95506e2523a9c120d9c38cc78d15bb56b8ec7
2023-10-01 11:54:29 +01:00
Abderrahim Kitouni
2de0bb2fad man: add a couple missing version annotations
These were discovered by the newly added checks
2023-10-01 11:54:29 +01:00
Abderrahim Kitouni
3691e7fce7 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.
2023-10-01 11:54:29 +01:00
Jan Janssen
a8b53f4f15 meson: Pass all -static-pie args to linker
Fixes: #29381
2023-10-01 11:49:51 +01:00
Luca Boccassi
cf8c641733
Merge pull request #29384 from yuwata/sd-journal-cleanups-for-generic-array-get
sd-journal: cleanups for generic_array_get()
2023-10-01 11:28:32 +01:00
Yu Watanabe
b05a88c1ae meson: drop unused home_includes 2023-10-01 10:28:55 +02:00
Yu Watanabe
d37eeabc4f 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.
2023-09-30 20:10:15 +09:00
Yu Watanabe
3a23e41883 sd-journal: add/update comments 2023-09-30 20:10:15 +09:00
Yu Watanabe
f85e79d3e5 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.
2023-09-30 20:10:15 +09:00
Yu Watanabe
fe6f2bd8a6 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.
2023-09-30 20:10:15 +09:00
Yu Watanabe
b63f09e4ee sd-journal: merge two bump_entry_array() calls
No functional changes, just refactoring.
2023-09-30 20:10:15 +09:00
Yu Watanabe
b7264911aa 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.
2023-09-30 20:10:15 +09:00
Yu Watanabe
eb6ba87344 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.
2023-09-30 20:10:15 +09:00
Lennart Poettering
cb88da8254 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
2023-09-30 10:56:28 +01:00
Luca Boccassi
4f45ae4d1d
Merge pull request #29380 from medhefgo/ms-certs
man: man: Adjust Microsoft UEFI certificate links
2023-09-30 09:51:58 +01:00
Frantisek Sumsal
e11fd4df14
Merge pull request #29378 from mrc0mmand/more-test-tweaks
test: a couple of TEST-82-SOFTREBOOT tweaks
2023-09-30 07:35:35 +00:00
Jan Janssen
658394e826 man: Verify Microsoft keys 2023-09-30 09:30:46 +02:00
Jan Janssen
5f5160d3b2 man: Adjust Microsoft UEFI certificate links
The files were fixed to all be properly der encoded.
2023-09-30 09:30:46 +02:00
Luca Boccassi
69f99d1e4e
Merge pull request #29363 from medhefgo/elf2efi
elf2efi: Rework to allow using any linker
2023-09-29 23:01:53 +01:00
Frantisek Sumsal
bd0f9858f7 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
2023-09-29 23:26:15 +02:00
Frantisek Sumsal
82abce7a89 test: use Type=exec for the auxiliary services
To make sure the respective binaries are exec()ed before moving further
with the test.
2023-09-29 22:10:42 +02:00
Frantisek Sumsal
47f6baccfe 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.
2023-09-29 22:07:12 +02:00
Lennart Poettering
68849251a2
Merge pull request #29344 from poettering/tpm2-setup
tpm2-setup: set up TPM2 Storage Root Key (SRK) in a separate service
2023-09-29 21:56:28 +02:00
Lennart Poettering
81df5cd185 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...
2023-09-29 21:54:46 +02:00
Lennart Poettering
ef2dbc9c40 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.
2023-09-29 21:54:16 +02:00
Luca Boccassi
16f094cfbb
Merge pull request #29374 from mrc0mmand/test-tweaks
test: use "test-" prefix for units
2023-09-29 19:07:59 +01:00
Lennart Poettering
1a9454a942 update TODO 2023-09-29 19:36:06 +02:00
Lennart Poettering
2e64cb71b9 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
2023-09-29 19:36:04 +02:00
Lennart Poettering
baab1b3faa
Merge pull request #29234 from ddstreet/tpm2_marshal_serialize_handle_index
add tpm2 functions for marshalling blobs, serializing handles, and handle/index conversion
2023-09-29 19:15:15 +02:00
Jan Janssen
823bf39a49 elf2efi: Add GNU_RELRO support 2023-09-29 17:05:11 +02:00
Jan Janssen
79ae0d0b3e 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.
2023-09-29 16:56:30 +02:00
Jan Janssen
0b042d3de8 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
2023-09-29 16:56:30 +02:00