Commit graph

72040 commits

Author SHA1 Message Date
dependabot[bot] 9504b4cd8c build(deps): bump pkg/debian from 3b47281 to 1932e19
Bumps pkg/debian from `3b47281` to `1932e19`.

---
updated-dependencies:
- dependency-name: pkg/debian
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-25 11:34:24 +01:00
Friedrich Altheide 5e3c08d375 basic/virt: Fix virtualbox detection on proprietary system via board_vendor
Identify an virtualbox instance even if product_name, sys_vendor and bios_vendor reflect the
information of the real hardware, by checking if board_vendor == "Oracle Corporation"

This fixes #13429 again
The previous fix was removed in #21127
2024-03-24 18:02:42 +00:00
Pierre GRASSER 1aee6aa5c5 po: Translated using Weblate (French)
Currently translated at 100.0% (233 of 233 strings)

Co-authored-by: Pierre GRASSER <pierre.grasser@proton.me>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/fr/
Translation: systemd/main
2024-03-24 16:55:33 +01:00
Luca Boccassi 22a36720bf test: explain how Ubuntu CI log URLs are created
Not trivially obvious, so add a couple of paragraph to explain it
2024-03-24 16:53:01 +01:00
Gabríel Arthúr Pétursson 1923e21316 shared: Fix TPM2 unsealing when PCR values change
Recreate the encryption session on each retry. It's invalidated along
with the policy session when freed, failing subsequent retries.

	Unsealing HMAC key.
	WARNING:esys:src/tss2-esys/api/Esys_Unseal.c:295:Esys_Unseal_Finish() Received TPM Error
	ERROR:esys:src/tss2-esys/api/Esys_Unseal.c:98:Esys_Unseal() Esys Finish ErrorCode (0x00000128)
	A PCR value changed during the TPM2 policy session, restarting HMAC key unsealing (30 tries left).
	Missing encryption session
	Failed to unseal secret using TPM2: Invalid argument

Fixes #31881
2024-03-24 12:49:22 +00:00
Luca Boccassi a2369b8be4
Merge pull request #31919 from YHNdnzj/analyze-verify
Some fixes/improvements for analyze
2024-03-24 11:50:44 +00:00
Luca Boccassi 7591ae713f
Merge pull request #31916 from YHNdnzj/socket-load-service
core/socket: validate service unit load state before continuing
2024-03-24 11:43:37 +00:00
Mike Yuan 8e1a1caa9c
Merge pull request #31886 from DaanDeMeyer/logind
logind: Add fallback for when the PIDFDs= property is not available
2024-03-24 19:19:12 +08:00
Luca Boccassi 9c5b5d01f9
Merge pull request #31917 from keszybz/path-equal-ptr-drop
Drop unnecessary path_equal_ptr() wrapper
2024-03-24 11:10:58 +00:00
Luca Boccassi 84c72b53c7
Merge pull request #31913 from YHNdnzj/dynamic-user-unref
core/dynamic-user: trivial modernization
2024-03-24 11:10:10 +00:00
networkException f2cb9d17da bpf-socket-bind: fix unexpected behavior with either 0 allow or deny rules
This patch fixes an issue where, when not specifiying either at least one
`SocketBindAllow` or `SocketBindDeny` rule, behavior for the bind syscall
filtering would be unexpected.

For example, when trying to bind to a port with only "SocketBindDeny=any"
given, the syscall would succeed:

> systemd-run -t -p "SocketBindDeny=any" nc -l 8080

Expected with this set of rules (also in accordance with the documentation)
would be an Operation not permitted error.

This behavior occurs because a default initialized socket_bind_rule struct
matches what "any" represents. When creating the bpf list all elements get
default initialized, as such represeting "any". Seemingly it is necressarry
to set the size of the map to at least one, as such if no allow rule is
given default initialization and minimal map size cause one any allow rule
to be in the map, causing the behavior observed above.

This patch solves this by introducing a new "match nothing" magic stored in
the rule's address family and setting such a rule as the first one if no
rule is given, making sure that default initialized rule structs are never
used.

Resolves #30556
2024-03-24 11:08:58 +00:00
mkubiak 5011038f1d Added resolution for Huion Kamvas Pro 19 2024-03-24 11:06:56 +00:00
Luca Boccassi e5db2600bc
Merge pull request #31552 from AdrianVovk/homed-update-policy-v2-split
Homed update policy: offline updates & use keyring
2024-03-24 10:11:09 +00:00
Mike Yuan ac97053618
analyze: refuse --global dot/verify
I don't quite understand the rationale of making these
verbs work with --global back in the day. But realistically
they interact with/spawn manager, while there's no
--global runtime scope manager. And to verify/inspect user
units it's sufficient to just use --user.

