Commit Graph
84315 Commits
Author SHA1 Message Date
Yu Watanabe de438df275 coredump-send: do not forward when the service manager in container crashed
In that case, even if we forward coredump to the container namespace,
the socket unit will never triggered.
2025-10-28 14:31:41 +09:00
Yu Watanabe ab999c9280 coredump: enter mount namespace even when the crashed process is in the same PID namespace
Otherwise, we may not get stacktrace of the crashed process when it is
in running a mount namespace, especially when it is in a portable
service or service that uses RootImage=/RootDirectory=.
2025-10-28 14:31:41 +09:00
Yu Watanabe 91840f324e coredump-context: cache if the crashed process in the same PID namespace 2025-10-28 14:31:41 +09:00
Yu Watanabe 7df4841e94 coredump-context: several cleanups
- Renames Context to CoredumpContext.
- Renames enum meta_argv_t to MetadataField, and use the correct type at
  several pleaces, especially in loop.
- Parses argv (when invoked as kernel helper or with '--backtrace') or
  iov (when invoked through socket) and store values in the context.
  Previously we use the passed string as is, but let's make them in a
  type safe way.
- Stores received or built iovw in the context. Also store input fd and
  mountfs fd in the context.
- Introduces coredump_context_is_pid1() and _is_journald() helper
  functions.
- Adds COREDUMP_PIDFDID= field when the kernel passed pidfd of the
  crashed process.

No effective funtional change. Just refactoring.
2025-10-28 14:31:41 +09:00
Yu Watanabe d7755c9caf coredump: allow to control log level and so on via command line 2025-10-28 14:31:41 +09:00
Yu Watanabe 4d73712ef7 coredump: shortcut to start backtrace mode
When running as backtrace mode, it is not necessary to use kmsg, not
necessary to disable coredump from the command, and unexpectedly
passed file descriptors can be silently ignored.
2025-10-28 14:31:37 +09:00
Yu Watanabe e09543b87b coredump-config: several modernizations
- introduce CoredumpConfig object that stores all configuration
  parameters parsed from coredump.conf,
- use gperf to generate conf parser table,
- parse coredump.conf only when necessary: when systemd-coredump is
  invoked as kernel helper or by socket actiavation.
