Commit Graph
79769 Commits
Author SHA1 Message Date
Lennart Poettering 6263fda39b tty-askpw-agent: react to SIGTERM while waiting for console (#36568)
I noticed that systemd-tty-password-agent would time out when asked to
stop via SIGTERM, and eventually be killed, under some circumstances. It
took me a while but i figured out what was going on:

systemd-ask-pw-agent blocks SIGTERM because it wants async notifications
on SIGTERM via signalfd() to listen on. That mostly works great: except
for one case: if we actually get a pw query request, and hence need to
acquire the terminal: we issue open_terminal() in that case, but if the
terminal is used otherwsie we'll hang, and because SIGTERM is blocked
we'll hang and cannot exit cleanly.

Address that: optionally, in open_terminal() look for SIGTERM by
unblcking the signal mask via ppoll() while we wait.
2025-03-03 13:56:44 +01:00
Lennart Poettering 1965d2b222 io-util: fix ppoll_usec() bypass
If a non-zero timeout is specified we should not bypass ppoll() even if
no fds are specified, since it will still act as a time based sleep in
that case.
2025-03-03 10:47:09 +01:00
Lennart Poettering 99e6d1b924 units: don't block on terminating agents
Terminating the plymouth/console agents when the wall agent takes over
can happen asynchronously, after all the pw queries are async anyway and
hence can be seen by both the plymouth/console agents and the wall
agent.

By stopping the two agents with "--no-block" we add a bit of robustness,
since trouble of them exiting won't block the wall agent to start.

This addresses the issue the previous commit fixes in a different way.
2025-03-03 10:47:09 +01:00
Lennart Poettering 789f4f7ee0 tty-askpw-agent: react to SIGTERM while waiting for console
I noticed that systemd-tty-password-agent would time out when asked to
stop via SIGTERM, and eventually be killed, under some circumstances.
It took me a while but i figured out what was going on:

systemd-ask-pw-agent blocks SIGTERM because it wants async notifications
on SIGTERM via signalfd() to listen on. That mostly works great: except
for one case: if we actually get a pw query request, and hence need to
acquire the terminal: we issue open_terminal() in that case, but if the
terminal is used otherwsie we'll hang, and because SIGTERM is blocked
we'll hang and cannot exit cleanly.

Address that: optionally, in acquire_terminal() look for SIGTERM by
unblcking the signal mask via ppoll() while we wait.
2025-03-03 10:47:09 +01:00
Jörg Behrmann 759fdb3a35 tests: remove cache=unsafe from TEST-64-UDEV-STORAGE
mkosi switch to the newer -blockdev qemu option in systemd/mkosi#3557 [1], but
cache=unsafe is an option only -drive supports.

Since the qemu-system_x86-64 man page [2] says this, cache.writeback=on is the
default and mkosi setting the other two options to the values corresponding to
unsafe, it should be fine to drop the cache=unsafe option.

┌─────────────┬─────────────────┬──────────────┬────────────────┐
│             │ cache.writeback │ cache.direct │ cache.no-flush │
├─────────────┼─────────────────┼──────────────┼────────────────┤
│writeback    │ on              │ off          │ off            │
├─────────────┼─────────────────┼──────────────┼────────────────┤
│none         │ on              │ on           │ off            │
├─────────────┼─────────────────┼──────────────┼────────────────┤
│writethrough │ off             │ off          │ off            │
├─────────────┼─────────────────┼──────────────┼────────────────┤
│directsync   │ off             │ on           │ off            │
├─────────────┼─────────────────┼──────────────┼────────────────┤
│unsafe       │ on              │ off          │ on             │
└─────────────┴─────────────────┴──────────────┴────────────────┘

[1] https://github.com/systemd/mkosi/pull/3557
[2] https://manpages.ubuntu.com/manpages/noble/en/man1/qemu-system-x86_64.1.html
2025-03-03 09:45:49 +01:00
Steve Ramage 241a0f6e0a core: DelegateNamespaces= does not depend on seccomp (#36580) 2025-03-03 14:34:31 +09:00
Lennart Poettering f2e38b01e0 sd-id128: gracefully handle systems where kernel keyring access is blocked
In various scenarios we invoke containers with access to the kernel
keyring blocked. Let's make sure we can handle this properly: when the
invocation ID is stored in in the kernel keyring and we try to read it
and get EPERM we should handle it gracefully, like EOPNOTSUPP.
2025-03-03 14:30:41 +09:00
Lennart Poettering c179f03911 osc-context: several follow-ups (#36579) 2025-03-02 22:00:09 +01:00
Jörg Behrmann 369655330d vmspawn: switch from -drive to -blockdev option 2025-03-02 21:54:30 +01:00
Mike Yuan 14a40a6d1c core/main: don't write shutdown OSC context outside of pid1
Follow-up for 98c283131c
2025-03-02 16:22:40 +01:00
Mike Yuan 20a7802852 run: send out TERM= only if actually set
Follow-up for 4d6eb6441a
2025-03-02 16:22:00 +01:00
Mike Yuan 02fc6c55e5 run: log about osc_context_open_chpriv() failure
Follow-up for 575922c914
2025-03-02 16:21:59 +01:00
Mike Yuan cada508fd8 osc-context: drop unneeded temporary variable 2025-03-02 16:21:59 +01:00
Mike Yuan ffabfef921 login/pam_systemd: use isatty_safe()
Follow-up for d8069b8add
2025-03-02 16:21:59 +01:00
Lennart Poettering f2b1de6f5b Revert "sd-json: add new sd_json_variant_unset_field() call"
This reverts commit b6a2df6307.

The functionality is entirely redundant, we already have
sd_json_variant_filter() which does the same, and is in fact even more
powerful, since it takes a list instead of a single field to remove.
2025-03-02 11:04:15 +00:00
Chris Grant 5bc576225a hwdb: Add accel orientation quirk for the GPD Pocket 4 2025-03-02 13:57:00 +09:00
Jaroslav Škarvada d8af5c262c hwdb: add Code Mercenaries Hard- und Software GmbH Virtual RC USB
It's official VRC USB dongle. Make it work in SDL apps, wine,
Steam, ... and fix the erratic mouse events when the dongle is in use.
2025-03-02 13:56:14 +09:00
Daan De Meyer daa2547e31 Add a few more bypass environment variables
When we're building ParticleOS images, we don't want the package
manager (or mkosi) to run systemd-sysusers, systemd-tmpfiles or
systemctl preset so let's add a few more bypass environment
variables that we can set to have execution of these skipped like
we already have $SYSTEMD_HWDB_UPDATE_BYPASS and $KERNEL_INSTALL_BYPASS.
2025-03-01 16:22:53 +01:00
Daan De Meyer 38701809a8 core: Add DelegateNamespaces= (#36532) 2025-03-01 15:18:45 +01:00
dependabot[bot] a60cb5c425 build(deps): bump github/codeql-action from 3.27.5 to 3.28.10
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.5 to 3.28.10.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/f09c1c0a94de965c15400f5634aa42fac8fb8f88...b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-01 14:09:07 +01:00
dependabot[bot] e24cd759e1 build(deps): bump ossf/scorecard-action from 2.4.0 to 2.4.1
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/62b2cac7ed8198b15735ed49ab1e5cf35480ba46...f49aabe0b5af0936a0987cfb85d86b75731b0186)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-01 14:08:38 +01:00
dependabot[bot] c736862058 build(deps): bump redhat-plumbers-in-action/differential-shellcheck
Bumps [redhat-plumbers-in-action/differential-shellcheck](https://github.com/redhat-plumbers-in-action/differential-shellcheck) from 5.4.0 to 5.5.3.
- [Release notes](https://github.com/redhat-plumbers-in-action/differential-shellcheck/releases)
- [Changelog](https://github.com/redhat-plumbers-in-action/differential-shellcheck/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/redhat-plumbers-in-action/differential-shellcheck/compare/cc6721c45a8800cc666de45493545a07a638d121...dd551ce780d8af741f8cd8bab6982667b906b457)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/differential-shellcheck
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-01 14:08:15 +01:00
Daan De Meyer 8234cd9989 core: Add DelegateNamespaces=
This delegates one or more namespaces to the service. Concretely,
this setting influences in which order we unshare namespaces. Delegated
namespaces are unshared *after* the user namespace is unshared. Other
namespaces are unshared *before* the user namespace is unshared.

Fixes #35369
2025-03-01 13:54:58 +01:00
Yu Watanabe aaa5065d8f bump minimum required version of glibc to 2.31, and drop many fallback logic around statx() (#36558)
glibc-2.31 was released on 2020-02-01, which is more than 5 years ago.
Let's also bump the baseline of glibc.
2025-03-01 04:18:17 +09:00
Daan De Meyer 54ae0edc4a dissect: Skip partitions with _empty label 2025-02-28 17:00:50 +01:00
Lennart Poettering 8a69330e54 homed: port to notify_recv() + convert to PidRef (#36557)
Just some refactoring/modernization
2025-02-28 17:00:31 +01:00
Yu Watanabe ee739ea692 mountpoint-util: make statx() failure critical
Two error conditions are unreachable, as now both glibc and kernel
support statx(). In other many places, failure in statx() are handled as
critical, even if it is filtered by seccomp or so. Let's follow the same
way here.
2025-03-01 00:40:22 +09:00
Yu Watanabe d5ddc0e0d3 stat-util: drop statx_fallback()
Now both our required baseline of glibc and kernel support statx.
2025-03-01 00:33:32 +09:00
Yu Watanabe 998e6394ea test-stat-util: check if linux/stat.h is actually included from sys/stat.h 2025-03-01 00:33:32 +09:00
Yu Watanabe 4424e6c811 tree-wide: drop workarounds for statx()
struct statx in glibc header was introduced in glibc-2.28
(fd70af45528d59a00eb3190ef6706cb299488fcd), but at that time,
sys/stat.h conflicts with linux/stat.h. Since glibc-2.30
(5dad6ffbb2b76215cfcd38c3001778536ada8e8a), sys/stat.h includes
linux/stat.h if exists.

Since now our baseline of glibc is 2.31. Hence, we can drop workarounds
for struct statx by importing linux/stat.h from newer kernel (v6.14-rc4).
2025-03-01 00:33:28 +09:00
Yu Watanabe 24845c4ff6 README: bump supported minimum glibc version to 2.31
The current glibc versions used by major distributions:
CentOS 9:  2.34
CentOS 10: 2.39
Fedora 40: 2.39
Fedora 41: 2.40
Fedora 42: 2.41
Ubuntu 20.04 LTS (focal): 2.31
Ubuntu 22.04 LTS (jammy): 2.35
Ubuntu 24.04 LTS (noble): 2.39
Ubuntu 24.10 (oracular):  2.40
Debian 11 (Bullseye, oldstable): 2.31
Debian 12 (Bookworm, stable):    2.36
openSUSE SLE-15-SP6: 2.38
openSUSE Tumbleweed: 2.40

Hence, based on our supporting policy, we can bump the base line to 2.31.
This commit does not change anything on our source code. But, will drop
many workarounds for supporting older glibc in later commits.
2025-02-28 23:38:45 +09:00
Yu Watanabe a3d0471b03 basic/linux: update kernel headers from v6.14-rc4 2025-02-28 23:38:45 +09:00
Yu Watanabe 914d1ec171 tmpfiles: fix output value assignment
Fixes a bug in 7eeda1da90 (v256).
2025-02-28 23:38:02 +09:00
Yu Watanabe 91421f8379 recurse-dir: fix wrong assertion and error code in log
Fixes a bug in b5a07e524e (v250).
2025-02-28 23:37:52 +09:00
Lennart Poettering 3b0103aaa5 homed: port worker management to PidRef 2025-02-28 14:18:23 +01:00
Lennart Poettering 09b3390529 pidref: take more fields into account in pidref_compare_func() 2025-02-28 14:18:20 +01:00
Lennart Poettering 2ad187fb68 pidref: export hash funcs
That way we can use them for definition of additional hash_ops that map
pidrefs to arbitrary other resources.
2025-02-28 14:18:07 +01:00
Lennart Poettering a147e72add homed: port to notify_recv_with_fds()
Found another implementation of the sd_notify() reception. Modernize it.
2025-02-28 14:18:04 +01:00
Lennart Poettering 19ade24464 notify-recv: add notify_recv() flavour that returns a split up strv instead of he message text as string
This is useful at various places, since we split up the message as first
thing there anyway.
2025-02-28 14:17:52 +01:00
Yu Watanabe 649c63d6ac profile: return earlier if it is loaded from non-bash shell
Follow-up for dadbb34919.
2025-02-28 21:24:06 +09:00
Justinas Kairys 12b3ed44f3 po: Translated using Weblate (Lithuanian)
Currently translated at 70.0% (180 of 257 strings)

Co-authored-by: Justinas Kairys <j.kairys@proton.me>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/lt/
Translation: systemd/main
2025-02-28 09:40:25 +00:00
Yu Watanabe 94dc76c996 test-network: extend test case for static routes
- split out verifications into two functions,
- also check the following scenarios:
  * unmanaging an existing interface,
  * re-managing an unmanaged interface,
  * adding a new unmanaged interface,
  * removing an unmanaged interface.
2025-02-28 08:51:14 +01:00
Luca Boccassi 80b55e4ac3 mkosi: update debian commit reference
* 4dab786933 Install new files
* a57877706d Install new files
* a6a26c4294 Install new files for upstream profile
* 2cc2784bbe Install new files for upstream
* 191edb6aa3 d/t/tests-in-lxd: skip test on any setup error
* 47c0a694b0 systemd-sysv: add Protected: yes
* 62ed7598fa README: add note about out-of-tree patches being forbidden
* dfd1b0409f systemd-resolved: recommend libidn2-0
* 88291172bc d/rules: ignore more blhc false positives
2025-02-28 15:57:10 +09:00
Yu Watanabe 3694397994 osc-context: fix typo
Follow-up for 91aa93ec8d.
2025-02-28 15:51:07 +09:00
Dan McGregor 113c159ba9 machine-id-setup: bhyve also provides a uuid
When using UEFI with bhyve it behaves similarly to qemu, and provides
a product_uuid. Use it if found, just like with qemu.
2025-02-28 13:15:35 +09:00
Lennart Poettering 46bd501faa Issue OSC ANSI sequence whenever we change "context" of a TTY, i.e. acquire privs, enter container or VM or similar (#35224)
This is mostly a strawman to get a discussion going regarding how to
communicate to terminal emulators such as ptyxis about run0 (and nspawn,
and vmspawn, and moe) and what it does.

It's hierarchical and I think still relatively simple.

/cc @chergert
2025-02-27 22:12:54 +01:00
Yu Watanabe 78f2c17454 parse-util: extend the maximum length of nftable identifiers
Since kernel v4.14, more specifically, after the following four commits,
https://github.com/torvalds/linux/commit/e46abbcc05aa8a16b0e7f5c94e86d11af9aa2770
https://github.com/torvalds/linux/commit/b7263e071aba736cea9e71cdf2e76dfa7aebd039
https://github.com/torvalds/linux/commit/387454901bd62022ac1b04e15bd8d4fcc60bbed4
https://github.com/torvalds/linux/commit/615095752100748e221028fc96163c2b78185ae4
the maximum length of nftable identifiers are extended to 255.

Now, our kernel baseline is 5.4, hence we can freely use the extended
name length.

This also modernizes code a bit, and adds test cases.

Closes #36542.
2025-02-28 04:57:00 +09:00
Yu Watanabe b8358967e6 sbsign: trivial coding style cleanups
Follow-ups for 8c0098d486.
2025-02-28 04:04:18 +09:00
Martin Wilck 505c2f2137 libfido2-util: accept cached pin in fido2_generate_hmac_hash()
fido2_generate_hmac_hash() sets req->keyring to "fido2-pin" when
calling ask_password_auto(), suggesting that a key by this name
can be read from the kernel keyring. But the keyring is never
opened because the ASK_PASSWORD_ACCEPT_CACHED flag is not set.

Set ASK_PASSWORD_ACCEPT_CACHED to allow automated / scripted
setup of encrypted volumes with FIDO2. If the PIN turns out to
be invalid, clear ASK_PASSWORD_ACCEPT_CACHED to avoid retrying
and possible lockout.
2025-02-27 17:35:47 +01:00
Lennart Poettering 250118f3f0 sbsign: Add support for offline signing (#36485)
Add new options --prepare-offline-signing, --signed-data= and
--signed-data-signature= which allow for offline signing in a
similar manner to pesign.
2025-02-27 17:34:05 +01:00