1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00
The systemd System and Service Manager
Go to file
Lennart Poettering 313537da6f coredump: rework protocol between coredump pattern handler and processing service
In 68511cebe5 the ability to pass the
coredump's mount namespace fd from the coredump patter handler was added
to systemd-coredump. For this the protocol was augmented, in attempt to
provide both forward and backward compatibility.

The protocol as of v256: one or more datagrams with journal log fields
about the coredump are sent via an SOCK_SEQPACKET connection. It is
finished with a zero length datagram which carries the coredump fd (this
last datagram is called "sentinel" sometimes).

The protocol after 68511cebe5 is extended
so that after the sentinal a 2nd sentinel is sent, with a pair of fds:
the coredump fd *again* and a mount fd (acquired via open_tree()) of the
container's mount tree. It's a bit ugly to send the coredump fd a 2nd
time, but what's more important the implementation didn't work: since on
SOCK_SEQPACKET a zero sized datagram cannot be distinguished from EOF
(which is a Linux API design mistake), an early EOF would be
misunderstood as a zero size datagram lacking any fd, which resulted in
protocol termination.

Moreover, I think if we touch the protocol we should make the move to
pidfs at the same time.

All of the above is what this protocol rework addresses.

1. A pidfd is now sent as well

2. The protocol is now payload, followed by the coredump fd datagram (as
   before).  But now followed by a second empty datagram with a pidfd,
   and a third empty datagram with the mount tree fd. Of this the latter
   two or last are optional. Thus, it's now a stream of payload
   datagrams with one, two or three fd-laden datagrams as sentinel. If
   we read the 2nd or 3rd sentinel without an attached fd we assume this
   is actually an EOF (whether it actually is one or not doesn't matter
   here). This should provide nice up and down compatibility.

3. The mount_tree_fd is moved into the Context object. The pidfd is
   placed there too, as a PidRef. Thus the data we pass around is now
   the coredump fd plus the context, which is simpler and makes a lot
   more semantical sense I think.

4. The "first" boolean is replaced by an explicit state engine enum

