1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-18 10:04:04 +03:00

9193 Commits

Author SHA1 Message Date
Lennart Poettering
390dffb862 man: also fix documentation of start-limit-hit 2025-01-15 10:42:10 +01:00
Jeremy Linton
2572bf6a39 confidential-virt: add detection for aarch64 CCA
The arm confidential compute architecture (CCA) provides a platform design for
confidential VMs running in a new realm context.

This can be detected by the existence of a platform device exported for the
arm-cca-guest driver, which provides attestation services via the realm
services interface (RSI) to the Realm Management Monitor (RMM).

Like the other methods systemd uses to detect Confidential VM's, checking
the sysfs entry suggests that this is a confidential VM and should only be
used for informative purposes, or to trigger further attestation.

Like the s390 detection logic, the sysfs path being checked is not labeled
as ABI, and may change in the future. It was chosen because its
directly tied to the kernel's detection of the realm service interface rather
to the Trusted Security Module (TSM) which is what is being triggered by the
device entry. The TSM module has a provider string of 'arm-cca-guest' which
could also be used, but that (IMHO) doesn't currently provide any additional
benefit except that it can fail of the module isn't loaded.

More information can be found here:
https://developer.arm.com/documentation/den0125/0300

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
2025-01-15 13:51:12 +09:00
Daan De Meyer
bbe9e03f80 man: Clarify systemd-notify and sd_notify() PID documentation
Let's clarify more explicitly that privileged calls to
systemd-notify --pid= and sd_pid_notify() effectively override any
configured NotifyAccess=main|exec for a service.
2025-01-14 21:07:06 +00:00
Sea-Eun Lee
015a3b8cb1 oomd: support reloading configuration at runtime 2025-01-14 14:42:23 +01:00
Daan De Meyer
6309efbf31 dissect: Use COPY_MERGE
When copying a directory from or to an image, let's always merge
with existing directories instead of failing with "File Exists".

