Commit Graph
67700 Commits
Author SHA1 Message Date
Lennart Poettering 7eda208ffe tree-wide: prefer sending pifds over pids when creating scope units 2023-10-05 17:10:00 +02:00
Lennart Poettering b0ae589b3e pidref: add trivial helper pidref_set_self() to set pidref to our handle to our own process 2023-10-05 17:08:35 +02:00
Lennart Poettering 7595fed92d pid1: allow creating scope units based in pidfds instead of plain pids 2023-10-05 17:07:06 +02:00
Daan De Meyer 6e24a9dc7f mkosi: Update to latest
We have to set the image runtime size explicitly now so that's it's
grown a bit when we boot in nspawn or qemu.
2023-10-05 16:57:10 +02:00
Daan De Meyer d852352b9c mountpoint-util: Check hardcoded list before asking kernel if option is supported
mount_option_supported() will call fsopen() which will probe the
kernel filesystem module. This means that we'll suddenly start
probing filesystem modules when running generators as those determine
which mount options to use. To prevent generators from loading kernel
filesystem modules as much as possible, let's always first check the
hardcoded list of filesystem which we know support a feature before
falling back to asking the kernel.
2023-10-05 16:50:30 +02:00
Lennart Poettering c6711da087 Merge pull request #29454 from poettering/cg-pidref-get-path
cgroup-util: add cg_pidref_get_path() helper and use it
2023-10-05 15:44:25 +02:00
Lennart Poettering 2db8278a81 Merge pull request #29458 from poettering/serialize-pidref
pid1: serialize pidref as pidfd if possible
2023-10-05 15:43:02 +02:00
Daan De Meyer 32a1d321d4 Merge pull request #29439 from yuwata/mmap-cache-cleanups-part2
mmap-cache: several cleanups (part2)
2023-10-05 14:49:48 +02:00
Lennart Poettering 289c816952 Merge pull request #29453 from poettering/cgroup-no-controller
cgroup-util: drop "controller" argument from various cgroup helper calls
2023-10-05 13:31:02 +02:00
Lennart Poettering 1523d91939 update TODO 2023-10-05 13:28:01 +02:00
Lennart Poettering a906224288 cgroup-util: add cg_pidref_get_path() helper and use it 2023-10-05 13:26:25 +02:00
Luca Boccassi 9482d34fb6 Merge pull request #29442 from yuwata/network-dhcp4-preferred-address
network: introduce [DHCPv4] PreferredAddress= setting
2023-10-05 12:25:42 +01:00
Lennart Poettering 68d0adea4f update TODO 2023-10-05 12:57:49 +02:00
Lennart Poettering 2a7451dc5d pid1: serialize pidrefs as pidfds if possible
One major step towards total pidfdification of systemd.
2023-10-05 12:57:05 +02:00
Daan De Meyer 0e70150be3 repart: Mention that xattrs are not copied when populating XFS with protofile 2023-10-05 12:54:02 +02:00
Lennart Poettering b30da1c632 cgroup-util: make sure cg_get_owner() only works for cgroups, not cgroup attribute files 2023-10-05 11:12:38 +02:00
Lennart Poettering bd1791b597 cgroup-util: drop "controller" argument from various cgroup helper calls
systemd's own cgroup hierarchy is special to us, we use it to actually
manage processes. Because of that many calls tha apply to cgroups are
only ever called with the SYSTEMD_CGROUP_CONTROLLER as controller
argument. Let's hence remove the argument altogether.

This in particular touches the kill and xattr routines.

This changes no behaviour, we just drop an argument that is always set
to the same value anyway.

This is preparation to eventually getting rid of the cgroupvs1, because
on cgroupvs2 the cgroup paths do not change for different controllers,
there's only a single hierarchy there.
2023-10-05 11:11:04 +02:00
Emil Velikov 5ee3c914a4 sd-boot: introduce and use efivar_unset()
Currently some of the code base check for the variable presence before
removing it, and some do not.

More so, in all cases (being updated) we're dealing with non-volatile
variables where changing those attribute to NVRAM wear out.

