Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v253 batch #399

Merged
merged 31 commits into from May 9, 2024
Merged

v253 batch #399

merged 31 commits into from May 9, 2024

Conversation

bluca
Copy link
Member

@bluca bluca commented May 9, 2024

No description provided.

rpigott and others added 30 commits May 9, 2024 15:41
If we request a DS and the resolver offers an unsigned SOA, a new
auxiliary transaction for the DS will be rejected as a loop, and we
might not make any progress toward finding the DS we need. Let's ensure
that we at least always check the parent in this case.

Fixes: 4769063 ("resolved: don't request the SOA for every dns label")
(cherry picked from commit d840783)
(cherry picked from commit 52c17fe)
(cherry picked from commit 16c79fe)
Previously, sd-resolved unnecessarily requested SOA records for each dns
label in the query, even though they are not needed for the chain of
trust. Since 4769063, only the necessary records are queried when
validating.

This is actually a problem in allow-downgrade mode, since we will no
longer attempt a query for a record that we know is signed a priori, and
will therefore never update our belief about the state of dnssec support
in the recursive resolver.

Rectify this by reintroducing a query for the root zone SOA in the
allow-downgrade case, specifically to test that the resolver attaches
the RRSIGs which we know must exist.

Fixes: 4769063 ("resolved: don't request the SOA for every dns label")
(cherry picked from commit 5237ffd)
(cherry picked from commit ee15f5e)
(cherry picked from commit 2ecdb3f)
If the parent zone uses a non-opt-out method that provides authenticated
negative DS replies, we still can't expect signatures from the child
zone. sd-resolved was using the authenticated status of the DS reply to
require signatures for CNAMEs, even though it had already proved that no
signature exists.

Fixes: 4769063 ("resolved: don't request the SOA for every dns label")
(cherry picked from commit 414a9b8)
(cherry picked from commit a158022)
(cherry picked from commit 37662f9)
The current output of 'systemctl list-jobs' with the --after and/or --before
switches seems backwards. With artificial units

# check-oil.service
[Unit]
Description=Check the oil level
Before=engine-ready.target

# fill-gas.service
[Unit]
Description=Fill the tank with gasoline
Before=engine-ready.target

# engine-ready.target
[Unit]
Description=The engine is ready

[Unit]
Description=Start the engine!
After=engine-ready.target
Wants=engine-ready.target

running 'systemctl list-jobs --before --after' produces

JOB UNIT                                              TYPE  STATE
93  check-oil.service                                 start running
└─      waiting for job 94 (engine-ready.target/start)   -     -
102 fill-gas.service                                  start running
└─      waiting for job 94 (engine-ready.target/start)   -     -
94  engine-ready.target                               start waiting
└─      waiting for job 111 (start-engine.service/start) -     -
└─      blocking job 93 (check-oil.service/start)        -     -
└─      blocking job 102 (fill-gas.service/start)        -     -
111 start-engine.service                              start waiting
└─      waiting for job 1 (multi-user.target/start)      -     -
└─      blocking job 94 (engine-ready.target/start)      -     -

Obviously, job 93 is not waiting for job 94, but rather blocking it.

(cherry picked from commit dc3058e)
(cherry picked from commit bf3e64f)
(cherry picked from commit a0d974a)
…ATION_ID

(cherry picked from commit 6cb8286)
(cherry picked from commit 9fd78d3)
(cherry picked from commit 9e8116e)
(cherry picked from commit 3cb7fc5)
(cherry picked from commit 02015cf)
(cherry picked from commit e929b3e)
If a user only presses ENTER when the PIN is requested (without actually typing
the PIN), an assertion is reached and no other unlock method is requested.

```
sh-5.2# systemctl status systemd-cryptsetup@cr_root
× systemd-cryptsetup@cr_root.service - Cryptography Setup for cr_root
     Loaded: loaded (/etc/crypttab; generated)
    Drop-In: /etc/systemd/system/systemd-cryptsetup@.service.d
             └─pcr-signature.conf
     Active: failed (Result: core-dump) since Thu 2024-04-25 08:44:30 UTC; 10min ago
       Docs: man:crypttab(5)
             man:systemd-cryptsetup-generator(8)
             man:systemd-cryptsetup@.service(8)
    Process: 559 ExecStartPre=/usr/bin/pcr-signature.sh (code=exited, status=0/SUCCESS)
    Process: 604 ExecStart=/usr/bin/systemd-cryptsetup attach cr_root /dev/disk/by-uuid/a8cbd937-6975-4e61-9120-ce5c03138700 none x-initrd.attach,tpm2-device=auto (code=dumped, signal=ABRT)
   Main PID: 604 (code=dumped, signal=ABRT)
        CPU: 19ms

Apr 25 08:44:29 localhost systemd[1]: Starting Cryptography Setup for cr_root...
Apr 25 08:44:30 localhost systemd-cryptsetup[604]: Assertion '!pin || pin_size > 0' failed at src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-tpm2.c:60, function cryptsetup_token_open_pin(). Aborting.
Apr 25 08:44:30 localhost systemd[1]: systemd-cryptsetup@cr_root.service: Main process exited, code=dumped, status=6/ABRT
Apr 25 08:44:30 localhost systemd[1]: systemd-cryptsetup@cr_root.service: Failed with result 'core-dump'.
Apr 25 08:44:30 localhost systemd[1]: Failed to start Cryptography Setup for cr_root.
```