Fixes https://github.com/systemd/mkosi/issues/3342.
2025-01-14 11:13:25 +01:00
Zbigniew Jędrzejewski-Szmek
ad7e0fdbf9
Extend elf package metadata to pe/coff files (#35681) 2025-01-11 13:12:39 +01:00
Lennart Poettering
fa8b70f2c8
userdb: define new 64K "foreign UID" range (#35932)
This is establish the basic concepts for #35685, in the hope to get this
merged first.

This defines a special, fixed 64K UID range that is supposed to be used
by directory container images on disk, that is mapped to a dynamic UID
range at runtime (via idmapped mounts).

This enables a world where each container can run with a dynamic UID
range, but this in no way leaks onto the disk, thus making supposedly
dynamic, transient UID range assignments persistent.

This is infrastructure later used for the primary part of #35685: unpriv
container execution with directory images inside user's home dirs, that
are assigned to this special "foreign UID range".

This PR only defines the ranges, synthesizes NSS records for them via
userdb, and then exposes them in a new "systemd-dissect --shift" command
that can re-chown a container directory tree into this range (and in
fact any range).

This comes with docs. But no tests. There are tests in #35685 that cover
all this, but they are more comprehensive and also test nspawn's hook-up
with this, hence are excluded from this PR.
2025-01-10 13:49:11 +01:00
Lennart Poettering
c0041cd8f1
pam: add session class "none" to disable logind sessions (#35171)
pam_systemd is used to create logind sessions and to apply extended
attributes from json user records. Not every application that creates a
pam session expects a login scope, but may be interested in the extended
attributes of json user records. Session class "none" implements this
service by disabling logind for this session altogether.

---

Closes: #34988
2025-01-09 14:08:06 +01:00
Lennart Poettering
5ae3172867
hwids: add a new efi firmware type of device entry (#35747)
This change adds a new firmware type device entry for the .hwids
section.
It also adds compile time validations and appropriate unit tests for
them.
chid_match() and related helpers have been updated accordingly.

Duplicate of https://github.com/systemd/systemd/pull/35281
Last review feedback's from this above PR has been incorporated and
merged.

@anonymix007
2025-01-08 22:31:48 +01:00
Lennart Poettering
55e4946f9c dissect: add new --shift command 2025-01-08 21:54:19 +01:00
Lennart Poettering
44eb6b81db userdb: synthesize stub user records for the foreign UID 2025-01-08 21:41:03 +01:00
Lennart Poettering
b253555d6b
udev/net: add three settings for ethtool features (#35906)
Closes #31415.
Closes #32979.
2025-01-08 21:37:21 +01:00
Yu Watanabe
844295b2bb udev/net: add PartialGenericSegmentationOffload= setting
Closes #32979.
2025-01-09 03:49:29 +09:00
Yu Watanabe
ac24d356fe udev/net: add ReceiveFCS= and ReceiveAll= settings
Closes #31415.
2025-01-09 03:49:29 +09:00
Lennart Poettering
94634b4b03 pid1: add D-Bus API for removing delegated subcgroups
When running unprivileged containers, we run into a scenario where an
unpriv owned cgroup has a subcgroup delegated to another user (i.e. the
container's own UIDs). When the owner of that cgroup dies without
cleaning it up then the unpriv service manager might encounter a cgroup
it cannot delete anymore.

Let's address that: let's expose a method call on the service manager
(primarly in PID1) that can be used to delete a subcgroup of a unit one
owns. This would then allow the unpriv service manager to ask the priv
service manager to get rid of such a cgroup.

This commit only adds the method call, the next commit then adds the
code that makes use of this.
2025-01-08 15:27:25 +01:00
Yu Watanabe
2bc733d9b0 units: introduce systemd-udevd-varlink.socket
Co-authored-by: David Tardon <dtardon@redhat.com>
2025-01-07 20:31:15 +09:00
Ani Sinha
5d0ac3528b hwids: add a new uefi firmware type of device entry
This change adds a new uefi firmware type device entry for the .hwids section.
It also adds necessary changes for ukify.py.
2025-01-05 09:40:05 +05:30
Daan De Meyer
276890d629 ptyfwd: Add --read-only option 2025-01-03 21:14:47 +01:00
Daan De Meyer
d0d647e084
Introduce systemd-pty-forward (#35761)
This allows running a command with tinted terminal background.
2025-01-03 19:34:42 +01:00
Daan De Meyer
8224a48da9 Introduce systemd-pty-forward
This allows running a command with tinted terminal background.
2025-01-03 17:07:33 +01:00
Lennart Poettering
41c2a5b0b9 dissect: show all kinds of images in --discover
Given that systemd-dissect can nowadays operate on plain directories,
let's include directory images in the --discover output too.

Replace the filter with a filter for hidden images instead, as suddenly
the root fs image (which is a directory image ".host") otherwise shows up.
2025-01-03 10:12:23 +01:00
Lennart Poettering
36d2096b84
debug-generator: rework from post-merge review #35410 (#35696)
- https://github.com/systemd/systemd/pull/35410#discussion_r1893664993
- https://github.com/systemd/systemd/pull/35410#discussion_r1893667581
2025-01-03 09:34:50 +01:00
Ronan Pigott
90ee2c59cc pam: add session class "none" to disable logind sessions
pam_systemd is used to create logind sessions and to apply extended
attributes from json user records. Not every application that creates a
pam session expects a login scope, but may be interested in the extended
attributes of json user records. Session class "none" implements this
service by disabling logind for this session altogether.
2025-01-02 20:18:15 -07:00
Antonio Alvarez Feijoo
e6922ac334
man/debug-generator: replace "main system" with "host" 2025-01-02 14:59:00 +01:00
Yu Watanabe
7bbe9ad796 network: introduce system wide default setting for DHCPv4 client ID
Typically, the same client identifier setting is used for all
interfaces. Hence, better to provide the system-wide setting to specify
the client identifier.
2024-12-30 10:27:39 +09:00
Yu Watanabe
f1dbc4f8cc man/networkd.conf: update section explanation
These section contains not only DUID related settings.

Follow-up for 418f2dc75564330d4ff6c86193f4a3c8ffbb1f1b.
2024-12-30 10:15:52 +09:00
cvlc12
2cc58b6c8a man: change "secureboot-private-key.pem" filename for consistency 2024-12-30 09:14:29 +09:00
Michal Sekletar
f1a0f311e6 man: adjust description of PrivateUsers= so it is in line with reality
When the option is not available unit will not even start so there is
no security risk.

Fixes #34983
2024-12-29 14:38:00 +09:00
Jan Engelhardt
19740d330a man: grammar fixes for userdbctl(1) 2024-12-25 17:24:39 +01:00
Jan Engelhardt
84d3266de1 man: grammar fixes for varlinkctl(1)
Fix some missing commas, missing conjunction words, wrong
inflections, and trim excess parenthesizing.
2024-12-25 17:24:39 +01:00
Jan Engelhardt
c592ebdf4f man: grammar fixes for introductory adverbs/phrases 2024-12-25 17:24:38 +01:00
Jan Engelhardt
44855c77a1 man: expand word contractions
For written text, contractions are not normally used.
2024-12-25 17:00:31 +01:00
Jan Engelhardt
82ea392a99 man: grammar fixes for "regardless" 2024-12-25 17:00:31 +01:00
Jan Engelhardt
91dc2a52f5 man: grammar fixes: replace "respectively"
Unlike the German "bzw.", "respectively" cannot be used as an infix,
and is not abbreviated either.
2024-12-25 17:00:26 +01:00
Lennart Poettering
ccaa76ac48
image-discovery: add per-user scope (#35510) 2024-12-20 22:12:35 +01:00
Lennart Poettering
1c0ade2e1f discover-image: introduce per-user image directories
We nowadays support unprivileged invocation of systemd-nspawn +
systemd-vmspawn, but there was no support for discovering suitable disk
images (i.e. no per-user counterpart of /var/lib/machines). Add this
now, and hook it up everywhere.

Instead of hardcoding machined's, importd's, portabled's, sysupdated's
image discovery to RUNTIME_SCOPE_SYSTEM I introduced a field that make
the scope variable, even if this field is always initialized to
RUNTIME_SCOPE_SYSTEM for now. I think these four services should
eventually be updated to support a per-user concept too, this is
preparation for that, even though it doesn't outright add support for
this.

This is for the largest part not user visible, except for in nspawn,
vmspawn and the dissect tool. For the latter I added a pair of
--user/--system switches to select the discovery scope.
2024-12-20 18:04:01 +01:00
Lennart Poettering
4103bf9f2f man: document the new per-use credstore paths
(And some other minor tweaks)
2024-12-20 17:52:07 +01:00
Antonio Alvarez Feijoo
e9f781a5a4
debug-generator: add a kernel cmdline option to pause the boot process
Introduce the `systemd.break=` kernel command line option to allow stopping the
boot process at a certain point and spawn a debug shell. After exiting this
shell, the system will resume booting.

It accepts the following values:
- `pre-udev`: before starting to process kernel uevents (initrd and host).
- `pre-basic`: before leaving early boot and regular services start (initrd and
host).
- `pre-mount`: before the root filesystem is mounted (initrd).
- `pre-switch-root`: before switching root (initrd).
2024-12-20 08:51:23 +01:00
Antonio Alvarez Feijoo
cb3801a4c9
man/debug-generator: add a section for kernel command line options 2024-12-20 08:48:23 +01:00
Yu Watanabe
5e837858e7
analyze: add "chid" verb to display CHIDs of the local system (#35175)
We already have the code for it, expose it in systemd-analyze, because
it's useful.
2024-12-20 11:47:03 +09:00
Zbigniew Jędrzejewski-Szmek
06a73d1fb6 man: update package metadata link and details
The variable names are actually "name" and "version". Not sure why the
man page had something different.
2024-12-19 15:38:56 +01:00
Matthias Lisin
6e3f32cc56
man/sysupdate.features: fix typos 2024-12-19 12:39:32 +01:00
Matthias Lisin
f441831c9e
man/sysupdate.d: fix wrong PathRelativeTo value 2024-12-19 12:39:31 +01:00
Matthias Lisin
4bc06da775
man: fix args order for udevadm info cmd 2024-12-19 12:39:31 +01:00
Lennart Poettering
8f114904fc analyze: add verb for showing system's CHIDs
We have the code already, expose it in systemd-analyze too.

This should make it easier to debug the CHID use in the UKIs with
onboard tooling.
2024-12-18 17:38:42 +01:00
Daan De Meyer
a48803fd84 man: Document generator sandbox environment 2024-12-19 00:36:52 +09:00
Lennart Poettering
7a8556b901
confext/sysext: add initrd-specific units (#35426)
In the rootfs these need to run after /var/lib/ has been set up. In the
initrd we want them to run as soon as possible so that they can be used
to customize setting up the rootfs.
2024-12-18 10:33:38 +01:00
Lennart Poettering
00a415fc8f tree-wide: remove support for kernels lacking ambient caps
Let's bump the kernel baseline a bit to 4.3 and thus require ambient
caps.

This allows us to remove support for a variety of special casing, most
importantly the ExecStart=!! hack.
2024-12-17 17:34:46 +01:00
Yu Watanabe
e76fcd0e40 core: make ProtectHostname= optionally take a hostname
Closes #35623.
2024-12-16 23:55:44 +09:00
Federico Giovanardi
7fd45eec37 udev: add option to trigger parent devices despite filters
This commit add the `-i` option to `udevadm trigger` that force it to
match parent devices even if they're excluded from filters.
The rationale is that some embedded devices have a huge number of
platform devices ( ~ 4k for MX8 ) they are there because they're defined
in the device tree but there isn't any action or udev rules associated
with them.

So at boot a significant time is spend triggering and processing rules
for devices that don't produce any effect and we would like to filter
them by calling:

```
udevadm trigger --type=device --action=add -s block -s tty
```

instead of the normal

```
udevadm trigger --type=device --action=add
```

so we can use filter to filter out only subsystems for we we know that
we have rules in place that do something useful.

On the other side action / rules are not triggered until the parent is
triggered ( which is part of another subsystem), so the additional option
will allows udev to complete the coldplug with only the devices we care.

Example on iMX8:

.Without the new option
```
root@dev:~# udevadm trigger --dry-run  -s block --action=add -v
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0boot0
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0boot1
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p1
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p2
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p3
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p4
```

.With the new option
```
root@dev:~# udevadm trigger --dry-run -i -s block --action=add -v
/sys/devices/platform
/sys/devices/platform/bus@5b000000
/sys/devices/platform/bus@5b000000/5b010000.mmc
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0boot0
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0boot1
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p1
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p2
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p3
/sys/devices/platform/bus@5b000000/5b010000.mmc/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p4
```
Boot time reduction with this is place is ~ 1 second.
2024-12-16 15:43:52 +01:00