From what information I could find, there is no definitive answer if the
UEFI implementation will write to the NVRAM even when the variable is
missing.

So add a simple helper that checks for the variable presence before
removing it. While also having a bit cleaner API than the current
efivar_set(..., NULL, ...);

efivar_unset() follows the design from efivar_set*() where it returns an
EFI_STATUS even though its (presently) unused.

v2:
 - add inline comment, use early return

v3:
 - typos? typos!

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2023-10-05 09:13:37 +01:00
Yu Watanabe 6b524d70e3 test-network: add tests for [DHCPv4] RequestAddress= setting 2023-10-05 11:14:29 +09:00
Luca Boccassi 3b3abf80f1 Merge pull request #29450 from YHNdnzj/run-mandatory
man/systemd.exec: document that API fs are required to setup namespacing
2023-10-04 23:30:46 +01:00
Yu Watanabe b93bf1bf9f network: introduce [DHCPv4] RequestAddress= setting
This may be useful when requesting a specific address.

Closes #29437.
2023-10-05 06:58:08 +09:00
Yu Watanabe 5d896defeb network: skip to set request address when anonymized
In sd-dhcp-client.c, we do not set the option in the DHCPDISCOVER
message when anonymized, and the specified address is ignored
anyway. So, this does not change the behavior, but suppress
misleading debugging log in dhcp4_set_request_address().
2023-10-05 06:56:51 +09:00
Mike Yuan 723c3cd03c man/systemd.exec: document that API fs are required to setup namespacing
Closes #27997
2023-10-05 05:31:05 +08:00
Mike Yuan 6460a89a1b man/systemd.exec: suffix one more directory with / 2023-10-05 05:31:05 +08:00
Luca Boccassi 723ce80602 Merge pull request #29391 from lf-/jade/analyze-plot-tooltips
analyze: add tooltips with dependency information to "plot"
2023-10-04 21:15:52 +01:00
Lucas Adriano Salles 2de72ade08 Fix Positivo N14EP6 key toggle touchpad and programmable keys (#29448) 2023-10-05 05:06:34 +09:00
Lennart Poettering 3820f69713 stub: drop empty line 2023-10-04 17:59:57 +02:00
Lennart Poettering 4c376e58da markdown: add document listing TPM2 PCR measurements we make comprehensively
This is useful to write TPM event log decoders.
2023-10-04 15:38:48 +02:00
Yu Watanabe 0073f6c623 mmap-cache: each Window is owned by MMapFileDescriptor
And MMapFileDescriptor always references MMapCache, hence it is not
necessary Window to have a reference to MMapCache.

This also renames the list fields 'by_fd' -> 'windows', to make them
consistent with the name of the head.

No functional change, just refactoring.
2023-10-04 19:53:27 +09:00
Yu Watanabe 40f5e6a941 mmap-cache: merge mmap_cache_fd_get() with try_context() and find_mmap()
The post operations (attach the found or new window to a context, update
the keep_always flag, and calculate the address) in three steps are
equivalent, and the two searching logics are quite simple.
Let's merge them to decrease the total lines.

No functional change, just refactoring.
2023-10-04 19:53:27 +09:00
Yu Watanabe 81598f5ead mmap-cache: merge window_matches() and window_matches_fd()
Let's drop meaningless optimization, and always check if the window is
owned by the expected fd.
2023-10-04 19:53:27 +09:00
Yu Watanabe 1ed867d309 mmap-cache: merge mmap_try_harder() with make_room()
The function make_room() is short and only used by mmap_try_harder().
Let's merge them with short comments.

No functional change, just refactoring.
2023-10-04 19:53:27 +09:00
Luca Boccassi 714cb48a4f docs: fix typo in UEFI_SECURITY.md 2023-10-04 19:12:26 +09:00
Daan De Meyer 9c56d79e1c Merge pull request #29386 from yuwata/mmap-cache-cleanups-part1
mmap-cache: several cleanups (part1)
2023-10-04 08:49:24 +02:00
Yu Watanabe b5c8f47102 test-network: test SIP servers obtained by DHCP
For issue #29145.
2023-10-04 08:41:26 +02:00
Daan De Meyer 180d5aeaa7 Merge pull request #29403 from yuwata/journal-decouple-journald-and-journal-remote
journal: drop ManagedJournalFile and decouple journald and journal-remote
2023-10-04 07:55:52 +02:00
Jade Lovelace 6f39211f41 NEWS: systemd-analyze plot tooltips 2023-10-03 22:50:25 -07:00
Jade Lovelace ebaf55499f analyze: add tooltips with dependency information to "plot"
This helps a lot with figuring out why units were started when they
were, rather than guessing there is a dependency relation. We could
perhaps also do fun JavaScript things in the future to highlight
dependencies on mouse-over.
2023-10-03 22:50:25 -07:00
Yu Watanabe 0558c86c78 sd-netlink: use secure_getenv()
Follow-up for 52afaee74b.

Fixes CID#1522326.
2023-10-04 07:48:30 +02:00
Yu Watanabe 12696a7dba po: fix invalid printf format specifier 2023-10-04 09:16:11 +09:00
Yu Watanabe fcdd21ec6a tree-wide: fix typo 2023-10-04 08:58:10 +09:00
Yu Watanabe 31438511e0 sd-journal: drop unnecessary re-read of object
This reverts the following commits.
- a1640191b4
- 231741d355

These were done by my misunderstanding of the mmap cache behavior.

Also, this updates the comments added by
df04b9ed86.
2023-10-03 22:17:34 +01:00
Luca Boccassi fdae874cfe Merge pull request #29426 from ddstreet/tpm2_minor_changes
Minor commits for tpm2
2023-10-03 22:16:57 +01:00
Luca Boccassi c4e0f0f301 Merge pull request #29428 from mrc0mmand/soft-reboot
test: spawn the to-be-killed-on-soft-reboot units with --collect
2023-10-03 22:13:32 +01:00
NRK be1666886b macro: use __builtin_unreachable on NDEBUG
note that this slightly changes the semantic of assert when NDEBUG is
defined. if there's an extern function call (without attribute pure or
similar) then the compiler has to assume it has side effects and still
emit the function call.

