1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-03 05:18:09 +03:00
Commit Graph

70698 Commits

Author SHA1 Message Date
Luca Boccassi
c84e8125c0
Merge pull request #31090 from poettering/bpf-lsm-rename
rename a bunch of bpf related .c/.h files, and functions there in to make naming of systematic
2024-01-25 18:20:25 +00:00
Daan De Meyer
b6e8d086bd mkosi: Fix formatting in build script 2024-01-25 19:06:06 +01:00
Lennart Poettering
b68f4cade4 dissect: add --make-archive option to convert DDI to tarball 2024-01-25 18:47:39 +01:00
Daan De Meyer
6811774510 man: Document ranges for distributions config files and local config files
Let's recommend that config files and drop-ins in /usr use the range
0-49 and config files in /etc and /run use the range 50-99 so that
files in /run and /etc will generally always override files from
/usr.
2024-01-25 18:46:24 +01:00
Mike Yuan
9f6c32ac96
fstab-generator: drop unapplicable options for /usr/ too
We already drop these for /sysroot/usr/ in parse_fstab
(1e9b2e4fdd). Let's make
things consistent, and do the same for /usr/ too (after
switch-root).
2024-01-26 01:06:41 +08:00
Mike Yuan
74467890ff
fstab-generator: modernize write_extra_dependencies 2024-01-26 01:06:41 +08:00
Mike Yuan
27db64bce8
fstab-generator: add missing assertions 2024-01-26 01:06:41 +08:00
Mike Yuan
4c7cc69652
fstab-generator: drop unneeded initialization 2024-01-26 01:06:40 +08:00
Mike Yuan
5d19388349
fstab-util: clean up fstab_filter_options
Let's get rid of the confusing goto so that the flow is more
straightforward. Note that the behavior is slightly changed:
previously, ret_filtered would be an empty string even if
the original opts passed in is NULL, but after this commit
it returns NULL too. But this shouldn't matter, as all our
code handles NULL opts gracefully.
2024-01-26 01:06:40 +08:00
Mike Yuan
c521ce42b4
fstab-generator: drop assertions for mount opts
fstab_filter_options accepts NULL and (with later changes)
might even return NULL.
2024-01-26 01:06:40 +08:00
Mike Yuan
215286a405
fileio: fputs_with_space → _with_separator and modernization 2024-01-26 00:37:59 +08:00
Lennart Poettering
368b2bccd3
Merge pull request #31089 from keszybz/drop-syscall-filtering-and-new-syscalls
Drop syscall filtering and add new syscalls
2024-01-25 17:12:13 +01:00
Yu Watanabe
ea1e0bf10b core: introduce unit_unwatch_pidref_done() helper function
No functional change, just refactoring.
2024-01-26 00:31:02 +09:00
Yu Watanabe
ec5e2a1393 core/unit: split out unit_kill_one()
This also renames 'error' -> 'ret_error'.

