HALF ECHO LEARN / REFERENCE COLLECTION
v262.2TODO.md
Git blob: 10c59d0b424af14ef5cbfde9e99aa680c9466f25
Lines 2001–3000 of 3,058
policy from currently booted kernel/event log, to close gap for first boot
for pre-built images
- per-service sandboxing option: ProtectIds=. If used, will overmount
/etc/machine-id and /proc/sys/kernel/random/boot_id with synthetic files, to
make it harder for the service to identify the host. Depending on the user
setting it should be fully randomized at invocation time, or a hash of the
real thing, keyed by the unit name or so. Of course, there are other ways to
get these IDs (e.g. journal) or similar ids (e.g. MAC addresses, DMI ids, CPU
ids), so this knob would only be useful in combination with other lockdown
options. Particularly useful for portable services, and anything else that
uses RootDirectory= or RootImage=. (Might also over-mount
/sys/class/dmi/id/*{uuid,serial} with /dev/null).
- Permit masking specific netlink APIs with RestrictAddressFamily=
- pick up creds from EFI vars
- PID 1 should send out sd_notify("WATCHDOG=1") messages (for usage in the --user mode, and when run via nspawn)
- **pid1:**
- When logging about multiple units (stopping BoundTo units, conflicts, etc.),
log both units as UNIT=, so that journalctl -u triggers on both.
- generate better errors when people try to set transient properties
that are not supported...
https://lists.freedesktop.org/archives/systemd-devel/2015-February/028076.html
- recreate systemd's D-Bus private socket file on SIGUSR2
- when we automatically restart a service, ensure we restart its rdeps, too.
- hide PAM options in fragment parser when compile time disabled
- Support --test based on current system state
- If we show an error about a unit (such as not showing up) and it has no Description string, then show a description string generated form the reverse of unit_name_mangle().
- after deserializing sockets in socket.c we should reapply sockopts and things
- drop PID 1 reloading, only do reexecing (difficult: Reload()
currently is properly synchronous, Reexec() is weird, because we
cannot delay the response properly until we are back, so instead of
being properly synchronous we just keep open the fd and close it
when done. That means clients do not get a successful method reply,
but much rather a disconnect on success.
- when breaking cycles drop services from /run first, then from /etc, then from /usr
- when a bus name of a service disappears from the bus make sure to queue further activation requests
- maybe introduce CoreScheduling=yes/no to optionally set a PR_SCHED_CORE cookie, so that all
processes in a service's cgroup share the same cookie and are guaranteed not to share SMT cores
with other units https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/admin-guide/hw-vuln/core-scheduling.rst
- ExtensionImages= deduplication for services is currently only applied to disk images without GPT envelope.
This should be extended to work with proper DDIs too, as well as directory confext/sysext. Moreover,
system-wide confext/sysext should support this too.
- Pin the mount namespace via FD by sending it back from sd-exec to the manager, and use it
for live mounting, instead of doing it via PID
- also remove PID files of a service when the service starts, not just
when it exits
- activation by journal search expression
- lock image configured with RootDirectory=/RootImage= using the usual nspawn semantics while the unit is up
- find a way how we can reload unit file configuration for
specific units only, without reloading the whole of systemd
- figure out why 'systemctl set-property --runtime avahi-daemon.service TimeoutStartSec=150'
fails with org.freedesktop.DBus.Error.PropertyReadOnly
- report org.freedesktop.DBus.Error.PropertyReadOnly better than
"Cannot set property JobTimeoutUSec, or unknown property."
- allow 'systemctl start --property=…' ?
- **PidRef conversion work:**
- cg_pid_get_xyz()
- pid_from_same_root_fs()
- get_ctty_devnr()
- actually wait for POLLIN on pidref's pidfd in service logic
- openpt_allocate_in_namespace()
- unit_attach_pid_to_cgroup_via_bus()
- cg_attach() – requires new kernel feature
- journald's process cache
- port copy.c over to use LabelOps for all labelling.
- portable services: attach not only unit files to host, but also simple
binaries to a tmpfs path in $PATH.
- portabled: when extracting unit files and copying to system.attached, if a
.p7s is available in the image, use it to protect the system.attached copy
with fs-verity, so that it cannot be tampered with
- print a nicer explanation if people use variable/specifier expansion in ExecStart= for the first word
- **Process credentials in:**
- crypttab-generator: allow defining additional crypttab-like volumes via
credentials (similar: verity-generator, integrity-generator). Use
fstab-generator logic as inspiration.
- run-generator: allow defining additional commands to run via a credential
- resolved: allow defining additional /etc/hosts entries via a credential (it
might make sense to then synthesize a new combined /etc/hosts file in /run
and bind mount it on /etc/hosts for other clients that want to read it.
- repart: allow defining additional partitions via credential
- timesyncd: pick NTP server info from credential
- portabled: read a credential "portable.extra" or so, that takes a list of
file system paths to enable on start.
- make systemd-fstab-generator look for a system credential encoding root= or
usr=
- in gpt-auto-generator: check partition uuids against such uuids supplied via
sd-stub credentials. That way, we can support parallel OS installations with
pre-built kernels.
- properly handle loop back mounts via fstab, especially regards to fsck/passno
- properly serialize the ExecStatus data from all ExecCommand objects
associated with services, sockets, mounts and swaps. Currently, the data is
flushed out on reload, which is quite a limitation.
- ProtectClock= (drops CAP_SYS_TIMES, adds seccomp filters for settimeofday, adjtimex), sets DeviceAllow o /dev/rtc
- ProtectKeyRing= to take keyring calls away
- ProtectMount= (drop mount/umount/pivot_root from seccomp, disallow fuse via DeviceAllow, imply Mountflags=slave)
- ProtectReboot= that masks reboot() and kexec_load() syscalls, prohibits kill
on PID 1 with the relevant signals, and makes relevant files in /sys and
/proc (such as the sysrq stuff) unavailable
- ProtectTracing= (drops CAP_SYS_PTRACE, blocks ptrace syscall, makes /sys/kernel/tracing go away)
- ptyfwd: use osc context information in vmspawn/nspawn/… to optionally only
listen to ^]]] key when no further vmspawn/nspawn context is allocated
- ptyfwd: use osc context information to propagate status messages from
vmspawn/nspawn to service manager's "status" string, reporting what is
currently in the fg
- pull-oci: progress notification
- redefine /var/lib/extensions/ as the dir one can place all three of sysext,
confext as well is multi-modal DDIs that qualify as both. Then introduce
/var/lib/sysexts/ which can be used to place only DDIs that shall be used as
sysext
- refcounting in sd-resolve is borked
- refuse boot if /usr/lib/os-release is missing or /etc/machine-id cannot be set up
- remove any syslog support from log.c — we probably cannot do this before split-off udev is gone for good
- remove tomoyo support, it's obsolete and unmaintained apparently
- RemoveKeyRing= to remove all keyring entries of the specified user
- repart + cryptsetup: support file systems that are encrypted and use verity
on top. Usecase: confexts that shall be signed by the admin but also be
confidential. Then, add a new --make-ddi=confext-encrypted for this.
- repart/gpt-auto/DDIs: maybe introduce a concept of "extension" partitions,
that have a new type uuid and can "extend" earlier partitions, to work around
the fact that systemd-repart can only grow the last partition defined. During
activation we'd simply set up a dm-linear mapping to merge them again. A
partition that is to be extended would just set a bit in the partition flags
field to indicate that there's another extension partition to look for. The
identifying UUID of the extension partition would be hashed in counter mode
from the uuid of the original partition it extends. Inspiration for this is
the "dynamic partitions" concept of new Android. This would be a minimalistic
concept of a volume manager, with the extents it manages being exposes as GPT
partitions. I a partition is extended multiple times they should probably
grow exponentially in size to ensure O(log(n)) time for finding them on
access.
- repart: introduce concept of "ghost" partitions, that we setup in almost all
ways like other partitions, but do not actually register in the actual gpt
table, but only tell the kernel about via BLKPG ioctl. These partitions are
disk backed (hence can be large), but not persistent (as they are invisible
on next boot). Could be used by live media and similar, to boot up as usual
but automatically start at zero on each boot. There should also be a way to
make ghost partitions properly persistent on request.
- repart: introduce MigrateFileSystem= or so which is a bit like
CopyFiles=/CopyBlocks= but operates via btrfs device logic: adds target as
new device then removes source from btrfs. Usecase: a live medium which uses
"ghost" partitions as suggested above, which can become persistent on request
on another device.
- replace all \x1b, \x1B, \033 C string escape sequences in our codebase with a
more readable \e. It's a GNU extension, but a ton more readable than the
others, and most importantly it doesn't result in confusing errors if you
suffix the escape sequence with one more decimal digit, because compilers
think you might actually specify a value outside the 8bit range with that.
- replace all uses of fopen_temporary() by fopen_tmpfile_linkable() +
flink_tmpfile() and then get rid of fopen_temporary(). Benefit: use O_TMPFILE
pervasively, and avoid rename() wherever we can.
- replace bootctl's PE version check to actually use APIs from pe-binary.[ch]
to find binary version.
- replace symlink_label(), mknodat_label(), btrfs_subvol_make_label(),
mkdir_label() and related calls by flags-based calls that use
label_ops_pre()/label_ops_post().
- report: have something that requests cloud workload identity bearer tokens
and includes it in the report
- Reset TPM2 DA bit on each successful boot
- **resolved:**
- mDNS/DNS-SD
- service registration
- service/domain/types browsing
- avahi compat
- DNS-SD service registration from socket units
- resolved should optionally register additional per-interface LLMNR
names, so that for the container case we can establish the same name
(maybe "host") for referencing the server, everywhere.
- allow clients to request DNSSEC for a single lookup even if DNSSEC is off (?)
- make resolved process DNR DHCP info
- report ttl in resolution replies if we know it. This data is useful
for tools such as wireguard which want to periodically re-resolve DNS names,
and might want to use the TTL has hint for that.
- take possession of some IPv6 ULA address (let's say
fd00:5353:5353:5353:5353:5353:5353:5353), and listen on port 53 on it for the
local stubs, so that we can make the stub available via ipv6 too.
- revisit how we pass fs images and initrd to the kernel. take uefi http boot
ramdisks as inspiration: for any confext/sysext/initrd erofs/DDI image simply
generate a fake pmem region in the UEFI memory tables, that Linux then turns
into /dev/pmemX. Then turn of cpio-based initrd logic in linux kernel,
instead let kernel boot directly into /dev/pmem0. In order to allow our usual
cpio-based parameterization, teach PID 1 to just uncompress cpio ourselves
early on, from another pmem device. (Related to this, maybe introduce a new
PE section .ramdisk that just synthesizes pmem devices from arbitrary
blobs. Could be particularly useful in add-ons)
- rework ExecOutput and ExecInput enums so that EXEC_OUTPUT_NULL loses its
magic meaning and is no longer upgraded to something else if set explicitly.
- rework fopen_temporary() to make use of open_tmpfile_linkable() (problem: the
kernel doesn't support linkat() that replaces existing files, currently)
- rework journalctl -M to be based on a machined method that generates a mount
fd of the relevant journal dirs in the container with uidmapping applied to
allow the host to read it, while making everything read-only.
- rework loopback support in fstab: when "loop" option is used, then
instantiate a new systemd-loop@.service for the source path, set the
lo_file_name field for it to something recognizable derived from the fstab
line, and then generate a mount unit for it using a udev generated symlink
based on lo_file_name.
- rework recursive read-only remount to use new mount API
- rework seccomp/nnp logic that even if User= is used in combination with
a seccomp option we don't have to set NNP. For that, change uid first while
keeping CAP_SYS_ADMIN, then apply seccomp, the drop cap.
- rewrite bpf-devices in libbpf/C code, rather than home-grown BPF assembly, to
match bpf-restrict-fs, bpf-restrict-ifaces, bpf-socket-bind
- rewrite bpf-firewall in libbpf/C code
- rfkill,backlight: we probably should run the load tools inside of the udev rules so that the state is properly initialized by the time other software sees it
- rough proposed implementation design for remote attestation infra: add a tool
that generates a quote of local PCRs and NvPCRs, along with synchronous log
snapshot. use "audit session" logic for that, so that we get read-outs and
signature in one step. Then turn this into a JSON object. Use the "TCG TSS 2.0
JSON Data Types and Policy Language" format to encode the signature. And CEL
for the measurement log.
- run0: maybe enable utmp for run0 sessions, so that they are easily visible.
- **sd-boot:**
- do something useful if we find exactly zero entries (ignoring items
such as reboot/poweroff/factory reset). Show a help text or so.
- optionally ask for confirmation before executing certain operations
(e.g. factory resets, storagetm with world access, and so on)
- for each installed OS, grey out older entries (i.e. all but the
newest), to indicate they are obsolete
- we probably should include all BootXY EFI variable defined boot
entries in our menu, and then suppress ourselves. Benefit: instant
compatibility with all other OSes which register things there, in particular
on other disks. Always boot into them via NextBoot EFI variable, to not
affect PCR values.
- should look for information what to boot in SMBIOS, too, so that VM
managers can tell sd-boot what to boot into and suchlike
- instead of unconditionally deriving the ESP to search boot loader
spec entries in from the paths of sd-boot binary, let's optionally allow it
to be configured on sd-boot cmdline + efi var. Use case: embed sd-boot in the
UEFI firmware (for example, ovmf supports that via qemu cmdline option), and
use it to load stuff from the ESP.
- optionally, show boot menu when previous default boot item has
non-zero "tries done" count
- **sd-bus:**
- EBADSLT handling
- GetAllProperties() on a non-existing object does not result in a failure currently
- port to sd-resolve for connecting to TCP dbus servers
- see if we can introduce a new sd_bus_get_owner_machine_id() call to retrieve the machine ID of the machine of the bus itself
- see if we can drop more message validation on the sending side
- add API to clone sd_bus_message objects
- longer term: priority inheritance
- dbus spec updates:
- NameLost/NameAcquired obsolete
- path escaping
- update systemd.special(7) to mention that dbus.socket is only about the compatibility socket now
- add vtable flag, that may be used to request client creds implicitly
and asynchronously before dispatching the operation
- parse addresses given in sd_bus_set_addresses immediately and not
only when used. Add unit tests.
- **sd-device:**
- add an API for acquiring list of child devices, given a device
objects (i.e. all child dirents that dirs or symlinks to dirs)
- maybe pin the sysfs dir with an fd, during the entire runtime of
an sd_device, then always work based on that.
- should return the devnum type (i.e. 'b' or 'c') via some API for an
sd_device object, so that data passed into sd_device_new_from_devnum() can
also be queried.
- **sd-event:**
- allow multiple signal handlers per signal?
- document chaining of signal handler for SIGCHLD and child handlers
- define more intervals where we will shift wakeup intervals around in, 1h, 6h, 24h, ...
- maybe support iouring as backend, so that we allow hooking read and write
operations instead of IO ready events into event loops. See considerations
here:
http://blog.vmsplice.net/2020/07/rethinking-event-loop-integration-for.html
- add ability to "chain" event sources. Specifically, add a call
sd_event_source_chain(x, y), which will automatically enable event source y
in oneshot mode once x is triggered. Use case: in src/core/mount.c implement
the /proc/self/mountinfo rescan on SIGCHLD with this: whenever a SIGCHLD is
seen, trigger the rescan defer event source automatically, and allow it to be
dispatched *before* the SIGCHLD is handled (based on priorities). Benefit:
dispatch order is strictly controlled by priorities again. (next step: chain
event sources to the ratelimit being over)
- compat wd reuse in inotify code: keep a set of removed watch
descriptors, and clear this set piecemeal when we see the IN_IGNORED event
for it, or when read() returns EAGAIN or on IN_Q_OVERFLOW. Then, whenever we
see an inotify wd event check against this set, and if it is contained ignore
the event. (to be fully correct this would have to count the occurrences, in
case the same wd is reused multiple times before we start processing
IN_IGNORED again)
- optionally, if per-event source rate limit is hit, downgrade
priority, but leave enabled, and once ratelimit window is over, upgrade
priority again. That way we can combat event source starvation without
stopping processing events from one source entirely.
- similar to existing inotify support add fanotify support (given
that apparently new features in this area are only going to be added to the
latter).
- add 1st class event source for clock changes
- add 1st class event source for timezone changes
- add native support for P_ALL waitid() watching, then move PID 1 to
it for reaping assigned but unknown children. This needs to some special care
to operate somewhat sensibly in light of priorities: P_ALL will return
arbitrary processes, regardless of the priority we want to watch them with,
hence on each event loop iteration check all processes which we shall watch
with higher prio explicitly, and then watch the entire rest with P_ALL.
- sd-journal puts a limit on parallel journal files to view at once. journald
should probably honour that same limit (JOURNAL_FILES_MAX) when vacuuming to
ensure we never generate more files than we can actually view.
- sd-lldp: pick up 802.3 maximum frame size/mtu, to be able to detect jumbo
frame capable networks
- **sd-rtnl:**
- add support for more attribute types
- inbuilt piping support (essentially degenerate async)? see loopback-setup.c and other places
- **sd-stub:**
- detect if we are running with uefi console output on serial, and if so
automatically add console= to kernel cmdline matching the same port.
- add ".bootcfg" section for kernel bootconfig data (as per
https://docs.kernel.org/admin-guide/bootconfig.html)
- sd_notify/vsock: maybe support binding to AF_VSOCK in Type=notify services,
then passing $NOTIFY_SOCKET and $NOTIFY_GUESTCID with PID1's cid (typically
fixed to "2", i.e. the official host cid) and the expected guest cid, for the
two sides of the channel. The latter env var could then be used in an
appropriate qemu cmdline. That way qemu payloads could talk sd_notify()
directly to host service manager.
- **seccomp:**
- maybe use seccomp_merge() to merge our filters per-arch if we can.
Apparently kernel performance is much better with fewer larger seccomp
filters than with more smaller seccomp filters.
- by default mask x32 ABI system wide on x86-64. it's on its way out
- don't install filters for ABIs that are masked anyway for the
specific service
- seems that when we follow symlinks to units we prefer the symlink
destination path over /etc and /usr. We should not do that. Instead
/etc should always override /run+/usr and also any symlink
destination.
- .service with invalid Sockets= starts successfully.
- services: add support for cryptographically unlocking per-service directories
via TPM2. Specifically, for StateDirectory= (and related dirs) use fscrypt to
set up the directory so that it can only be accessed if host and app are in
order.
- shared/wall: Once more programs are taught to prefer sd-login over utmp,
switch the default wall implementation to wall_logind
(https://github.com/systemd/systemd/pull/29051#issuecomment-1704917074)
- show whether a service has out-of-date configuration in "systemctl status" by
using mtime data of ConfigurationDirectory=.
- shutdown logging: store to EFI var, and store to USB stick?
- signed bpf loading: to address need for signature verification for bpf
programs when they are loaded, and given the bpf folks don't think this is
realistic in kernel space, maybe add small daemon that facilitates this
loading on request of clients, validates signatures and then loads the
programs. This daemon should be the only daemon with privs to do load BPF on
the system. It might be a good idea to run this daemon already in the initrd,
and leave it around during the initrd transition, to continue serve requests.
Should then live in its own fs namespace that inherits from the initrd's
fs tree, not from the host, to isolate it properly. Should set
PR_SET_DUMPABLE so that it cannot be ptraced from the host. Should have
CAP_SYS_BPF as only service around.
- SIGRTMIN+18 and memory pressure handling should still be added to: localed,
oomd, timedated.
- socket units: allow creating a udev monitor socket with ListenDevices= or so,
with matches, then activate app through that passing socket over
- special case some calls of chase() to use openat2() internally, so
that the kernel does what we otherwise do.
- Split vconsole-setup in two, of which the second is started via udev (instead
of the "restart" job it currently fires). That way, boot becomes purely
positive again, and we can nicely order the two against each other.
- start making use of the new --graceful switch to util-linux' umount command
- start using STATX_SUBVOL in btrfs_is_subvol(). Also, make use of it
generically, so that image discovery recognizes bcachefs subvols too.
- storagetm: maybe also serve the specified disk via HTTP? we have glue for
microhttpd anyway already. Idea would also be serve currently booted UKI as
separate HTTP resource, so that EFI http boot on another system could
directly boot from our system, with full access to the hdd.
- **storagetm:**
- add USB mass storage device logic, so that all local disks are also exposed
as mass storage devices on systems that have a USB controller that can
operate in device mode
- add NVMe authentication
- **sigpwr.target** doesn't do anything useful. Consider hooking it up to
poweroff.target.
- Provide a fallback in **rescue.service** that prints a fixed message
if sulogin-shell could not be started.
- support boot into nvme-over-tcp: add generator that allows specifying nvme
devices on kernel cmdline + credentials. Also maybe add interactive mode
(where the user is prompted for nvme info), in order to boot from other
system's HDD.
- support crash reporting operation modes (https://live.gnome.org/GnomeOS/Design/Whiteboards/ProblemReporting)
- support projid-based quota in machinectl for containers
- Support ReadWritePaths/ReadOnlyPaths/InaccessiblePaths in systemd --user instances
via the new unprivileged Landlock LSM (https://landlock.io)
- support specifying download hash sum in systemd-import-generator expression
to pin image/tarball.
- sync dynamic uids/gids between host+portable service (i.e. if DynamicUser=1 is set for a service, make sure that the
selected user is resolvable in the service even if it ships its own /etc/passwd)
- synchronize console access with BSD locks:
https://lists.freedesktop.org/archives/systemd-devel/2014-October/024582.html
- sysext: before applying a sysext, do a superficial validation run so that
things are not rearranged to wildy. I.e. protect against accidental fuckups,
such as masking out /usr/lib/ or so. We should probably refuse if existing
inodes are replaced by other types of inodes or so.
- sysext: measure all activated sysext into a TPM PCR
- system BPF LSM policy that enforces that block device backed mounts may only
be established on top of dm-crypt or dm-verity devices, or an allowlist of
file systems (which should probably include vfat, for compat with the ESP)
- system BPF LSM policy that prohibits creating files owned by "nobody"
system-wide
- system BPF LSM policy that prohibits creating or opening device nodes outside
of devtmpfs/tmpfs, except if they are the pseudo-devices /dev/null,
/dev/zero, /dev/urandom and so on.
- "systemctl preset-all" should probably order the unit files it
operates on lexicographically before starting to work, in order to
ensure deterministic behaviour if two unit files conflict (like DMs
do, for example)
- systemctl, machinectl, loginctl: port "status" commands over to
format-table.c's vertical output logic.
- **systemctl:**
- add systemctl switch to dump transaction without executing it
- Add a verbose mode to "systemctl start" and friends that explains what is being done or not done
- print nice message from systemctl --failed if there are no entries shown, and hook that into ExecStartPre of rescue.service/emergency.service
- add new command to systemctl: "systemctl system-reexec" which reexecs as many daemons as virtually possible
- systemctl enable: fail if target to alias into does not exist? maybe show how many units are enabled afterwards?
- systemctl: "Journal has been rotated since unit was started." message is misleading
- if some operation fails, show log output?
- systemd-analyze inspect-elf should show other notes too, at least build-id.
- systemd-analyze netif that explains predictable interface (or networkctl)
- systemd-analyze: port "pcrs" verb to talk directly to TPM device, instead of
using sysfs interface (well, or maybe not, as that would require privileges?)
- systemd-boot: maybe add support for collapsing menu entries of the same OS
into one item that can be opened (like in a "tree view" UI element) or
collapsed. If only a single OS is installed, disable this mode, but if
multiple OSes are installed might make sense to default to it, so that user
is not immediately bombarded with a multitude of Linux kernel versions but
only one for each OS.
- systemd-creds: extend encryption logic to support asymmetric
encryption/authentication. Idea: add new verb "systemd-creds public-key"
which generates a priv/pub key pair on the TPM2 and stores the priv key
locally in /var. It then outputs a certificate for the pub part to stdout.
This can then be copied/taken elsewhere, and can be used for encrypting creds
that only the host on its specific hw can decrypt. Then, support a drop-in
dir with certificates that can be used to authenticate credentials. Flow of
operations is then this: build image with owner certificate, then after
boot up issue "systemd-creds public-key" to acquire pubkey of the machine.
Then, when passing data to the machine, sign with privkey belonging to one of
the dropped in certs and encrypted with machine pubkey, and pass to machine.
Machine is then able to authenticate you, and confidentiality is guaranteed.
- systemd-dissect: add --cat switch for dumping files such as /etc/os-release
- systemd-dissect: show available versions inside of a disk image, i.e. if
multiple versions are around of the same resource, show which ones. (in other
words: show partition labels).
- systemd-firstboot: optionally install an ssh key for root for offline use.
- systemd-gpt-auto-generator: add kernel cmdline option to override block
device to dissect. also support dissecting a regular file. useccase: include
encrypted/verity root fs in UKI.
- systemd-inhibit: make taking delay locks useful: support sending SIGINT or SIGTERM on PrepareForSleep()
- **systemd-measure tool:**
- pre-calculate PCR 12 (command line) + PCR 13 (sysext) the same way we can precalculate PCR 11
- add --pcrpkey-auto as an alternative to --pcrpkey=, where it would just use
the same public key specified with --public-key= (or the one automatically
derived from --private-key=).
- allow multiple --initrd=, --efifw=, --dtbauto=, etc., params and pad and
concatenate the contents in the same way that ukify does, so we end up with
the expected measurement.
- systemd-mount should only consider modern file systems when mounting, similar
to systemd-dissect
- systemd-path: Add "private" runtime/state/cache dir enum, mapping to
$RUNTIME_DIRECTORY, $STATE_DIRECTORY and such
- **systemd-pcrextend:**
- once we have that start measuring every sysext we apply, every confext,
every RootImage= we apply, every nspawn and so on. All in separate fake
PCRs.
- **systemd-repart:**
- implement Integrity=data/meta and Integrity=inline for non-LUKS
case. Currently, only Integrity=inline combined with Encrypt= is implemented
and uses libcryptsetup features. Add support for plain dm-integrity setups when
integrity tags are stored by the device (inline), interleaved with data (data),
and on a separate device (meta).
- add --ghost, that creates file systems, updates the kernel's
partition table but does *not* update partition table on disk. This way, we
have disk backed file systems that go effectively disappear on reboot. This
is useful when booting from a "live" usb stick that is writable, as it means
we do not have to place everything in memory. Moreover, we could then migrate
the file systems to disk later (using btrfs device replacement), if needed as
part of an installer logic.
- make useful to duplicate current OS onto a second disk, so
that we can sanely copy ESP contents, /usr/ images, and then set up btrfs
raid for the root fs to extend/mirror the existing install. This would be
very similar to the concept of live-install-through-btrfs-migration.
- should probably enable btrfs' "temp_fsid" feature for all file
systems it creates, as we have no interest in RAID for repart, and it should
make sure that we can mount them trivially everywhere.
- add support for formatting dm-crypt + dm-integrity file
systems.
- also derive the volume key from the seed value, for the
aforementioned purpose.
- in addition to the existing "factory reset" mode (which
simply empties existing partitions marked for that). add a mode where
partitions marked for it are entirely removed. Use case: remove secondary OS
copy, and redundant partitions entirely, and recreate them anew.
- if the GPT *disk* UUID (i.e. the one global for the entire
disk) is set to all FFFFF then use this as trigger for factory reset, in
addition to the existing mechanisms via EFI variables and kernel command
line. Benefit: works also on non-EFI systems, and can be requested on one
boot, for the next.
- read LUKS encryption key from $CREDENTIALS_DIRECTORY
- support setting up dm-integrity with HMAC
- maybe remove half-initialized image on failure. It fails
if the output file exists, so a repeated invocation will usually fail if
something goes wrong on the way.
- by default generate minimized partition tables (i.e. tables
that only cover the space actually used, excluding any free space at the
end), in order to maximize dd'ability. Requires libfdisk work, see
https://github.com/karelzak/util-linux/issues/907
- MBR partition table support. Care needs to be taken regarding
Type=, so that partition definitions can sanely apply to both the GPT and the
MBR case. Idea: accept syntax "Type=gpt:home mbr:0x83" for setting the types
for the two partition types explicitly. And provide an internal mapping so
that "Type=linux-generic" maps to the right types for both partition tables
automatically.
- allow sizing partitions as factor of available RAM, so that
we can reasonably size swap partitions for hibernation.
- allow boolean option that ensures that if existing partition
doesn't exist within the configured size bounds the whole command fails. This
is useful to implement ESP vs. XBOOTLDR schemes in installers: have one set
of repart files for the case where ESP is large enough and one where it isn't
and XBOOTLDR is added in instead. Then apply the former first, and if it
fails to apply use the latter.
- add per-partition option to never reuse existing partition
and always create anew even if matching partition already exists.
- add per-partition option to fail if partition already exist,
i.e. is not added new. Similar, add option to fail if partition does not exist yet.
- allow disabling growing of specific partitions, or making
them (think ESP: we don't ever want to grow it, since we cannot resize vfat)
Also add option to disable operation via kernel command line.
- make it a static checker during early boot for existence and
absence of other partitions for trusted boot environments
- add support for SD_GPT_FLAG_GROWFS also on real systems, i.e.
generate some unit to actually enlarge the fs after growing the partition
during boot.
- do not print "Successfully resized …" when no change was done.
- systemd-stub: maybe store a "boot counter" in the ESP, and pass it down to
userspace to allow ordering boots (for example in journalctl). The counter
would be monotonically increased on every boot.
- systemd-sysext: add "exec" command or so that is a bit like "refresh" but
runs it in a new namespace and then just executes the selected binary within
it. Could be useful to run one-off binaries inside a sysext as a CLI tool.
- systemd-tpm2-setup should support a mode where we refuse booting if the SRK
changed. (Must be opt-in, to not break systems which are supposed to be
migratable between PCs)
- systemd-tpm2-support: add a some logic that detects if system is in DA
lockout mode, and queries the user for TPM recovery PIN then.
- add a networking provider API, inspired by the StorageProvider. Make networkd
a provider that exposes interfaces for adding tap, tun, veth via the api,
base this on .netdev logic somehow.
- $SYSTEMD_EXECPID that the service manager sets should
be augmented with $SYSTEMD_EXECPIDFD (and similar for
other env vars we might send).
- **sysupdate:**
- add fuzzing to the pattern parser
- support casync as download mechanism
- "systemd-sysupdate update --all" support, that iterates through all components
defined on the host, plus all images installed into /var/lib/machines/,
/var/lib/portable/ and so on.
- Allow invocation with a single transfer definition, i.e. with
--definitions= pointing to a file rather than a dir.
- add ability to disable implicit decompression of downloaded artifacts,
i.e. a Compress=no option in the transfer definitions
- download multiple arbitrary patterns from same source
- SHA256SUMS format with bearer tokens for each resource to download
- decrypt SHA256SUMS with key from tpm
- turn http backend stuff int plugin via varlink
- for each transfer support looking at multiple sources,
pick source with newest entry. If multiple sources have the same entry, use
first configured source. Usecase: "sideload" components from local dirs,
without disabling remote sources.
- support "revoked" items, which cause the client to
downgrade/upgrade
- introduce per-user version that can update per-user installed dDIs
- make transport pluggable, so people can plug casync or
similar behind it, instead of http.
- sysusers: allow specifying a path to an inode *and* a literal UID in the UID
column, so that if the inode exists it is used, and if not the literal UID is
used. Use this for services such as the imds one, which run under their own
UID in the initrd, and whose data should survive to the host, properly owned.
- teach ConditionKernelCommandLine= globs or regexes (in order to match foobar={no,0,off})
- teach nspawn/machined a new bus call/verb that gets you a
shell in containers that have no sensible pid1, via joining the container,
and invoking a shell directly. Then provide another new bus call/vern that is
somewhat automatic: if we detect that pid1 is running and fully booted up we
provide a proper login shell, otherwise just a joined shell. Then expose that
as primary way into the container.
- teach parse_timestamp() timezones like the calendar spec already knows it
- teach systemd-nspawn the boot assessment logic: hook up vpick's try counters
with success notifications from nspawn payloads. When this is enabled,
automatically support reverting back to older OS version images if newer ones
fail to boot.
- The bind(AF_UNSPEC) construct (for resetting sockets to their initial state)
should be blocked in many cases because it punches holes in many sandboxes.
- the pub/priv key pair generated on the TPM2 should probably also be one you
can use to get a remote attestation quote.
- The udev blkid built-in should expose a property that reflects
whether media was sensed in USB CF/SD card readers. This should then
be used to control SYSTEMD_READY=1/0 so that USB card readers aren't
picked up by systemd unless they contain a medium. This would mirror
the behaviour we already have for CD drives.
- There's currently no way to cancel fsck (used to be possible via C-c or c on the console)
- there's probably something wrong with having user mounts below /sys,
as we have for debugfs. for example, src/core/mount.c handles mounts
prefixed with /sys generally special.
https://lists.freedesktop.org/archives/systemd-devel/2015-June/032962.html
- think about requeuing jobs when daemon-reload is issued? use case:
the initrd issues a reload after fstab from the host is accessible
and we might want to requeue the mounts local-fs acquired through
that automatically.
- **timer units:**
- timer units should get the ability to trigger when DST changes
- Modulate timer frequency based on battery state
- timesyncd: add ugly bus calls to set NTP servers per-interface, for usage by NM
- timesyncd: when saving/restoring clock try to take boot time into account.
Specifically, along with the saved clock, store the current boot ID. When
starting, check if the boot id matches. If so, don't do anything (we are on
the same boot and clock just kept running anyway). If not, then read
CLOCK_BOOTTIME (which started at boot), and add it to the saved clock
timestamp, to compensate for the time we spent booting. If EFI timestamps are
available, also include that in the calculation. With this we'll then only
miss the time spent during shutdown after timesync stopped and before the
system actually reset.
- tiny varlink service that takes a fd passed in and serves it via http. Then
make use of that in networkd, and expose some EFI binary of choice for
DHCP/HTTP base EFI boot.
- **tmpfiles:**
- creating new directories/subvolumes/fifos/device nodes
should not follow symlinks. None of the other adjustment or creation
calls follow symlinks.
- teach tmpfiles.d q/Q logic something sensible in the context of XFS/ext4
project quota
- teach tmpfiles.d m/M to move / atomic move + symlink old -> new
- add new line type for setting btrfs subvolume attributes (i.e. rw/ro)
- tmpfiles: add new line type for setting fcaps
- add new line type for moving files from some source dir to some
target dir. then use that to move sysexts/confexts and stuff from initrd
tmpfs to /run/, so that host can pick things up.
- allow conditionalizing on factory reset boot, or on first boot.
- when cleaning up directories, take care of btrfs subvolumes too
(ID 927 gen 217573 top level 256 path var/tmp/.#test-btrfs4e8ef947c1122031
ID 928 gen 217573 top level 927 path var/tmp/.#test-btrfs4e8ef947c1122031/rec
ID 929 gen 217574 top level 928 path var/tmp/.#test-btrfs4e8ef947c1122031/rec/sv2
ID 930 gen 217575 top level 928 path var/tmp/.#test-btrfs4e8ef947c1122031/rec/sv3
ID 931 gen 217576 top level 930 path var/tmp/.#test-btrfs4e8ef947c1122031/rec/sv3/sub
ID 932 gen 217577 top level 928 path var/tmp/.#test-btrfs4e8ef947c1122031/rec/dir/sv4
ID 933 gen 217578 top level 932 path var/tmp/.#test-btrfs4e8ef947c1122031/rec/dir/sv4/dir/sv5)
- To mimic the new tpm2-measure-pcr= crypttab option and tpm2-measure-nvpcr=
veritytab option, add the same to integritytab (measuring the HMAC key if one
is used)
- tpm2-setup: reboot if we detect SRK changed
- tpm2: add (optional) support for generating a local signing key from PCR 15
state. use private key part to sign PCR 7+14 policies. stash signatures for
expected PCR7+14 policies in EFI var. use public key part in disk encryption.
generate new sigs whenever db/dbx/mok/mokx gets updated. that way we can
securely bind against SecureBoot/shim state, without having to renroll
everything on each update (but we still have to generate one sig on each
update, but that should be robust/idempotent). needs rollback protection, as
usual.
- TPM2: auto-reenroll in cryptsetup, as fallback for hosed firmware upgrades
and such
- track the per-service PAM process properly (i.e. as an additional control
process), so that it may be queried on the bus and everything.
- transient units: don't bother with actually setting unit properties, we
reload the unit file anyway
- **transient units:**
- add field to transient units that indicate whether systemd or somebody else saves/restores its settings, for integration with libvirt
- Turn systemd-networkd-wait-online into a small varlink service that people
can talk to and specify exactly what to wait for via a method call, and get a
response back once that level of "online" is reached.
- tweak journald context caching. In addition to caching per-process attributes
keyed by PID, cache per-cgroup attributes (i.e. the various xattrs we read)
keyed by cgroup path, and guarded by ctime changes. This should provide us
with a nice speed-up on services that have many processes running in the same
cgroup.
- tweak sd-event's child watching: keep a prioq of children to watch and use
waitid() only on the children with the highest priority until one is waitable
and ignore all lower-prio ones from that point on
- **udev-link-config:**
- Make sure ID_PATH is always exported and complete for
network devices where possible, so we can safely rely
on Path= matching
- **udev:**
- move to LGPL
- kill scsi_id
- add trigger --subsystem-match=usb/usb_device device
- reimport udev db after MOVE events for devices without dev_t
- re-enable ProtectClock= once only cgroupsv2 is supported.
See f562abe2963bad241d34e0b308e48cf114672c84.
- udevd: extend memory pressure logic: also kill any idle worker processes
- unify how blockdev_get_root() and sysupdate find the default root block device
- **unify on openssl:**
- figure out what to do about libmicrohttpd:
- 1.x is stable and has a hard dependency on gnutls
- 2.x is in development and has openssl support
- Worth testing against 2.x in our CI?
- port fsprg over to openssl
- **unit files:**
- allow port=0 in .socket units
- maybe introduce ExecRestartPre=
- implement Register= switch in .socket units to enable registration
in Avahi, RPC and other socket registration services.
- allow Type=simple with PIDFile=
https://bugzilla.redhat.com/show_bug.cgi?id=723942
- allow writing multiple conditions in unit files on one line
- add a concept of RemainAfterExit= to scope units
- Allow multiple ExecStart= for all Type= settings, so that we can cover rescue.service nicely
- add verification of [Install] section to systemd-analyze verify
- **unit install:**
- "systemctl mask" should find all names by which a unit is accessible
(i.e. by scanning for symlinks to it) and link them all to /dev/null
- update HACKING.md to suggest developing systemd with the ideas from:
https://0pointer.net/blog/testing-my-system-code-in-usr-without-modifying-usr.html
https://0pointer.net/blog/running-an-container-off-the-host-usr.html
- use name_to_handle_at() with AT_HANDLE_FID instead of .st_ino (inode
number) for identifying inodes, for example in copy.c when finding hard
links, or loop-util.c for tracking backing files, and other places.
- use sd-event ratelimit feature optionally for journal stream clients that log
too much
- userdb: allow existence checks
- userdb: when synthesizing NSS records, pick "best" password from defined
passwords, not just the first. i.e. if there are multiple defined, prefer
unlocked over locked and prefer non-empty over empty.
- userdbd: implement an additional varlink service socket that provides the
host user db in restricted form, then allow this to be bind mounted into
sandboxed environments that want the host database in minimal form. All
records would be stripped of all meta info, except the basic UID/name
info. Then use this in portabled environments that do not use PrivateUsers=1.
- validatefs: validate more things: check if image id + os id of initrd match
target mount, so that we refuse early any attempts to boot into different
images with the wrong kernels. check min/max kernel version too. all encoded
via xattrs in the target fs.
- Varlinkification of the following command line tools, to open them up to
other programs via IPC:
- coredumpctl
- systemd-bless-boot
- systemd-measure
- systemd-dissect
- systemd-sysupdate
- systemd-analyze
- kernel-install
- systemd-mount (with PK so that desktop environments could use it to mount disks)
- verify that the AF_UNIX sockets of a service in the fs still exist
when we start a service in order to avoid confusion when a user
assumes starting a service is enough to make it accessible
- vmspawn switch default swtpm PCR bank to SHA384-only (away from SHA256), at
least on 64bit archs, simply because SHA384 is typically double the hashing
speed than SHA256 on 64bit archs (since based on 64bit words unlike SHA256
which uses 32bit words).
- **vmspawn:**
- --ephemeral support
- --read-only support
- automatically suspend/resume the VM if the host suspends. Use logind
suspend inhibitor to implement this. request clean suspend by generating
suspend key presses.
- support for "real" networking via "-n" and --network-bridge=
- translate SIGTERM to clean ACPI shutdown event
- implement hotkeys ^]^]r and ^]^]p like nspawn
- **vmspawn disk hotplug:**
- virtio-blk-pci — the simplest path. Each disk is an independent PCI
device. QMP sequence (two steps):
blockdev-add {driver: "raw", node-name: "disk1",
file: {driver: "file", filename: "/path/to/img"}}
device_add {driver: "virtio-blk-pci", id: "disk1", drive: "disk1"}
Removal (three steps):
device_del {id: "disk1"}
... wait for DEVICE_DELETED event (guest acknowledges unplug) ...
blockdev-del {node-name: "disk1"}
Works on both i440fx (legacy PCI) and q35 (PCIe) machine types. PCI
address auto-assigned by QEMU — no topology pre-configuration needed.
Each disk independently hotpluggable. Guest sees a virtio block
device (/dev/vdX). Well-tested path — used by libvirt, Incus, and all
major VM managers. No special boot-time setup required.
- NVMe — two-level model: controller + namespace(s). The controller is
a PCIe device; namespaces live on an internal NVMe bus attached to
the controller. Key limitation: namespaces are NOT hotpluggable —
TYPE_NVME_BUS has no HotplugHandler, so device_add of nvme-ns at
runtime fails with "Bus does not support hotplugging". The only
option is hotplugging the entire controller, which embeds one
namespace via its "drive" property:
blockdev-add {driver: "raw", node-name: "disk1",
file: {driver: "file", filename: "/path/to/img"}}
device_add {driver: "nvme", id: "disk1", drive: "disk1", serial: "disk1"}
Same two-step pattern as virtio-blk, with these limitations:
1. PCIe-only (implements INTERFACE_PCIE_DEVICE). Does not work on
i440fx. Requires q35 or virt (aarch64).
2. Requires pre-configured PCIe root ports that exist at boot.
Without them, device_add fails with "no slot/function available".
vmspawn would need to create empty root ports at QEMU startup to
reserve hotplug slots.
3. No namespace-level granularity. Each hotplugged disk burns a full
PCIe slot (controller + one namespace). Cannot add multiple
namespaces to a single controller at runtime.
4. Serial property required (up to 20 chars). virtio-blk does not
require it.
- virtio-scsi — shared virtio-scsi-pci controller with individual
scsi-hd devices attached. Incus uses this as its default bus. The
controller must exist at boot, but individual disks (LUNs) can be
hotplugged onto it without burning PCI slots. Scales better than
virtio-blk when many disks are needed, but adds complexity
(controller management, LUN assignment).
- **vmspawn AcquireQMP():** implement as id-rewriting proxy with FD
passing. vmspawn acts as a QMP multiplexer. When a client calls
AcquireQMP():
1. Create socketpair(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0).
2. Return one end to the client via sd_varlink_push_fd() +
sd_varlink_reply().
3. Add an sd-event I/O source on vmspawn's end for the client socket.
4. Send a synthetic QMP greeting on the client socket, handle
qmp_capabilities locally. Maybe we don't even need that and just
document that it's a fully initialized connection.
5. For client commands: read from the client socket, rewrite id to
vmspawn's internal counter (store mapping internal_id ->
(client_fd, original_id_json_variant)), forward to QEMU.
6. For QEMU responses: match internal id, look up original client id,
rewrite back, send to the correct client socket.
7. Broadcast QMP events (no id) to all AcquireQMP clients AND to
SubscribeEvents subscribers.
8. On client EOF: remove the I/O source, clean up id mappings.
This keeps vmspawn in full control of the QMP connection — VMControl
handlers and multiple AcquireQMP clients can coexist without id
collisions. The server needs SD_VARLINK_SERVER_ALLOW_FD_PASSING_OUTPUT
(already set in machined's pattern).
AcquireQMP() also requires server-side Varlink protocol upgrades.
mvo's WIP branch:
<https://github.com/systemd/systemd/compare/main...mvo5:varlink-protocol-upgrade-server-side?expand=1>
- we probably needs .pcrpkeyrd or so as additional PE section in UKIs,
which contains a separate public key for PCR values that only apply in the
initrd, i.e. in the boot phase "enter-initrd". Then, consumers in userspace
can easily bind resources to just the initrd. Similar, maybe one more for
"enter-initrd:leave-initrd" for resources that shall be accessible only
before unprivileged user code is allowed. (we only need this for .pcrpkey,
not for .pcrsig, since the latter is a list of signatures anyway). With that,
when you enroll a LUKS volume or similar, pick either the .pcrkey (for
coverage through all phases of the boot, but excluding shutdown), the
.pcrpkeyrd (for coverage in the initrd only) and .pcrpkeybt (for coverage