whereas the old assert guaranteed that nothing will be evaluated on
NDEBUG.

Closes: https://github.com/systemd/systemd/issues/29408
2023-10-03 21:34:38 +02:00
Dan Streetman 639dca030b tpm2: cache TPM's supported ECC curves
This brings the tpm2_supports_ecc_curve() api in line with the other
tpm2_supports_*() functions, of returning a boolean.
2023-10-03 12:56:55 -04:00
Dan Streetman db7fdf152b tpm2: change tpm2_unseal() to accept Tpm2Context instead of device string
This matches the change to tpm2_seal(), which now accepts a Tpm2Context instead
of a device string.

This also allows using the same TPM context for sealing and unsealing, which
will be required by (future) test code when sealing/unsealing using a transient
key.
2023-10-03 12:56:55 -04:00
Dan Streetman 7014006906 tpm2: use GREEDY_REALLOC_APPEND() in tpm2_get_capability_handles(), cap max value
Simplify the function with GREEDY_REALLOC_APPEND(). Also limit the size_t-sized
max value to UINT32_MAX since that's the maximum of the range this searches,
and the max parameter for tpm2_get_capability() is uint32_t.
2023-10-03 12:56:55 -04:00
Dan Streetman 171d5b69c0 tpm2: update tpm2 test for supported commands
The test expects TPM2_CC_FIRST - 1 and TPM2_CC_LAST + 1 to be unsupported, but
those are not necessarily invalid commands. Instead test known-invalid
commands. Also add some more valid commands.
2023-10-03 12:56:55 -04:00
Dan Streetman 73592a7cca tpm2: allow tpm2_make_encryption_session() without bind key
Allow providing no bind key, and use ESYS_TR_NONE instead.
2023-10-03 12:56:55 -04:00