No functional change, just refactoring.
2024-01-26 00:31:02 +09:00
Yu Watanabe
fe80d62657 core/unit: split out unit_kill_context_one()
No functional change, just refactoring.
2024-01-26 00:30:59 +09:00
Lennart Poettering
cba88d0b6b
Merge pull request #31082 from yuwata/network-cleanups-for-removing-routes
network: several cleanups for removing routes
2024-01-25 16:24:19 +01:00
Lennart Poettering
9af6ab4499 update TODO 2024-01-25 16:11:33 +01:00
Lennart Poettering
0e949cff53 bpf-socket-bind: rename bpf_serialize_socket_bind() → bpf_socket_bind_serialize()
This function is the only outlier, all other BPF glue functions are
called bpf_<module>_xyz(). Hence swap this over here too.
2024-01-25 16:11:33 +01:00
Lennart Poettering
62e2249020 core: rename restrict-ifaces.[ch] → bpf-restrict-ifaces.[ch]
Let's also clean-up naming of the "restrict-ifaces" BPF code. Let's name
the userspace glue analogous to the actual bpf code in src/core/bpf.
2024-01-25 16:11:33 +01:00
Lennart Poettering
352ec23c7f bpf-restrict-fs: also rename functions to bpf_restrict_fs_xyz()
Rename the functions too, to make clear this is really just about the
restrict-fs, and not generic LSM_BPF code.
2024-01-25 16:11:33 +01:00
Franck Bui
7ba1816dfe loop-util: drop unused .uevent_seqnum_not_before and .timestamp_not_before fields 2024-01-25 16:10:36 +01:00
Lennart Poettering
730d591798
Merge pull request #31087 from YHNdnzj/logind-cleanup
logind: several cleanups
2024-01-25 15:47:56 +01:00
Lennart Poettering
169b56758b core: rename "bpf-lsm.[ch]" → "bpf-restrict-fs.[ch]"
This file is a bit misnamed. What it actually implements is one specific
BPF LSM module, that restricts file systems. As such it really should be
named after that, and not primarily by the mechanism it uses for that.

With this our glue code is now named the same way as the actual bpf code
files in src/core/bpf/, thus things become a bit more symmetric.

This is particular relevant as we'll soon have another BPF LSM in our
tree, see #26826, and we should be able to distinguish them by name.

This commit just renames the files and does some dumb search/replace of
the string. A follow-up commit will name some functions more expressively
inside the files.
2024-01-25 14:08:26 +01:00
Zbigniew Jędrzejewski-Szmek
bca1b70af9 Update syscalls lists
For discussion of listmount() and statmount(), see
https://lwn.net/Articles/950569/.
2024-01-25 13:51:36 +01:00
Zbigniew Jędrzejewski-Szmek
58fcc6b013 meson: drop arch filtering in syscall list
I added the filtering in 752fedbea7 as a way
to reduce the number of items in the tables. I thought it's "obvious", but
it might not be so.

One immediate problem is that the filter is broken, because on arm64,
os.uname().machine returns "aarch64", so we incorrectly filter out the arm
syscalls (there is just one: arm_fadvise64_64). Of course we could fix the
filter, but I think it's better to nuke it altogether. The filter on applies to
1 arm syscall and 5 s390 syscalls, and we have 500+ other syscalls, so this
"optimization" doesn't really matter. OTOH, if we get the filter wrong,
the result is bad. And also, the existence of the filter at all creates
problems for cross-builds.

I wanted to get rid of 'generate-syscall-list.py', but we need to generate a
backslash in the output. https://github.com/mesonbuild/meson/issues/1564 makes
this very very hard, since any attempt to put a backslash an inline argument
results in the backslash being replaces by a forward slash, which doesn't quite
have the same meaning. So let's use a standalone script until
https://github.com/mesonbuild/meson/issues/1564 is resolved.
2024-01-25 13:51:21 +01:00
Zbigniew Jędrzejewski-Szmek
04a7790f23 meson: use a single line for one-item file lists
That file was mixing two styles, which looks ugly. Let's not make
the file unnecessarily long.
2024-01-25 13:50:09 +01:00
Lennart Poettering
677e6c14b1 cgroup: don't enable bpf pseudo-controllers when doing a wildcard delegation
We can only delegate actual controllers, not the BPF pseudo-controllers
we defined as there's imply no concept for that. Hence, when users set
Delegate=yes to do a wildcard delegation, only delegate the regular
controllers.

This means that we won't bother with BPF stuff for such units where it's
entirelly unnecessary.
2024-01-25 13:42:13 +01:00
Lennart Poettering
b009782b5d user-util: add comments explaining what the user name size limits effectively mean 2024-01-25 13:42:01 +01:00
Mike Yuan
74e75a05cf
logind-user: don't clear individual fields if object is freed anyway 2024-01-25 18:53:31 +08:00
Mike Yuan
562dc41bc4
logind-dbus: send session reply only for user start jobs 2024-01-25 18:53:31 +08:00
Mike Yuan
ade9553d91
logind-dbus: modernize method_set_user_linger
Currently, user_start() doesn't return any error,
but let's not eat up the return value.
Preparation for #30910, after which user_start()
does return error.
2024-01-25 18:53:30 +08:00
Mike Yuan
210d4cde71
logind-user: don't say "user X logged out" in user_finalize
"Logging out" is something done by the human user. When we stop
tracking/GC a User object, let's use a more generic phrase in case
the specific User doesn't have human users (i.e. "user" class sessions)
at all. Eventually we want something like #2900, and log this
when all user class sessions log out and we're lingering again I think.
2024-01-25 18:53:30 +08:00
Bernhard M. Wiedemann
ac0054e686 Sort input file list
so that /usr/lib/systemd/tests/unit-tests/test-libsystemd-sym
builds in a reproducible way
in spite of non-deterministic filesystem readdir order

See https://reproducible-builds.org/ for why this is good.

This patch was done while working on reproducible builds for openSUSE.
2024-01-25 10:34:56 +00:00
Yu Watanabe
b5edf3a996 test-network: check if networkd forgets routes silently removed by the kernel 2024-01-25 16:43:44 +09:00
Yu Watanabe
b91743e019 network/nexthop: drop dependent routes on removal
If a nexthop is removed, dependent routes are silently removed by the kernel.
Hence, networkd may be confused that routes that depends on the nexthop still
exist, and may fail to configure other routes or so.

This is the one for routes of 3cbbe8635a.
2024-01-25 16:43:44 +09:00
Yu Watanabe
6f09031e4d network/route: introduce reverse map for route with nexthop ID
It is not used in this commit, but will be used later.
Preparation for later commits.

This is the one for routes of 531c724682.
2024-01-25 16:43:44 +09:00
Yu Watanabe
97979ece0e network/route: also remove route on cancelling request
Otherwise, the route may arrive after we call
link_drop_foreign_address() or so on reconfiguring interface.

This is the one for routes of 4303e9806b.
2024-01-25 16:43:44 +09:00
Yu Watanabe
d529b12a01 network/route: drop Route object even if we fail to remove the route
If we could not remove a route, then previously the corresponding
Route object was never removed, as it was freed only when we receive
remove notification from the kernel. So, we might confused that the
route still exists and being removed, and might block reconfiguring
the route.

With this change, even if we fail to remove a route, the corresponding
Route object will be freed.

This is the one for routes of 56a995fe8e.
2024-01-25 16:43:44 +09:00
Yu Watanabe
74c301b9ee network/route: introduce ref/unref functions for Route object
Then, Route object can live if it is detached from the owner (Manager,
Network, or Wireguard object).

This is the one for routes of ebd9690647.
2024-01-25 16:43:44 +09:00
Yu Watanabe
3caed9ea08 network/route: introduce route_remove_and_cancel()
Then, replace route_remove_and_drop() with it.

If a route is requested, and the request is already called,
we may not received its reply and notification from the kernel, and
the corresponding Route object may not be remembered. Even in such
case, we need to remove the route, otherwise the route will come
later after the function called.

This is the version for route of f22b586a21.
2024-01-25 16:43:44 +09:00
Mike Yuan
6b7309b6fb
Merge pull request #31072 from YHNdnzj/va-arg-foreach
tree-wide: replace FOREACH_POINTER with FOREACH_ARGUMENT (VA_ARGS_FOREACH)
2024-01-25 15:22:07 +08:00
Frantisek Sumsal
0652cf8e7b test: use the default nsec3-iterations value
In Knot 3.2 the nsec3-iterations default was changed to 0 and Knot now
issues a warning if the value is > 0. Let's just use the default value,
since it's not something that's important for our tests.
2024-01-24 21:30:28 +00:00
Mikko Ylinen
7ff0e0a5e0 efi: Add EFI CC measurement protocol to stub
In confidential computing, a virtual firmware may support measurement and
event log based upon the hardware Trusted Execution Environment (TEE)
capability.

The UEFI specification defines an interface between the virtual guest OS
and virtual firmware as EFI_CC_MEASUREMENT_PROTOCOL. The (vendor specific)
measurements are captured in the CC eventlog that follows the TCG2 format.

OVMF virtual firmware has the EFI_CC_MEASUREMENT_PROTOCOL support for
Intel Trust Domain Extensions (TDX). Intel TDX has 4 runtime measurement
registers (RTMR) defined as:

RTMR[0] for TDVF configuration
RTMR[1] for the TD OS loader and kernel
RTMR[2] for the OS application
RTMR[3] reserved for special usage only

The RTMR to PCR mappings are defined in the UEFI Spec 2.10 Section 38.4.1
as follows:

TPM PCR Index | CC Measurement Register Index | TDX-measurement register
------------------------------------------------------------------------
0             |   0                           |   MRTD
1, 7          |   1                           |   RTMR[0]
2-6           |   2                           |   RTMR[1]
8-15          |   3                           |   RTMR[2]

The CC measurement eventlog is currently exposed as a raw CCEL ACPI table
by the guest OS and the events can be replayed to check log matches with
the RTMR values.

Add EFI CC measurement protocol to stub to get the UKI components measured
and included in the remote attestation reports when vTPMs are not available.
2024-01-24 21:30:12 +00:00
Luca Boccassi
d6bf9b612c mkosi: install libip4tc2 in debian/ubuntu
It's now a dlopen library and it is installed at build time via
libiptc-dev, but was never added to the running image.

Follow-up for 5b5f8f8b9a
2024-01-24 19:58:07 +00:00
Andrew Sayers
cd752b2590 Make RestartPreventExitStatus= documentation resemble SuccessExitStatus=
The documentation for `RestartPreventExitStatus=` differs from that for `SuccessExitStatus=` in ways that are sometimes confusing (e.g. using `numeric exit codes` instead of `numeric termination statuses`), and other times plain incorrect (e.g. not mentioning `termination status names`, which I've just confirmed to work in systemd 255).

This patch modifies the documentation to be as similar as possible, so as to reduce the reader's cognitive load.
2024-01-24 18:00:53 +01:00
Daan De Meyer
98118c44ae Remove a few references to dracut
Let's remove some explicit references to dracut as we prefer initrds
built with mkosi these days.
2024-01-24 17:54:38 +01:00
Mike Yuan
2d70878162
tree-wide: replace FOREACH_POINTER with FOREACH_ARGUMENT
The latter is more generic and while being compatible with
the former.
2024-01-24 21:29:11 +08:00
Mike Yuan
e9a46668c3
macro: rename VA_ARGS_FOREACH to FOREACH_ARGUMENT
"VA_ARGS" is kinda confusing, as the macro just iterates through
all arguments passed and has nothing to do with va_arg.
2024-01-24 21:21:57 +08:00
Yu Watanabe
8d01e44c1f network/route: manage all routes by Manager object
Previously, a Route object is owned by a Link object corresponding to the
outgoing interface of the route, and a Route object that does not have
outgoing interface is owned by the Manager object.

However, there were several issues:
- if a route has a nexthop ID, then the corresponding nexthop may be
  changed to use another interface, hence the outgoing interface of the
  route may be changed.
- if a route requested with MultiPathRoute=, then the link who requests
  the route is different from the outgoing interface of the configured
  route. So, we need to find routes on other interfaces on reconfiguring
  or so.

By this change, the limit of the number of routes per-interface is
tentatively dropped. Let's re-introduce the limit later in a nicer way.
2024-01-24 21:52:33 +09:00
Zbigniew Jędrzejewski-Szmek
4e434bc096 docs/UID-GIDS: use the modern spellings of pkg-config variables 2024-01-24 12:55:00 +01:00