In this case, `cryptsetup_token_open_pin()` receives an empty (non-NULL) `pin`
with `pin_size` equals to 0.

```
🔐 Please enter LUKS2 token PIN:

Breakpoint 3, cryptsetup_token_open_pin (cd=0x5555555744c0, token=0, pin=0x5555555b3cc0 "", pin_size=0, ret_password=0x7fffffffd380,
    ret_password_len=0x7fffffffd378, usrptr=0x0) at ../src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-tpm2.c:42
42	                void *usrptr /* plugin defined parameter passed to crypt_activate_by_token*() API */) {
(gdb) continue
Assertion '!pin || pin_size > 0' failed at src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-tpm2.c:60, function cryptsetup_token_open_pin(). Aborting.
```

(cherry picked from commit 5cef6b5)
(cherry picked from commit 723a7c8)
(cherry picked from commit 8ca0368)
The portable profiles assume /etc/resolv.conf exists, which isn't
always the case. Let's mark the mounts as optional so we don't fail
to start the unit if /etc/resolv.conf doesn't exist.

(cherry picked from commit f449a29)
(cherry picked from commit e3d5e16)
(cherry picked from commit a306357)
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
(cherry picked from commit 3eb329b)
(cherry picked from commit aff1099)
(cherry picked from commit 863a7bb)
LinkLocalAddressing accepts a boolean. This can be seen by looking at
`link_local_address_family_from_strong(cont char *s)` in
`src/network/netword-util.c#L102-108` which falls back to
`address_family_from_string`, defined two lines above (L100)
using `DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN`.

(cherry picked from commit 07b6924)
(cherry picked from commit 586e10f)
(cherry picked from commit 2b822b9)
options

Prompted by #32491

(cherry picked from commit 821bf13)
(cherry picked from commit 2c1ce9f)
(cherry picked from commit a32da72)
…nd and friends

Fixes #32599.

(cherry picked from commit 1cca93f)
(cherry picked from commit 819f3f0)
(cherry picked from commit 022ec0d)
Let's only accept valid ASCII and put a size limit on reboot arguments.

(cherry picked from commit b7ad477)
(cherry picked from commit dba7fd5)
(cherry picked from commit b42c049)
Previously, ret_boot_id was assigned even when the function failed due
to an invalid monotonic timestamp stored for a journal entry.

(cherry picked from commit c9df471)
(cherry picked from commit 6549d31)
(cherry picked from commit dc463b3)
As the former is deprecated and might not be available (i.e. on Ubuntu
Noble it's only available after installing the tzdata-legacy package).

(cherry picked from commit 568d979)
(cherry picked from commit 6e778d4)
(cherry picked from commit 80643bc)
Since AuditMode automatically switches SetupMode on, it should be
authorized to enroll SecureBoot keys.

Signed-off-by: Nicolas Bouchinet <nicolas.bouchinet@ssi.gouv.fr>
(cherry picked from commit a23a59b)
(cherry picked from commit 04f6566)
(cherry picked from commit eecb0ea)
(cherry picked from commit 47eab95)
(cherry picked from commit 8871097)
(cherry picked from commit 131bd31)
(cherry picked from commit bad6cb5)
(cherry picked from commit fce226b)
(cherry picked from commit fedee56)
(cherry picked from commit ac10f7e)
(cherry picked from commit 01dce7e)
(cherry picked from commit 1ee8e3b)
(cherry picked from commit be6aa74)
(cherry picked from commit ce1df5e)
(cherry picked from commit c9c11e0)
(cherry picked from commit 192a452)
(cherry picked from commit d8281b2)
(cherry picked from commit 768169b)
(cherry picked from commit 1174ebb)
(cherry picked from commit 3cb58c6)
(cherry picked from commit dbe9bb3)
(cherry picked from commit 2dd1676)
(cherry picked from commit ab2579e)
(cherry picked from commit 22a3e92)
(cherry picked from commit 3a50467)
(cherry picked from commit b71cbef)
(cherry picked from commit cf7fe02)
(cherry picked from commit bc65a5e)
(cherry picked from commit 9799198)
(cherry picked from commit 6d332a5)
(cherry picked from commit 11bbc1f)
(cherry picked from commit 9aeadf5)
(cherry picked from commit bb7e9d1)
(cherry picked from commit 2c30973)
(cherry picked from commit a2e7aac)
(cherry picked from commit 5de929e)
(cherry picked from commit 75c64e5)
(cherry picked from commit 5909e5c)
(cherry picked from commit 22567a5)
(cherry picked from commit cd35c15)
(cherry picked from commit 9333db0)
(cherry picked from commit 6b56cc8)
If the file was removed by some other program, we should just go
to the next one without failing. item_do() is only used for recursive
globs instead of fixed paths so skipping on missing files makes sense
(unlike if the path was fixed where we should probably fail).

Fixes #32691 (hopefully)

(cherry picked from commit 677430b)
(cherry picked from commit 4641952)
(cherry picked from commit 3abc0cb)
git restore -s origin/main hwdb.d/ test/hwdb.d

(cherry picked from commit 0530cf3)
(cherry picked from commit fadc5bb)
@bluca bluca merged commit 81acbdb into systemd:v253-stable May 9, 2024
32 of 41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet