Commit Graph
91545 Commits
Author SHA1 Message Date
Luca Boccassi 72f3a4a73c NEWS: update up to 9064524e44 2026-09-01 11:42:23 +02:00
Luca Boccassi 7021a61392 hwdb: update autosuspend rules 2026-09-01 11:42:23 +02:00
Luca Boccassi 862b093df2 hwdb: update rules 2026-09-01 11:42:23 +02:00
RamsesandYu Watanabe 3da5c65d87 network: register already enslaved interfaces when their master appears (#43557)
When networkd starts or restarts, links are enumerated in ifindex
order. A slave enumerated before its master cannot register itself in
link_append_to_master(), as the master Link object does not exist yet.
The master then wrongly believes it has no slaves until the next
RTM_NEWLINK message for the slave arrives.

The stale slaves set affects operational state propagation
(degraded-carrier detection) and any code that inspects the slaves of
a master.
For instance, on restart, when networkd thinks that the master has no
slaves yet, we try to set the bond fail-over policy, which the kernel
then refuses because in reality the bond does have slaves.

To fix the issue, this updates the list of slaves after enumeration.

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
2026-09-01 18:28:43 +09:00
Andres Diaz f396adf4e9 hwdb: do not tag the G502 X Lightspeed macro interface as a keyboard
Its full keyboard descriptor gets it ID_INPUT_KEYBOARD, which makes
UPower show the mouse battery as a keyboard.
2026-09-01 10:02:33 +01:00
Christian Brauner 9b62fd169e Extend W^X memory protection mechanism for RestrictFileSystemAccess (#43511)
Currently `RestrictFileSystemAccess` isn't trying hard enough to enforce
W^X and thus there are still places where an executable and writable
mapping can be created:

* `/proc/<pid>/mem` `FOLL_FORCE` writes
* `PTRACE_POKE{TEXT,DATA}` `FOLL_FORCE` writes
* `MAP_PRIVATE | MAP_EXECUTABLE` memory mappings

Let's block all of these mechanisms. Do note that
`RestrictFileSystemAccess` is still in very active development and also
cannot meaningfully be used on general purpose distros and systems.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-09-01 07:12:13 +02:00
Yu Watanabe d0fcc5a9ec core: Don't racily stop Type=dbus services when the bus broker restarts (#42455) 2026-09-01 09:24:48 +09:00
Christian Brauner 3674263071 test-bpf-restrict-fsaccess: add W^X and ptrace protection tests
Add tests for all new W^X protection mechanisms.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-08-31 23:33:40 +02:00
Christian Brauner e0be975735 man: document RestrictFileSystemAccess= W^X hardening
Describe the system-wide W^X rule and the new proc_mem.force_override=never
and seccomp prerequisites, and drop the advice to block writable and
executable mappings by other means, which the policy now does itself.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-08-31 23:33:40 +02:00
Christian Brauner 62e665cacc core: check that proc_mem.force_override=never is active
The kernel silently ignores command line options it doesn't know. So a
kernel without CONFIG_PROC_MEM_* would pass the command line check while
still allowing FOLL_FORCE memory overwrites. Write one byte through
/proc/self/mem into a private read-only anonymous page. That can only
succeed with FOLL_FORCE writes supported.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-08-31 23:33:40 +02:00
Christian Brauner 0016132c3c core: block /proc/pid/mem FOLL_FORCE writes when RestrictFileSystemAccess= is enabled
In addition to PTRACE_POKE{TEXT,DATA} /proc/<pid>/mem can also be used
to FOLL_FORCE write into a trusted process's executable pages. Require
proc_mem.force_override=never.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-08-31 23:33:40 +02:00
Christian Brauner 4f4502ed23 core: block PTRACE_POKE{TEXT,DATA} when RestrictFileSystemAccess= is enabled
PTRACE_POKETEXT and PTRACE_POKEDATA use FOLL_FORCE to forcibly write
into a tracee's memory. That includes executable read-only pages. If we
restrict execution to trusted binaries PID 1 must enforce that it's
impossible to abuse this to get untrusted code execution. Note, that
usermodehelpers are not subject to PID 1's seccomp filters.

Install a ptrace seccomp filter from PID 1 if RestrictFileSystemAccess=
is requested. Every process it spawns will inherit it.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-08-31 23:33:40 +02:00
Christian Brauner 179781353a test-seccomp: seccomp_restrict_ptrace()
Test seccomp_restrict_ptrace().

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-08-31 23:33:40 +02:00
Christian Brauner 76d0ec8b97 shared/seccomp: add seccomp_restrict_ptrace()
PTRACE_POKETEXT and PTRACE_POKEDATA use FOLL_FORCE to forcibly write
into a tracee's memory. That includes executable read-only pages. If we
restrict execution to trusted binaries PID 1 must enforce that it's
impossible to abuse this to get untrusted code execution. Note, that
usermodehelpers are not subject to PID 1's seccomp filters.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-08-31 23:33:40 +02:00
Christian Brauner 9bb5d21c15 bpf-restrict-fsaccess: enforce W^X on file mappings
Right now RestrictFileSystemAccess= checks that a file comes from a
trusted dm-verity device, but it doesn't guard against mapping that file
and making use of COW modifications. So a MAP_PRIVATE mapping of a
trusted binary can be made writable, modified, and executed, while the
vma still points to the trusted file and the pages are
attacker-controlled anonymous copies.

Enforce W^X: deny any mapping that is writable and executable at once,
and refuse to make a private file mapping executable once it has been
modified through copy-on-write.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-08-31 23:33:40 +02:00
Christian Brauner 73e093d16d core: centralize RestrictFileSystemAccess= checks
Centralize the checks for RestrictFileSystemAccess= requirements.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-08-31 23:33:39 +02:00
Christian Brauner c35f061634 test-bpf-restrict-fsaccess: differentiate between a denial and an unrunnable probe
Make sure the tests can tell the difference between an actual denial and
a probe that simply cannot be run.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-08-31 23:33:39 +02:00
Chris Down df3c9c9ef0 test: Add a test for Type=dbus services surviving a broker restart 2026-09-01 03:03:46 +09:00
Chris Down fdf0876bc7 core: Don't racily stop Type=dbus services when the bus broker restarts
If dbus dies, it is then immediately reactivated by dbus.socket as soon
as a client reconnects. In that case pid1's own connection to the bus
drops and is reestablished by manager_recheck_dbus() (which comes from
the unit_notify() when dbus.services goes back to being running).

As part of bringing the bus back up, bus_setup_api() issues
GetNameOwner() for every name we watch on behalf of a BusName= unit.

For a Type=dbus service this is a problem. Consider this scenario:

1. spearmint.service is Type=dbus, owns com.example.Spearmint, and is
   running.
2. The broker crashes and is re-activated through dbus.socket.
3. spearmint's client connection dropped too, so it is now reconnecting
   to the new broker to grab its name again.
4. pid1 racily reconnects first given it is triggered the moment
   dbus.service reaches SERVICE_RUNNING, whereas spearmint is an
   ordinary client that must first notice its own disconnection and thus
   when we do GetNameOwner() com.example.Spearmint is reported as having
   no owner.
5. service_bus_name_owner_change() sets bus_name_good = false, and since
   service_good() returns false for a Type=dbus service without its
   name, service_enter_running() stops the (perfectly healthy, other
   than dbus kicking the bucket temporarily) service.

In other words, a broker restart can tear down running Type=dbus
services that did nothing wrong, really.

So, to fix this, we can use the fact that a NameOwnerChanged signal is
definitive. That is, the name's owner changed while we were connected,
so a service that crashes or drops its name can still be stopped
immediately. By contrast a GetNameOwner() reply is less authoritative.

There is, importantly, no change to how losing the name on a live
connection works, we only give grace on reconnect.
2026-09-01 02:12:52 +09:00
Chris Down 00cf56abbd core: Add SERVICE_RUNNING_REVALIDATING state
For a Type=dbus service we sometimes want to keep treating it as running
while its bus name has briefly gone away (for example, due to a broker
restart).

SERVICE_RUNNING_REVALIDATING is active and keeps its main process like
SERVICE_RUNNING, but it's deliberately not part of the runtime timer
set, so RuntimeMaxSec= is paused while we sit in it.
2026-09-01 02:12:52 +09:00
Yu WatanabeandSiteshwar Vashisht 9064524e44 ndisc: fix a memory leak in ndisc_option_parse_encrypted_dns()
Newly allocated new_res variable was left unreferenced if memory
allocation failed in ndisc_option_add_encrypted_dns_internal().

Co-authored-by: Siteshwar Vashisht <svashisht@redhat.com>
2026-09-01 01:00:15 +09:00
Yu Watanabe dee2ea17c7 Update Linux kernel headers from v7.3-rc1 (#43573) 2026-09-01 00:59:36 +09:00
Luca Boccassi 1085a93b9d Various zsh completion fixes (#43584) 2026-08-31 16:58:24 +01:00
Luca Boccassi b27a47207c core: minor PAM fixes (#43576)
Fixes: #39617
2026-08-31 16:57:19 +01:00
Jelle van der Waa ed9ce3f4f6 zsh: Add missing loginctl completion options 2026-08-31 17:43:17 +02:00
Jelle van der Waa ebab4a2486 zsh: Correct json output description for busctl 2026-08-31 17:43:15 +02:00
Christian Brauner 1783f8c3de keyring-util: pass the buffer size to KEYCTL_DESCRIBE
While keyring_describe() allocates a 64 byte buffer it still passes the
value of c as the buffer length. It's -1 on the first iteration. So
keyctl_describe_key() copies the whole description whenever buflen >=
its length. So any key whose description exceeding 64 bytes overflows.
Pass the actual buffer size.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>

[zjs: adjust comment]
2026-08-31 17:24:29 +02:00
Jelle van der Waa b732d737ef zsh: Add --inline completion for systemd-tpmfiles 2026-08-31 17:02:29 +02:00
Jelle van der Waa ff7dd5edd8 zsh: Add missing --kernel-cmdline option in systemctl 2026-08-31 16:43:44 +02:00
Jelle van der Waa b457868e0c zsh: Add missing --tmp2-public-key-policyref 2026-08-31 16:43:44 +02:00
Luca Boccassi 164eff47a7 Add missing -n shorthand for --dry-run in shell completion (#43581) 2026-08-31 15:17:39 +01:00
Fabian Vogt 10913c02a4 Typo fix: "tempered" -> "tampered" 2026-08-31 16:01:41 +02:00
Jelle van der Waa 12217e71a2 zsh: Add missing -n shorthand for --dry-run
Both already an option in udevadm and systemd-tmpfiles.
2026-08-31 15:52:42 +02:00
Jelle van der Waa 55ed2ee63e shell-completion: Add -n option for bootctl
Introduced in f5ffb38606
2026-08-31 15:24:30 +02:00
Yu Watanabe 69c8578c17 test: use linux/magic.h from our tree
We copy linux/magic.h from the kernel source tree and use it when
building systemd. Let's also make the kernel-filesystem-magics test
use the copy in our tree rather than the one installed on the system.

To achieve that now the 'check' command takes both 'cpp' and
'system_include_args' from meson.
2026-08-31 21:17:30 +09:00
Yu Watanabe 8220fcf4fe filesystem: correctly recognize failfs
The kernel v7.3-rc1 introduces failfs:
https://github.com/torvalds/linux/commit/fa0d6d945e5ce96cff14b114eec7527f13d7f23a
2026-08-31 19:43:10 +09:00
Yu Watanabe 6ce2db8dc2 include: update Linux kernel headers from v7.3-rc1 2026-08-31 19:43:10 +09:00
Konstantin Shkolnyy d1697c4ff8 kmod-setup: support early loading for virtio-ccw devices
Before this change, the code checked for presence of virtio-pci
devices to decide whether transport-agnostic virtio drivers needed
to be loaded early.

Do it also if virtio-ccw devices are present, that is, devices with
the control unit type (CU type) 0x3832, under /sys/devices/css0.
(This CU type value is documented in "Virtio Over Channel I/O" virtio
specification section.)

In other words, extend to virtio-ccw devices the fix previously
done for virtio-pci:
  #40161: commit 356cc4a1c3
  #40503: commit 6d36e5fae6

Tested-by: Marc Hartmayer <marc@linux.ibm.com>
Reviewed-by: Marc Hartmayer <marc@linux.ibm.com>
2026-08-31 19:40:33 +09:00
Lennart Poettering 34e5f14c34 pam: use "pam_rootok" rather than "pam_deny" in the "auth" stacks of our PAM configs
PAM is a bit quirky: the main libpam calls are pam_authenticate(),
pam_open_session(), pam_acctmgmt(), pam_chauthtok(), pam_setcred() and
each have their own PAM "management group" in PAM configuration files
that configure the modules to call: "auth", "account", "session",
"password" – except for pam_setcred() which shares its grpup with
pam_authenticate() and uses "auth".

Both our PAM configuration files we ship by default are never used for
authentication (they just appear in PAMname= in a service to get a PAM
session set up, and PAMName= never calls pam_authenticate()). However,
they end up being used for pam_setcreds() (because some modules want to
use that the service manager calls it).

So far we used the pam_deny module for the "auth" management group for
these two PA; configurations (since
d6aed1dca8) but that's not ideal, since it
means we'll always cause pam_setcreds() to fail which will create debug
log noise (since the service manager debug logs pam_secreds() failures).

Let's switch to pam_rootok for this instead. This has the benefit that
pam_setcred() will always succeed for this, and pam_authenticate() only
if the caller is root anyway.

This is great, because it means our PAM configuration cannot be misused
for other purposes accidentally (authentication will fail, unless you
are already root), but won't result in any log noise (debug or
otherwise).

Follow-up for: d6aed1dca8
Fixes: #39617
2026-08-31 12:06:43 +02:00
Lennart Poettering f5d545ab77 core: fix error code passed to pam_syslog_pam_error() 2026-08-31 12:02:58 +02:00
Siteshwar Vashisht d56d8d43ee ukify: fix cleaning up a temporary file (#43544)
Current code does not hold a reference to object returned from
`tempfile.NamedTemporaryFile()`. This would cause the object to be
immediately garbage collected and the temporary file is deleted. A new
file is created with `linux.write_bytes()` which never gets cleaned up.
Keeping a reference to this object would automatically clean up the
temporary file when `make_uki()` function returns.
2026-08-31 17:18:07 +09:00
Siteshwar Vashisht a6a831d0d9 nsresourced: Fix reading from NULL pointers (#43566)
`TAKE_PTR(userns_name)` sets `userns_name` to `NULL` earlier.

Follow-up for ee6fd7ef82.
2026-08-31 17:10:20 +09:00
cverorg 91927a2a12 Revert "hwdb: add support for PineTab2 to 60-sensor.hwdb (#35304)"
This reverts commit bc4a027f9c.

The match key names the chip, not the machine. `of:N<name>T<type>C<compatible>`
describes the sensor node, and the Pine64 PineNote carries the same silan
sc7a20 mounted in a different orientation, so it presents an identical
modalias:

    $ cat /sys/bus/iio/devices/iio:device2/../modalias
    of:NaccelerometerT(null)Csilan,sc7a20

On a device-tree machine there is no `/sys/class/dmi/id/modalias` to narrow it
with, so 60-sensor.rules looks up `sensor:modalias:of:...:` with the DMI half
empty and both boards land on the one entry. A second, PineNote-scoped entry
cannot be written: it would carry the same match string and simply shadow the
first.

The entry also overrides a correct value. The PineNote's device tree supplies
the matrix and the kernel publishes it:

    $ cat /sys/bus/iio/devices/iio:device2/mount_matrix
    -1, 0, 0; 0, 1, 0; 0, 0, 1

but udev then replaces it with the PineTab2's, and the four orientations
collapse into two, both landscape -- iio-sensor-proxy only ever reports
`normal` and `bottom-up`, so the display never selects portrait.

Where the kernel supplies a mount matrix, hwdb has nothing to add here; where
it does not, a local hwdb entry remains available. Tested on a PineNote v1.2,
kernel 6.12.11, systemd 257.

Closes #43321
2026-08-31 07:18:52 +09:00
Bone NI 6ede84602c po: Translated using Weblate (Lao)
Currently translated at 100.0% (286 of 286 strings)

Co-authored-by: Bone NI <bounkirdni@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/lo/
Translation: systemd/main
2026-08-30 15:35:31 +09:00
Zbigniew Jędrzejewski-Szmek 048970650c List -V option in help and man (#43560) 2026-08-29 10:42:36 +02:00
Yu Watanabe e7e91b9bc1 man: also document -V option for udevd and run0
The option -V has been documented in their help message, but not in the
corresponding man pages.
2026-08-29 07:40:43 +09:00
Yu Watanabe 69a54c37ac options: introduce OPTION_COMMON_VERSION_WITH_V and version_only()
The man page udevadm(8) have explicitly documented that the option -V is
a short form of --version. Let's not hide the short form in the help
message.

This introduces OPTION_COMMON_VERSION_WITH_V then use it in udevadm,
udevd, and run0.

Alos, this moves print_version() to build.c, and renames it to
version_only(). Now the function is also used in udevd amd test-libudev.

With this change, the -V option is hidden only in dmi_memory_id and
scsi_id. So, this removes the OPTION_COMMON_VERSION_WITH_HIDDEN_V macro
and explicitly list the hidden option in their code.
2026-08-29 07:40:35 +09:00
Yu Watanabe 39cf979007 Final batch of conversions to COMMAND and additions of --introspect-cli (#43558) 2026-08-29 04:26:12 +09:00
Zbigniew Jędrzejewski-Szmek 852f193560 shared/format-table: make one more function static 2026-08-28 14:50:10 +02:00
Zbigniew Jędrzejewski-Szmek 52c063713e shared/verbs: drop unused variable
Also add a note that the function does not support multiple groups. I
think that's fair, it doesn't make sense to generalize the functionality
when we're unlikely to ever use that. (Verb options are only used by
udevadm right now.)
2026-08-28 14:50:10 +02:00