Fixes: #34130
2024-10-31 23:08:11 +01:00
.clusterfuzzlite ci: unpin CFLite 2022-04-26 09:13:57 +00:00
.github github: drop workaround and use distro mold 2024-10-31 00:34:48 +09:00
.semaphore semaphore: do not build docs 2024-10-07 19:40:58 +01:00
catalog catalog: beef up new sysctl message 2024-09-13 07:29:04 +02:00
coccinelle introduce FOREACH_ELEMENT 2024-04-18 17:39:34 +02:00
docs ask-password: Allow configuring the keyring timeout via an environment variable 2024-10-30 17:43:53 +01:00
factory man: don't suggest using pam_unix.so's use_authtok switch 2024-01-17 23:59:05 +00:00
hwdb.d hwdb: add Stream Deck Neo (#34903) 2024-10-27 00:27:29 +09:00
LICENSES fundamental: Import SHA1 implementation from libxcrypt 2024-10-11 23:10:21 +03:00
man Rework sysupdate meson options (#34832) 2024-10-31 21:10:28 +00:00
mime creds-util: add a concept of "user-scoped" credentials 2024-01-30 17:07:47 +01:00
mkosi.conf.d mkosi: replace PackageManagerTrees= with SandboxTrees= 2024-10-13 05:43:32 +09:00
mkosi.extra mkosi: Fix up ownership of testuser home directory on first boot 2024-10-11 11:35:02 +02:00
mkosi.images mkosi: Install gdb in centos/fedora build image 2024-10-31 13:44:13 +00:00
mkosi.repart mkosi: Switch back to btrfs 2024-08-05 15:00:24 +02:00
mkosi.sanitizers mkosi: Don't create sanitizer wrappers for every mkfs binary 2024-09-03 08:48:34 +02:00
mkosi.uki-profiles Rework TEST-86-MULTI-PROFILE-UKI 2024-10-21 17:24:14 +02:00
modprobe.d modprobe: set 'ifb numifbs=0' to avoid autocreating ifb0 2024-01-12 23:24:54 +00:00
network network: request non-NULL SSID when a wlan interface is configured as station 2024-07-31 10:06:04 +09:00
po po: Translated using Weblate (Czech) 2024-10-29 01:50:01 +09:00
presets presets: Don't enable systemd-homed-firstboot.service by default 2024-06-08 11:29:55 +01:00
profile.d shell: define three system credentials we can propagate into shell prompts and welcome messages 2024-09-09 19:03:48 +02:00
rules.d udev: consider serial ports as unconfigured only if both port and iomem_base sysattr is zero 2024-10-17 18:59:38 +09:00
shell-completion busctl: various bugfixes + tweaks (#34928) 2024-10-29 18:15:16 +00:00
src coredump: rework protocol between coredump pattern handler and processing service 2024-10-31 23:08:11 +01:00
sysctl.d sysctl.d: Fix pid_max comment 2023-10-31 13:07:49 +01:00
sysusers.d sysusers.d: lock all system users defined by us 2024-10-29 11:00:13 +01:00
test TEST-13-NSPAWN: add test cases for listing multiple machines 2024-10-31 11:02:23 +09:00
tmpfiles.d tmpfiles.d: Remove purge flag from lines that don't support it 2024-09-17 23:02:01 +02:00
tools mkosi: add helper script to update mkosi hash 2024-09-12 10:52:52 +02:00
units meson: add separate option for sysupdated, disable in release builds 2024-10-31 21:08:08 +00:00
xorg xorg/50-systemd-user: add a full license header 2021-10-01 14:45:00 +02:00
.clang-format Improve the formatting by adding AlignArrayOfStructures and setting it to Right(right justify) 2024-03-06 15:24:23 +01:00
.ctags editors: Prevent ctags from following symlinks 2019-02-15 11:01:20 -08:00
.dir-locals.el scripts: use 4 space indentation 2019-04-12 08:30:31 +02:00
.editorconfig editorconfig: add NEWS whitespace configuration 2023-10-26 22:41:03 +01:00
.gitattributes Mark all base64 files as generated 2023-08-16 12:49:45 +02:00
.gitignore gitignore: Ignore /pkg/ instead of pkg/ (#33119) 2024-05-31 14:06:07 +08:00
.gitmodules mkosi: Replace submodules with our own thing 2024-05-30 19:31:32 +02:00
.mailmap mailmap: "reduce contributor count by 13" 2023-08-16 12:49:42 +02:00
.packit.yml Revert "packit: temporarily build systemd without BPF stuff" 2024-02-11 16:45:03 +01:00
.pylintrc Add .pylintrc to globally suppress warnings we don't really care about 2023-08-10 18:13:29 +02:00
.vimrc vimrc: explicitly set shiftwidth for the C file type 2023-09-18 13:11:45 +02:00
.ycm_extra_conf.py ycm: add doc string for all the functions in configuration file 2017-11-29 13:21:49 -07:00
LICENSE.GPL2
LICENSE.LGPL2.1
meson_options.txt meson: add separate option for sysupdated, disable in release builds 2024-10-31 21:08:08 +00:00
meson.build meson: add separate option for sysupdated, disable in release builds 2024-10-31 21:08:08 +00:00
meson.version meson: update version to 257~devel 2024-06-11 22:55:29 +01:00
mkosi.clangd mkosi: Add back support for running clangd within mkosi 2024-09-22 15:23:01 +02:00
mkosi.clean mkosi: Add missing SPDX line 2024-09-22 15:23:08 +02:00
mkosi.conf Rework TEST-86-MULTI-PROFILE-UKI 2024-10-21 17:24:14 +02:00
mkosi.coredump-journal-storage.conf mkosi: Adapt configuration to take into account configuration rework 2024-07-09 08:07:09 +02:00
mkosi.functions mkosi: Move copying packages to the output directory to the postinst script 2024-10-29 11:28:47 +01:00
mkosi.leak-sanitizer-suppressions mkosi: Adapt configuration to take into account configuration rework 2024-07-09 08:07:09 +02:00
mkosi.postinst.chroot mkosi: Move copying packages to the output directory to the postinst script 2024-10-29 11:28:47 +01:00
NEWS NEWS: fix typo 2024-10-31 10:58:25 +09:00
README Bump kernel recommended baseline to v5.4 2024-10-16 18:06:11 +02:00
README.md README.md: link bug bounty program 2024-04-11 12:58:53 +02:00
TODO update TODO 2024-10-31 23:07:48 +01:00

Systemd

System and Service Manager

Semaphore CI 2.0 Build Status
Coverity Scan Status
OSS-Fuzz Status
CIFuzz
CII Best Practices
CentOS CI - CentOS 9
CentOS CI - Arch
CentOS CI - Arch (sanitizers)
Fossies codespell report
Weblate
Coverage Status
Packaging status
OpenSSF Scorecard

Details

Most documentation is available on systemd's web site.

Assorted, older, general information about systemd can be found in the systemd Wiki.

Information about build requirements is provided in the README file.

Consult our NEWS file for information about what's new in the most recent systemd versions.

Please see the Code Map for information about this repository's layout and content.

Please see the Hacking guide for information on how to hack on systemd and test your modifications.

Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.

When preparing patches for systemd, please follow our Coding Style Guidelines.

If you are looking for support, please contact our mailing list, join our IRC channel #systemd on libera.chat or Matrix channel

Stable branches with backported patches are available in the stable repo.

We have a security bug bounty program sponsored by the Sovereign Tech Fund hosted on YesWeHack