2025-10-28 14:29:22 +09:00
Lennart Poettering a6146b250e machined: support image clone/rm operations unpriv, and make hidden images always read-only (#39408) 2025-10-27 17:06:26 +01:00
Ronan Pigott 6f8e6e50a0 zsh: add completion for dbus bus address
The DBUS_SESSION_BUS_ADDRESS and DBUS_SYSTEM_BUS_ADDRESS parameters have
an interesting syntax thats useful to complete. Let's include a
completion definition for these parameters.
2025-10-27 12:41:42 +00:00
Yu Watanabe e772db52c3 core/exec-invoke: use strnpcpy() where appropriate (#39446) 2025-10-26 09:43:14 +09:00
Luca Boccassi d08b2f2a06 sd-varlink: when expecting a type and refusing due to mismatch say what was received
Sometimes it is not obvious why a message is not accepted,
so explicitly say what type was received in the log message
2025-10-26 09:30:02 +09:00
Jim Spentzos ae10e1ef80 po: Translated using Weblate (Greek)
Currently translated at 35.2% (93 of 264 strings)

Co-authored-by: Jim Spentzos <jimspentzos2000@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/el/
Translation: systemd/main
2025-10-26 09:12:44 +09:00
Mike Yuan a169a952b6 core/exec-invoke: use strnpcpy() where appropriate 2025-10-25 19:31:06 +02:00
Mike Yuan a181a9192b strxcpyx: do not access dest as an array
dest is a pointer to a string, not an array. Accessing
the "first element" just happens to work, but let's
be more careful.
2025-10-25 19:31:06 +02:00
Yu Watanabe f03b49b079 core/exec-invoke: relax restriction for process name length
Previously, we limit the length of process name by 8.
This relax the restriction then at least process comm or
program_invocation_name contains the untrucated process name.

Closes #38367.
2025-10-25 18:50:32 +02:00
Yu Watanabe 44b4caad6c test: extend start limit interval
As the modified service requires about ~10 seconds for stopping, the
service never hit the start limit even if we tried to restart the
service more than 5 times.

This also checks that the service is actually triggered by dbus method
call.

Follow-up for 8eefd0f4de.
2025-10-25 22:23:59 +09:00
Daan De Meyer f59f4ac2a7 Several cleanups for dlopen() (#39441) 2025-10-25 09:19:28 +02:00
Yu Watanabe 687bb9e2ce test: sort libraries in test-dlopen-so 2025-10-25 14:03:13 +09:00
Yu Watanabe 5e385fe16e locale: use include directory for libxkbcommon
To support the case the headers are installed at an unusual place.
2025-10-25 13:06:02 +09:00
Yu Watanabe 85fb6ad573 meson: add all 'cflags' dependencies to libshared
This should not change any behavior in most common setups.
But, may be useful when headers are installed at non-default places.
2025-10-25 12:52:23 +09:00
Yu Watanabe 910e3843fd pwquality: drop 'sym_' prefix from cleanup function
This also drops unnecessary symbols in header.
2025-10-25 11:54:21 +09:00
Yu Watanabe 7d7b1755e9 passwdqc: drop 'sym_' prefix from cleanup function
This also drops unnecessary symbols in header.
2025-10-25 11:53:41 +09:00
Yu Watanabe 56b52c00e3 qrcode-util: drop 'sym_' prefix from cleanup function 2025-10-25 11:45:20 +09:00
Yu Watanabe 63649394cc pcre2-util: drop trivial pattern_free() wrapper 2025-10-25 11:43:00 +09:00
Yu Watanabe 8aadb82966 pcre2-util: drop 'sym_' prefix from cleanup functions 2025-10-25 11:28:30 +09:00
Yu Watanabe 76afd4dc4a elf-util: drop 'sym_' prefix from cleanup function 2025-10-25 11:26:39 +09:00
Yu Watanabe 53dceb8a6d xkbcommon-util: drop 'sym_' prefix from cleanup functions 2025-10-25 11:25:41 +09:00
Yu Watanabe fc945d22d5 libarchive-util: drop 'sym_' prefix from cleanup functions 2025-10-25 11:25:19 +09:00
Yu Watanabe afb9b7c581 apparmor-util: drop 'sym_' prefix from cleanup functions 2025-10-25 11:21:12 +09:00
Yu Watanabe 78c86080ec compress: drop 'sym_' prefix from cleanup functions 2025-10-25 11:18:52 +09:00
Yu Watanabe 744d0e4422 pkcs11-util: drop 'sym_' prefix from cleanup functions 2025-10-25 11:15:05 +09:00
Yu Watanabe d0520b1ee7 module-util: drop 'sym_' prefix from cleanup functions 2025-10-25 11:12:16 +09:00
Yu Watanabe 163a3990fa openssl-util: fix spurious indent 2025-10-25 10:40:43 +09:00
Yu Watanabe 73063abf24 openssl-util: drop unused functions
They were introduced by 5f163921e9, but
never used.
2025-10-25 10:26:49 +09:00
Yu Watanabe 5f884da903 cleanup: introduce DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_MACRO_RENAME() macro
This is similar to DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(), but for
macro.
2025-10-25 10:22:16 +09:00
Daniel Hast 101dd41cb4 tree-wide: add basic validation of --background argument
Check whether the argument of the `--background` option of
`systemd-run`, `run0`, `systemd-nspawn`, `systemd-vmspawn`, and
`systemd-pty-forward` is either empty or looks like an ANSI color code,
and reject invalid values when parsing arguments.

We consider a string to look like an ANSI color code if it consists of
one or more sequences of ASCII digits separated by semicolons. This
permits every valid ANSI color code, and should reject anything that
results in garbled output.
2025-10-25 09:56:31 +09:00
Lennart Poettering 6fac8bb9b1 rules: apply loopback block device rule only onto loopback block devices
Fixes: #39426
Follow-up for: 9422ce83c2
2025-10-24 22:21:14 +02:00
Lennart Poettering 9d5fc235f4 discover-image: support clone + rm operation also unpriv 2025-10-24 17:51:00 +02:00
Lennart Poettering ee327e086e discover-image: imply that hidden images are read-only
Marking a whole directory tree OS image as read-only is difficult
privilege-wise, because so far we rely on the FS_IMMUTABLE_FL which is
not accessible to unpriv clients.

One fundamental place where we currently rely on marking images
read-only is for keeping pristine copies of the originally downloaded
image around, which we place in "hidden" image directories. This is
probably the most relevant usecase for the read-only flag. And moreover,
the only usecase for the hidden images are these read-only pristine
copies.

Hence, let's make this work reasonably in the unpriv case, and simply
imply the read-only flag for hidden images. This is strictly speaking a
change in behaviour, but effectively it shouldn't be, because for nspawn
containers that are executed we insist on names that are hostname
compatible, and hidden names aren't (because they start with a dot).
2025-10-24 17:51:00 +02:00
Lennart Poettering 502f7a2b80 rm-rf: make sure we can safely remove dirs we have no access to via rm_rf_at()
Previously, we'd first empty a dir, and then remove it. This works fine
as long as we have access to a dir. But in some cases (like for example
a foreign owned container tree) we might not have access to the dir, but
are still able to remove it (because it is empty, and in a dir we own).
Hence let's try that first. If it works, we do not need to enter the dir
(and thus fail).
2025-10-24 17:38:29 +02:00
Michal Sekletar 28e62e684b coredump: handle ENOBUFS and EMSGSIZE the same way
Depending on the runtime configuration, e.g. sysctls
net.core.wmem_default= and net.core.rmem_default and on the actual
message size, sendmsg() can fail also with ENOBUFS. E.g. alloc_skb()
failure caused by net.core.[rw]mem_default=64MiB and huge fdinfo list
from process that has 90k opened FDs.

We should handle this case in the same way as EMSGSIZE and drop part of
the message.
2025-10-24 15:23:09 +01:00
Daan De Meyer 7a18a538ef mkosi: Stop installing devel packages
These aren't required for tests and pull in a bunch of dependencies,
so let's not install them into the final image.
2025-10-24 12:59:11 +01:00
Thomas Blume 4c7e30c4e0 test: add policy packages for TEST-06-SELINUX in openSUSE 2025-10-24 12:58:32 +01:00
Dimitri John Ledkov 00a5c447a4 TODO: add that libmicrohttpd2 has openssl support (#39433)
For the openssl unification, add note that development release of
libmicrohttpd2 has openssl support.
2025-10-24 11:58:19 +01:00
Daan De Meyer 1835ce2f04 rpm: Make sure we only match files in the directories in triggers
/usr/lib/systemd/system will match /usr/lib/systemd/systemd-networkd,
which is definitely not the intention.
2025-10-24 10:29:40 +09:00
Yu Watanabe fe5625cbba mountfsd: allow privileged users to mount bare unprotected filesystems (#39411)
Split from https://github.com/systemd/systemd/pull/39394 as that
requires deeper rework that will take more time
2025-10-24 09:40:52 +09:00
Yu Watanabe f4072a9da2 Drop libcap dependency (#39425) 2025-10-24 09:40:05 +09:00
Yu Watanabe 9b414a38fa tree-wide: drop unused libcap dependencies 2025-10-24 01:52:59 +09:00
Yu Watanabe a98f710fdf capability-util: use capability_get() and _apply() in capability_quintet_enforce() 2025-10-24 01:52:59 +09:00
Yu Watanabe 6e5f07756f capability-util: use capability_get() and _apply() in change_capability() 2025-10-24 01:52:59 +09:00