Fixes #31911
2024-03-24 01:28:28 +08:00
Mike Yuan 147e7b4446
analyze-dot: also show BindsTo= in --require 2024-03-24 01:28:28 +08:00
Mike Yuan de91848c3a
analyze-dot: minor modernization 2024-03-24 01:28:28 +08:00
Mike Yuan 3efb597b07
analyze-security: use FOREACH_ARRAY 2024-03-24 01:11:14 +08:00
Mike Yuan 54668cb9a0
core/socket: use FOREACH_ARRAY at one more place 2024-03-24 01:08:40 +08:00
Mike Yuan d6a911e906
core/socket: clean up socket peer handling a bit
Currently, SocketPeer object acquired through
socket_acquire_peer() are referenced twice
in socket_enter_running and service_set_socket_fd,
and the reference taken by former gets dropped
through _cleanup_. This is a bit confusing.
Let's just pass ownership instead.
2024-03-24 01:08:40 +08:00
Mike Yuan 23908d8410
core/socket: remove duplicate unit_add_two_dependencies 2024-03-24 01:08:40 +08:00
Mike Yuan f61e4e5380
core/socket: validate service unit load state before continuing
Fixes #31915
2024-03-24 01:08:40 +08:00
Mike Yuan dc4c587163
core: introduce UNIT_IS_LOAD_ERROR helper 2024-03-24 01:08:40 +08:00
Zbigniew Jędrzejewski-Szmek acb27fba43 shared/install: use PATH_IN_SET() 2024-03-23 13:30:24 +01:00
Zbigniew Jędrzejewski-Szmek 1934242b72 Drop unnecessary path_equal_ptr() wrapper
path_equal already works with NULL pointers.
2024-03-23 13:21:06 +01:00
Mike Yuan abef0ec308
core/swap: another try on memory mgmt
Follow-up for ba31a5018f

Another stupid mistake... Shouldn't have
written anything when I was tired.
2024-03-23 19:48:28 +08:00
Michael Biebl 1df021927f Fix bpf-framework build failure with gcc-bpf
The -mkernel option was dropped in
da445a5858

We also need to ensure that the include paths are properly set for the
linux kernel headers.

Fixes: #31869
2024-03-23 12:06:22 +01:00
Zbigniew Jędrzejewski-Szmek da867fa3c3
Merge pull request #31907 from mrc0mmand/efi-shenanigans
efi: check if all sections of our EFI binaries are properly aligned
2024-03-23 12:04:14 +01:00
Zbigniew Jędrzejewski-Szmek 9a50330476
Merge pull request #31779 from keszybz/elf2efi-clang-18
Make elf2efi work with clang-18
2024-03-23 12:02:34 +01:00
Adrian Vovk 269a3fe245 TEST-46-HOMED: Disable auth rate-limiting
Rate limiting authentication attempts in the test can cause somewhat
sporadic test failures: adding a test case might suddenly cause future
test cases to fail because of too many authentication attempts too
quickly

We're not trying to test the rate-limiting, we're trying to test the
functionality of homed. So we effectively disable rate-limiting on all
the home areas we create
2024-03-23 01:05:13 +00:00
Adrian Vovk 44aaff689b update TODO 2024-03-23 01:05:13 +00:00
Adrian Vovk d94c7eef12 homework: Implement offline updates
This makes it possible to update a home record (and blob directory) of a
home area that's either completely absent (i.e. on a USB stick that's
unplugged) or just inaccessible due to lack of authentication
2024-03-23 01:05:13 +00:00
Adrian Vovk 5ec87d577f homework: Accept volume key from keyring
This bypasses authentication (i.e. user_record_authenticate) if the
volume key was loaded from the keyring and no secret section is
provided.

This also changes Update() and Resize() to always try and load the
volume key from the keyring. This makes the secret section optional for
these methods while still letting them function (as long as the home
area is active)
2024-03-23 01:05:13 +00:00
Adrian Vovk d0eff7a12d homework: Always upload volume key to keyring
This commit makes homework always upload the LUKS volume key into the
kernel keyring. This is different from previous behavior in three
notable ways:

- Previously, we'd only upload if auto-resize was on. In preparation for
upcoming changes, now we always upload

- Previously, we'd upload the user's actual password (or a password
obtained from a FIDO key or similar). Now, we upload the LUKS volume key
itself, to remove a layer of unnecessary indirection.

- Previously, Lock() wouldn't remove the key from the kernel keyring.
This, of course, defeats the purpose of Lock(), so now it removes the
key

This commit also allows the LUKS volume to be unlocked using the volume
key we obtained from the keyring.
2024-03-23 01:05:13 +00:00
Adrian Vovk 9a077230a4 homed: Ensure closed FD is handled before bus req
Before this fix, the following sequence of events was possible:
1. A client holding a Ref() FD closes their FD
2. kernel sends notification that all clients closed their FDs
3. Another client obtains its own Ref() FD from homed
4. homed handles the notification that all clients have closed their
   Ref() FDs. Thus it loses track of the fact that the session is
   actually still being held open by the client from step 3

This change makes sure that homed won't respond to bus messages (and
thus won't open more Ref() FDs) until it has handled all notifications
about the existing FDs being closed.

logind has had a very similar fix applied to it in
e11544a830

Fixes https://github.com/systemd/systemd/issues/31518
2024-03-23 01:04:51 +00:00
Mike Yuan f2859ba52f
core/dynamic-user: trivial modernization 2024-03-23 03:43:30 +08:00
Mike Yuan 8f0646da09
core/execute: use STR_IN_SET where appropriate 2024-03-23 01:27:09 +08:00
Luca Boccassi 1b5f3f5662
Merge pull request #31670 from CodethinkLabs/vmspawn/generate_ssh_keys
vmspawn: generate ssh keys
2024-03-22 16:28:03 +00:00
Luca Boccassi 5bd9a430f7
Merge pull request #31908 from DaanDeMeyer/mkosi
Various mkosi fixes
2024-03-22 16:22:42 +00:00
Daan De Meyer 66b574b0a2 tree-wide: Add allow_pidfd argument to bus_append_scope_pidref() 2024-03-22 17:03:35 +01:00
Daan De Meyer d0327823d8 mkosi: Switch to Arch Linux packaging sources main branch
https://gitlab.archlinux.org/archlinux/packaging/packages/systemd/-/merge_requests/8
was merged so let's switch branches to the main branch.
2024-03-22 16:51:37 +01:00
Daan De Meyer 97b191c49b mkosi: Disable debug package generation on Arch Linux
This is extremely slow since the latest pacman release, and since
we don't strip binaries, not really needed either.
2024-03-22 16:49:10 +01:00
Zbigniew Jędrzejewski-Szmek 125f06dd1c tools/elf2efi: elif→if to make pylint happy 2024-03-22 15:44:17 +01:00
Zbigniew Jędrzejewski-Szmek 6d03e5523c tools/elf2efi: skip empty .got section and its .relro_padding
Resolves https://github.com/systemd/systemd/issues/31637.

lld-18 does the section setup differently than older versions. There is a bunch
of ordering chagnes, but it also inserts the following:

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
...
  9 .got          00000000  00000000000283c0  00000000000283c0  000283c0  2**3
                  CONTENTS, ALLOC, LOAD, DATA
 10 .relro_padding 00000c40  00000000000283c0  00000000000283c0  000283c0  2**0
                  ALLOC
 11 .data         00000024  00000000000293c0  00000000000293c0  000283c0  2**4
                  CONTENTS, ALLOC, LOAD, DATA
...

This causes a problem for us, because we try to map the .got to .rodata,
and the subsequent .data to .data, and round down the VMA to the nearest
page, which causes the PE sections to overlap.

https://github.com/llvm/llvm-project/pull/66042 adds .relro_padding to make
sure that the RELRO segment is properly write protected and allocated. For our
binaries, the .got section is empty, so we can skip it safely, and the
.relro_padding section is not useful once .got has been dropped.

We don't expect .got sections, but they are apparently inserted on i386 and
aarch64 builds. Emit a warning until we figure out why they are there.
2024-03-22 15:42:57 +01:00
Daan De Meyer 1bee93c4c7 mkosi: Enable log context 2024-03-22 15:15:01 +01:00
Daan De Meyer 2d0b8e9fb6 mkosi: Make sure man and man-db are installed everywhere 2024-03-22 15:12:20 +01:00
Daan De Meyer 27add528d7 test: Install test journals
Let's package these just like we package other test data.
2024-03-22 15:11:39 +01:00
Daan De Meyer 16f182e59a
Merge pull request #31839 from DaanDeMeyer/log
log: Add per target log levels
2024-03-22 15:11:11 +01:00
Frantisek Sumsal 7ff3b88396 efi: check if all sections of our EFI binaries are properly aligned 2024-03-22 14:02:03 +01:00
Unique-Usman 5f0e4d2fb4 Added more ASSERT macro and also make some test file to use them 2024-03-22 12:31:14 +00:00
Luca Boccassi 3be1ebcb4d
Merge pull request #31902 from YHNdnzj/swap-followup
core: some follow-ups
2024-03-22 12:08:53 +00:00