]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 days agosd-bus: Don't fork unnecessarily to connect to container 40698/head
Daan De Meyer [Mon, 16 Feb 2026 12:14:58 +0000 (13:14 +0100)] 
sd-bus: Don't fork unnecessarily to connect to container

Let's check if we're already in the right namespaces and call connect()
directly if that's the case. This can easily happen when the machine is
specified as .host or so.

4 days agosd-bus: Make sure we can connect to user machines as well
Daan De Meyer [Mon, 16 Feb 2026 10:27:21 +0000 (11:27 +0100)] 
sd-bus: Make sure we can connect to user machines as well

Don't unconditionally look into /run/systemd/machines. If we're a
connected to a session bus, look at the machines for the current user
instead.

4 days agonamespace-util: Do is_our_namespace() checks first in namespace_enter()
Daan De Meyer [Tue, 17 Feb 2026 14:36:00 +0000 (15:36 +0100)] 
namespace-util: Do is_our_namespace() checks first in namespace_enter()

These checks may rely on /proc on older kernels which we could lose access
to by joining namespaces so let's do all the checks first and then join
namespaces.

4 days agonamespace-util: Add extra debug logging
Daan De Meyer [Tue, 17 Feb 2026 14:35:30 +0000 (15:35 +0100)] 
namespace-util: Add extra debug logging

4 days agocoredump: Use error log level in coredump_send_to_container()
Daan De Meyer [Tue, 17 Feb 2026 14:38:01 +0000 (15:38 +0100)] 
coredump: Use error log level in coredump_send_to_container()

4 days agonspawn: Join network namespace with setns()
Daan De Meyer [Mon, 16 Feb 2026 21:12:34 +0000 (22:12 +0100)] 
nspawn: Join network namespace with setns()

We don't have /proc mounted which means namespace_enter() won't work
on older kernels, so use setns() instead.

4 days agocore: add SetProperties varlink method (#40356)
Zbigniew Jędrzejewski-Szmek [Tue, 17 Feb 2026 09:57:09 +0000 (10:57 +0100)] 
core: add SetProperties varlink method (#40356)

Start with Markers as a property, more can be added in the future as
needed

4 days agoSeveral fixlets for issues found by Coverity (#40707)
Yu Watanabe [Tue, 17 Feb 2026 09:26:46 +0000 (18:26 +0900)] 
Several fixlets for issues found by Coverity (#40707)

4 days agooomd: Fix unnecessary delays during OOM kills with pending kills present
Chris Down [Tue, 17 Feb 2026 06:58:44 +0000 (14:58 +0800)] 
oomd: Fix unnecessary delays during OOM kills with pending kills present

Let's say a user has two services with ManagedOOMMemoryPressure=kill,
perhaps a web server under system.slice and a batch job under
user.slice. Both exceed their pressure limits. On the previous timer
tick, oomd has already queued the web server's candidate for killing,
but the prekill hook has not yet responded, so the kill is still
pending.

In the code, monitor_memory_pressure_contexts_handler() iterates over
all pressure targets that have exceeded their limits. When it reaches
the web server target and calls oomd_cgroup_kill_mark(), which returns 0
because that cgroup is already queued. The code treats this the same as
a successful new kill: it resets the 15 second delay timer and returns
from the function, exiting the loop.

This loop is handled by SET_FOREACH and the iteration order is
hash-dependent. As such, if the web server target happens coincidentally
to be visited first, oomd never evaluates the batch job target at all.

The effect is twofold:

1. oomd stalls for 15 seconds despite not having initiated any new kill.
   That can unnecessarily delay further action to stem increases in
   memory pressure. The delay exists to let stale pressure counters
   settle after a kill, but no kill has happened here.
2. It non-deterministically skips pressure targets that may have
   unqueued candidates, dangerously allowing memory pressure to persist
   for longer than it should.

Fix this by skipping cgroups that are already queued so the loop
proceeds to try other pressure targets. We should only delay when a new
kill mark is actually created.

4 days agooomd: Fix silent failure to find bad cgroups when another cgroup dies
Chris Down [Tue, 17 Feb 2026 06:30:16 +0000 (14:30 +0800)] 
oomd: Fix silent failure to find bad cgroups when another cgroup dies

Consider a workload slice with several sibling cgroups. Imagine that one
of those cgroups is removed between the moment oomd enumerates the
directory and the moment it reads memory.oom.group. This is actually
relatively plausible under the high memory pressure conditions where
oomd is most needed.

In this case, the failed read prompts us to `return 0`, which exits the
entire enumeration loop in recursively_get_cgroup_context(). As a
result, all remaining sibling cgroups are silently dropped from the
candidate list for that monitoring cycle.

The effect is that oomd can fail to identify and kill the actual
offending cgroup, allowing memory pressure to persist until a subsequent
cycle where the race doesn't occur.

Fix this by instead proceeding to evaluate further sibling cgroups.

4 days agooomd: Fix silent, non-deterministic dropped OOM kills
Chris Down [Tue, 17 Feb 2026 05:46:49 +0000 (13:46 +0800)] 
oomd: Fix silent, non-deterministic dropped OOM kills

Let's say a user has two services with ManagedOOMMemoryPressure=kill,
one for a web server under system.slice, and one for a batch job under
user.slice. The batch job is causing severe memory pressure, whereas the
web server's cgroup has no processes with significant pgscan activity.

In the code, monitor_memory_pressure_contexts_handler() iterates over
all pressure targets that have exceeded their limits. When
oomd_select_by_pgscan_rate() returns 0 (that is, no candidates) for a
target, we return from the entire SET_FOREACH loop instead of moving to
the next target. Since SET_FOREACH iteration order is hash-dependent, if
the web server target happens to be visited first, oomd will find no
kill candidates for it and exit the loop. The batch job target that is
actually slamming the machine will never even be evaluated, and can
continue to wreak havoc without any intervention.

The effect is that oomd non-deterministically and silently fails to kill
cgroups that it should actually kill, allowing memory pressure to
persist and dangerously build up on the machine.

The fix is simple, keep evaluating remaining targets when one does not
match.

4 days agonetwork/wwan: fix memleak in failure path 40707/head
Yu Watanabe [Tue, 17 Feb 2026 08:02:05 +0000 (17:02 +0900)] 
network/wwan: fix memleak in failure path

Fixes CID#1645018.

4 days agonetwork/wwan: add missing error check
Yu Watanabe [Tue, 17 Feb 2026 07:50:48 +0000 (16:50 +0900)] 
network/wwan: add missing error check

Fixes CID#1645015.

4 days agosd-bus: use bus_error_message() at several more places
Yu Watanabe [Tue, 17 Feb 2026 07:44:36 +0000 (16:44 +0900)] 
sd-bus: use bus_error_message() at several more places

For CID#1645014, CID#1645016, and CID#1645017.

4 days agobus-polkit: add one more assertion
Yu Watanabe [Tue, 17 Feb 2026 07:39:35 +0000 (16:39 +0900)] 
bus-polkit: add one more assertion

For CID#1645013.

4 days agosocket-util: remove unused {send,receive}_many_fds*()
Mike Yuan [Sun, 15 Jun 2025 19:35:36 +0000 (21:35 +0200)] 
socket-util: remove unused {send,receive}_many_fds*()

These were introduced as part of the effort of sd-executor
worker pool (#29566), which never landed due to unsignificant
performance improvement. Let's just remove the unused
helpers. If that work ever gets resurrected they can be
restored from this commit pretty easily.

4 days agooomd: Fix Killed signal reason being lost (#40689)
Yu Watanabe [Tue, 17 Feb 2026 05:53:46 +0000 (14:53 +0900)] 
oomd: Fix Killed signal reason being lost (#40689)

Emitting "oom" doesn't mesh with the org.freedesktop.oom1.Manager
Killed() API contract, which defines "memory-used" and "memory-pressure"
as possible reasons. Consumers that key off reason thus will either lose
policy attribution or may reject the unknown value completely.

Plumb the reason through so it is visible to consumers.

4 days agooomd: Add regression tests to check Killed notification gives a reason 40689/head
Chris Down [Sun, 15 Feb 2026 16:25:31 +0000 (00:25 +0800)] 
oomd: Add regression tests to check Killed notification gives a reason

4 days agooomd: Fix Killed signal reason being lost
Chris Down [Sun, 15 Feb 2026 17:42:51 +0000 (01:42 +0800)] 
oomd: Fix Killed signal reason being lost

Emitting "oom" doesn't mesh with the org.freedesktop.oom1.Manager
Killed() API contract, which defines "memory-used" and "memory-pressure"
as possible reasons. Consumers that key off reason thus will either lose
policy attribution or may reject the unknown value completely.

Plumb the reason through so it is visible to consumers.

4 days agonspawn-mount: Use setns() in wipe_fully_visible_api_fs()
Daan De Meyer [Mon, 16 Feb 2026 18:59:10 +0000 (19:59 +0100)] 
nspawn-mount: Use setns() in wipe_fully_visible_api_fs()

namespace_enter() now does a is_our_namespace() check, which requires
/proc on older kernels, which is not available anymore after we call
do_wipe_fully_visible_api_fs() in wipe_fully_visible_api_fs().

Let's just call setns() instead as namespace_enter() is overkill to
enter a single namespace anyway.

5 days agoreport: enforce metric prefix (#40647)
Yu Watanabe [Mon, 16 Feb 2026 21:47:50 +0000 (06:47 +0900)] 
report: enforce metric prefix (#40647)

Addressing
> we should enforce that metrics ids begin with the varlink service name

from #40633

5 days agomkosi: Set CacheOnly=metadata for test images (#40699)
Daan De Meyer [Mon, 16 Feb 2026 14:42:35 +0000 (15:42 +0100)] 
mkosi: Set CacheOnly=metadata for test images (#40699)

The default behavior is to sync repository metadata for every image
that does not have a cache and we recently changed behavior to
invalidate
all cached images whenever we decide the repository metadata needs to
be resynced.

In systemd we have two images that are not cached because they use
BaseTrees=
hence set CacheOnly=metadata to explicitly indicate these two images
should never cause a repository metadata if resync even though they are
not cached.

5 days agoreport: validate metric name by socket 40647/head
Ivan Kruglov [Wed, 11 Feb 2026 15:48:58 +0000 (07:48 -0800)] 
report: validate metric name by socket

5 days agomeson: read more progs from PATH
nikstur [Tue, 10 Feb 2026 11:53:40 +0000 (12:53 +0100)] 
meson: read more progs from PATH

Find more progs on PATH instead of hardcoding them.

5 days agomkosi: Set CacheOnly=metadata for test images 40699/head
Daan De Meyer [Mon, 16 Feb 2026 12:28:22 +0000 (13:28 +0100)] 
mkosi: Set CacheOnly=metadata for test images

The default behavior is to sync repository metadata for every image
that does not have a cache and we recently changed behavior to invalidate
all cached images whenever we decide the repository metadata needs to
be resynced.

In systemd we have two images that are not cached because they use BaseTrees=
hence set CacheOnly=metadata to explicitly indicate these two images
should never cause a repository metadata if resync even though they are
not cached.

5 days agomkosi: update mkosi ref to 66d51024b7149f40be4702e84275c936373ace97
Daan De Meyer [Mon, 16 Feb 2026 12:28:13 +0000 (13:28 +0100)] 
mkosi: update mkosi ref to 66d51024b7149f40be4702e84275c936373ace97

66d51024b7 man: Update caching section
4eac60f168 Remove all cached images if repository metadata will be synced
025c6c0150 Move Incremental= to inherited settings in docs
427970d8fd Make MakeScriptsExecutable= a multiversal setting
53bd2da6fe Look at all CacheOnly= settings to determine if we need to sync metadata
114ae558ef config / qemu: add Console=headless

5 days agobacklight: also change clamp percentage on ID_BACKLIGHT_CLAMP/ID_LEDS_CLAMP=yes
Yu Watanabe [Mon, 16 Feb 2026 10:16:35 +0000 (19:16 +0900)] 
backlight: also change clamp percentage on ID_BACKLIGHT_CLAMP/ID_LEDS_CLAMP=yes

Follow-up for 4ed1e2ea17e0f29a23d7a3dd65af192def9b3214.

5 days agonetworkctl: use varlink method to bring up/down interfaces (#40693)
Yu Watanabe [Mon, 16 Feb 2026 11:35:29 +0000 (20:35 +0900)] 
networkctl: use varlink method to bring up/down interfaces (#40693)

Closes #38538.
Closes #40017.

5 days agoask-password-api: several modernizations for ask_password_agent(); use CLEANUP_TMPFIL...
Yu Watanabe [Mon, 16 Feb 2026 11:07:32 +0000 (20:07 +0900)] 
ask-password-api: several modernizations for ask_password_agent(); use CLEANUP_TMPFILE_AT more (#40631)

5 days agoreport: rearrange handling connection drop when skipping metrics
Ivan Kruglov [Wed, 11 Feb 2026 12:44:00 +0000 (04:44 -0800)] 
report: rearrange handling connection drop when skipping metrics

5 days agonamespace-util: Merge namespace_enter_delegated() into namespace_enter() (#40669)
Daan De Meyer [Mon, 16 Feb 2026 10:26:41 +0000 (11:26 +0100)] 
namespace-util: Merge namespace_enter_delegated() into namespace_enter() (#40669)

There's no need to pass in a boolean to decide whether we use
namespace_enter_delegated() or not. Instead, we can just check if we
have CAP_SYS_ADMIN in our own user namespace. If we don't, then we have
to insist on a child user namespace being passed in and we have to enter
it first to get CAP_SYS_ADMIN as without CAP_SYS_ADMIN we wouldn't be
able
to call setns() in the first place. If we do have CAP_SYS_ADMIN, we can
always enter the other namespaces first before entering the user
namespace.

Additionally, we don't fail anymore if we can't reset the UID/GID since
a
root user might not always be available in every user namespace we might
enter.

5 days agodns-delegates: add support for setting a firewall mark
r-vdp [Thu, 12 Feb 2026 21:52:54 +0000 (23:52 +0200)] 
dns-delegates: add support for setting a firewall mark

This makes it possible to have DNS requests for certain domains routed
differently than normal requests, which is for instance useful when
using policy routing to route traffic over a VPN but DNS requests for
the VPN endpoint itself, should be routed differently.

It doesn't make much sense to configure a firewall mark at the level of
a network interface, but at the level of a DNS delegate it can be very
useful.

5 days agoVarlink fixlets and several other follow-ups (#40687)
Daan De Meyer [Mon, 16 Feb 2026 10:02:08 +0000 (11:02 +0100)] 
Varlink fixlets and several other follow-ups (#40687)

5 days agooomd: Fix bug where we drop queued kill state on duplicate cgroup (#40690)
Daan De Meyer [Mon, 16 Feb 2026 09:52:49 +0000 (10:52 +0100)] 
oomd: Fix bug where we drop queued kill state on duplicate cgroup (#40690)

5 days agonetworkctl: use varlink methods to bring up/down interfaces 40693/head
Yu Watanabe [Mon, 16 Feb 2026 03:47:25 +0000 (12:47 +0900)] 
networkctl: use varlink methods to bring up/down interfaces

Then,
- polkit authentication can be used,
- dynamic configuration engine can be safely stopped before bringing
  down interfaces.

Fixes #38538.

5 days agonetworkctl: merge three functions for calling D-Bus methods
Yu Watanabe [Mon, 16 Feb 2026 04:10:41 +0000 (13:10 +0900)] 
networkctl: merge three functions for calling D-Bus methods

5 days agonetworkctl: use parse_interfaces() at one more place
Yu Watanabe [Mon, 16 Feb 2026 04:07:19 +0000 (13:07 +0900)] 
networkctl: use parse_interfaces() at one more place

5 days agonetworkctl: split out parse_interfaces()
Yu Watanabe [Mon, 16 Feb 2026 04:04:42 +0000 (13:04 +0900)] 
networkctl: split out parse_interfaces()

Also, this makes interfaces stored in OrderedSet rather than Set,
so interfaces becomes up/down in the specified order.

This also makes when multiple interfaces are specified, networkctl tries
to up/down all specfied interfaces even if some of them are failed.

Fixes #40017.

5 days agonamespace-util: Merge namespace_enter_delegated() into namespace_enter() 40669/head
Daan De Meyer [Sun, 15 Feb 2026 13:22:44 +0000 (14:22 +0100)] 
namespace-util: Merge namespace_enter_delegated() into namespace_enter()

There's no need to pass in a boolean to decide whether we use
namespace_enter_delegated() or not. Instead, we can just check if we
have CAP_SYS_ADMIN in our own user namespace. If we don't, then we have
to insist on a child user namespace being passed in and we have to enter
it first to get CAP_SYS_ADMIN as without CAP_SYS_ADMIN we wouldn't be able
to call setns() in the first place. If we do have CAP_SYS_ADMIN, we can
always enter the other namespaces first before entering the user namespace.

Additionally, we don't fail anymore if we can't reset the UID/GID since a
root user might not always be available in every user namespace we might
enter.

5 days agotimesync: fix parsing FallbackNTP= (#40692)
Zbigniew Jędrzejewski-Szmek [Mon, 16 Feb 2026 09:16:21 +0000 (10:16 +0100)] 
timesync: fix parsing FallbackNTP= (#40692)

Follow-up for 3745770ae4dcf262707882a38f6c5ba2684329a3.
Fixes #40621.

5 days agocore: serialize metrics varlink server as well 40687/head
Mike Yuan [Fri, 13 Feb 2026 19:22:13 +0000 (20:22 +0100)] 
core: serialize metrics varlink server as well

5 days agocore/manager-serialize: discern daemon-reload/reexec via objective
Mike Yuan [Fri, 13 Feb 2026 19:36:39 +0000 (20:36 +0100)] 
core/manager-serialize: discern daemon-reload/reexec via objective

5 days agovarlink-serialize: deserialize to correct event priority
Mike Yuan [Sun, 15 Feb 2026 02:21:01 +0000 (03:21 +0100)] 
varlink-serialize: deserialize to correct event priority

5 days agocore/varlink: several cleanups for metrics varlink server
Mike Yuan [Fri, 13 Feb 2026 16:37:10 +0000 (17:37 +0100)] 
core/varlink: several cleanups for metrics varlink server

Follow-up for bb1ef2edf7d62de35291702635067ee85f09bad5

The commit introduced a new "metrics" varlink server, but for
user scope stuff it is not bound anywhere. The copy-pasted
"fresh" handling for deserialization is also essentially
meaningless as metrics_setup_varlink_server() doesn't even report
whether the varlink server is fresh (let alone that no serialization
is being done at all right now). Moreover, currently the event
priority is hardcoded, while event loop and associated priority
assignment ought to be subject to each daemon.

While fixing the mentioned issues I took the chance to restructure
the existing code a bit for readability. Note that serialization
for the metrics server is still missing - it will be tackled
in subsequent commits.

5 days agoshared/metrics: add two more assertions
Yu Watanabe [Mon, 16 Feb 2026 06:26:21 +0000 (15:26 +0900)] 
shared/metrics: add two more assertions

5 days agoshared/metrics: name the sd_varlink_server in our usual fashion
Mike Yuan [Fri, 13 Feb 2026 16:31:33 +0000 (17:31 +0100)] 
shared/metrics: name the sd_varlink_server in our usual fashion

This is used for internal reference, in debug logging and such,
hence let's do nothing fancy but instead make it identifiable.

5 days agocore/varlink-metrics: suffix metrics methods with _metrics
Mike Yuan [Fri, 13 Feb 2026 17:14:34 +0000 (18:14 +0100)] 
core/varlink-metrics: suffix metrics methods with _metrics

This is not even the prominent "Describe" method in pid1,
as typically one would be looking for _describe_manager().

5 days agocore/varlink-metrics: include core-forward.h
Mike Yuan [Fri, 13 Feb 2026 16:48:15 +0000 (17:48 +0100)] 
core/varlink-metrics: include core-forward.h

5 days agocore/varlink-cgroup: add BindNetworkInterface to varlink CGContext
Mike Yuan [Sun, 15 Feb 2026 01:05:07 +0000 (02:05 +0100)] 
core/varlink-cgroup: add BindNetworkInterface to varlink CGContext

Follow-up for c1c787651b34c0a0f1082b9d32cf47ea3abe0af2

5 days agosd-varlink: fail if a method call wasn't replied to and the callback didn't store it
Mike Yuan [Thu, 12 Feb 2026 00:09:49 +0000 (01:09 +0100)] 
sd-varlink: fail if a method call wasn't replied to and the callback didn't store it

5 days agosd-varlink: take output queue into account in sd_varlink_flush()
Mike Yuan [Thu, 12 Feb 2026 00:11:30 +0000 (01:11 +0100)] 
sd-varlink: take output queue into account in sd_varlink_flush()

5 days agosd-varlink: _reset_fds() should reset fds for the reply being constructed
Mike Yuan [Wed, 11 Feb 2026 17:02:04 +0000 (18:02 +0100)] 
sd-varlink: _reset_fds() should reset fds for the reply being constructed

... (aka pushed_fds), not what's already enqueued to be sent out.

5 days agosd-varlink: use free_and_replace at one more place
Mike Yuan [Wed, 11 Feb 2026 15:29:37 +0000 (16:29 +0100)] 
sd-varlink: use free_and_replace at one more place

5 days agosd-varlink: replace manual move_fd() with FORK_PACK_FDS + FORK_CLOEXEC_OFF
Mike Yuan [Sun, 15 Feb 2026 02:45:26 +0000 (03:45 +0100)] 
sd-varlink: replace manual move_fd() with FORK_PACK_FDS + FORK_CLOEXEC_OFF

Note that this actually matters: we might otherwise clobber
the logging fds reopened when rearranging fd '3'.

While at it, avoid logging from library functions.

5 days agosd-varlink: also validate peer ucred for SD_VARLINK_SERVER_MYSELF_ONLY
Mike Yuan [Sun, 15 Feb 2026 04:24:56 +0000 (05:24 +0100)] 
sd-varlink: also validate peer ucred for SD_VARLINK_SERVER_MYSELF_ONLY

5 days agosd-varlink: log about client uid that hit connection limit
Mike Yuan [Sun, 15 Feb 2026 04:36:56 +0000 (05:36 +0100)] 
sd-varlink: log about client uid that hit connection limit

5 days agosd-varlink: shorten the code a bit
Mike Yuan [Sun, 15 Feb 2026 04:56:50 +0000 (05:56 +0100)] 
sd-varlink: shorten the code a bit

5 days agorepart: io.systemd.Repart.ListCandidateDevices requires 'more'
Mike Yuan [Sun, 15 Feb 2026 02:08:12 +0000 (03:08 +0100)] 
repart: io.systemd.Repart.ListCandidateDevices requires 'more'

5 days agoresolve: io.systemd.Resolve.BrowseServices requires 'more'
Mike Yuan [Sun, 15 Feb 2026 02:04:28 +0000 (03:04 +0100)] 
resolve: io.systemd.Resolve.BrowseServices requires 'more'

5 days agomute-console: io.systemd.MuteConsole requires 'more'
Mike Yuan [Sun, 8 Feb 2026 20:57:01 +0000 (21:57 +0100)] 
mute-console: io.systemd.MuteConsole requires 'more'

5 days agotree-wide: drop redundant check for SD_VARLINK_METHOD_MORE flag
Mike Yuan [Sun, 8 Feb 2026 20:47:38 +0000 (21:47 +0100)] 
tree-wide: drop redundant check for SD_VARLINK_METHOD_MORE flag

If the IDL declares the method requires 'more' yet the call doesn't
have it set, varlink_idl_validate_method_call() should have rejected
it and the callback shouldn't be reached.

5 days agovarlink-io.systemd.Network: minor coding style cleanups
Mike Yuan [Wed, 4 Feb 2026 18:51:28 +0000 (19:51 +0100)] 
varlink-io.systemd.Network: minor coding style cleanups

Follow-up for cf27c70d70f5912078f68b66869d16198aaa36a5

5 days agosd-json: unify JSON_BUILD_PAIR_IN?_ADDR_*
Mike Yuan [Sun, 15 Feb 2026 01:06:19 +0000 (02:06 +0100)] 
sd-json: unify JSON_BUILD_PAIR_IN?_ADDR_*

This also swaps family and address params for
plain JSON_BUILD(_PAIR)_IN_ADDR, aligning with
_WITH_STRING flavors.

5 days agojson-util: sort includes
Mike Yuan [Sun, 8 Feb 2026 16:12:21 +0000 (17:12 +0100)] 
json-util: sort includes

5 days agosd-json: use FOREACH_ARRAY more
Mike Yuan [Sun, 15 Feb 2026 00:45:50 +0000 (01:45 +0100)] 
sd-json: use FOREACH_ARRAY more

5 days agoshared: conditionalize build of apparmor-util.c in meson
Mike Yuan [Mon, 16 Feb 2026 01:50:29 +0000 (02:50 +0100)] 
shared: conditionalize build of apparmor-util.c in meson

5 days agoprocess-util: drop unused TAKE_PID
Mike Yuan [Sat, 14 Feb 2026 23:25:42 +0000 (00:25 +0100)] 
process-util: drop unused TAKE_PID

Follow-up for fbd276cb86a2f0292cc19fd57ee3d72bf73592dc

We now track helper processes via PidRef throughout the codebase.

5 days agoprocess-util: group oom_score_adjust_is_valid() with getter/setter
Mike Yuan [Sat, 14 Feb 2026 23:21:34 +0000 (00:21 +0100)] 
process-util: group oom_score_adjust_is_valid() with getter/setter

5 days agolog-context: drop redundant forward decl
Mike Yuan [Sat, 14 Feb 2026 23:39:05 +0000 (00:39 +0100)] 
log-context: drop redundant forward decl

We consolidated all these into forward.h.

5 days agobacklight: update comment to match the new clamp value
Mike Yuan [Mon, 16 Feb 2026 05:18:09 +0000 (06:18 +0100)] 
backlight: update comment to match the new clamp value

Follow-up for 4ed1e2ea17e0f29a23d7a3dd65af192def9b3214

5 days agouser-util: Don't setgroups() if /proc/self/gid_map is empty
Daan De Meyer [Fri, 13 Feb 2026 11:24:49 +0000 (12:24 +0100)] 
user-util: Don't setgroups() if /proc/self/gid_map is empty

If /proc/self/gid_map is empty, the kernel will refuse setgroups(),
so don't attempt it if that's the case on top of the /proc/self/setgroups
check we already have.

5 days agotree-wide: Add some extra debug logging
Daan De Meyer [Fri, 13 Feb 2026 10:15:05 +0000 (11:15 +0100)] 
tree-wide: Add some extra debug logging

5 days agomkosi: Install musl in tools trees on Fedora/Arch
Daan De Meyer [Sat, 14 Feb 2026 22:30:34 +0000 (23:30 +0100)] 
mkosi: Install musl in tools trees on Fedora/Arch

For debugging purposes.

5 days agoupdate TODO
Lennart Poettering [Mon, 16 Feb 2026 08:06:03 +0000 (09:06 +0100)] 
update TODO

5 days agoCODING_STYLE: fix typo
Yu Watanabe [Mon, 16 Feb 2026 05:35:19 +0000 (14:35 +0900)] 
CODING_STYLE: fix typo

Follow-up for 83b4a5bb3d6a0f565aebcba975efad8dac73abea.

5 days agoman: fix typo
Yu Watanabe [Mon, 16 Feb 2026 05:34:02 +0000 (14:34 +0900)] 
man: fix typo

Follow-up for 91b3620b07f29342261a3cbdaaaa3f83f21895e1.

5 days agosd-varlink: fix typo
Yu Watanabe [Mon, 16 Feb 2026 05:32:12 +0000 (14:32 +0900)] 
sd-varlink: fix typo

Follow-up for c0696f1f5d3a2be1c8e4c8b45ca7e8a6df7998fa.

5 days agonetwork: fix typo
Yu Watanabe [Mon, 16 Feb 2026 05:30:36 +0000 (14:30 +0900)] 
network: fix typo

Follow-up for f8a4c3d375b83f3ee249ca3f4b7f407b618a9491.

5 days agoNEWS: fix typo
Yu Watanabe [Mon, 16 Feb 2026 05:28:44 +0000 (14:28 +0900)] 
NEWS: fix typo

Follow-up for 4ed1e2ea17e0f29a23d7a3dd65af192def9b3214.

5 days agonetwork: implement varlink LinkUp and LinkDown methods
gvenugo3 [Thu, 20 Nov 2025 03:35:03 +0000 (20:35 -0700)] 
network: implement varlink LinkUp and LinkDown methods

The new varlink methods are basically equivalent to 'ip link set INTERFACE up/down',
but they support polkit authentication. Also, on LinkDown, it gracefully
stops dynamic engines like DHCP client/server before the interface is
bring down. Hence, e.g. an empty RA on stop should be sent.

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
5 days agonetwork: use voffsetof() at more places
Yu Watanabe [Mon, 16 Feb 2026 02:20:20 +0000 (11:20 +0900)] 
network: use voffsetof() at more places

5 days agoudev: guess if usb devices are internal external (#40649)
Yu Watanabe [Mon, 16 Feb 2026 04:25:35 +0000 (13:25 +0900)] 
udev: guess if usb devices are internal external (#40649)

Actually we are defining databases to determine when a usb device is
inherent part of the system or if it's a external device.

Let's use the removable attribute of the port where it is connected to
say that. That gives us the ability to not rely on a particular vendor
only does external devices or to not having the need to be quirking
input subsystem for that purpose that will become unreliable as more and
more internal devices are connected over usb instead over ps2 or i2c
buses. Eg.
https://gitlab.freedesktop.org/libinput/libinput/-/commit/02b495e79022e64514015e1a3dea32997035dd4f?merge_request_iid=1389

Actually this has been seen as reliable in a small set of device from
normal laptops, to detachable ones. The need to check maxchild is 0 is
for detachable devices, pogo pin usbs are fixed, while we attach the
keyboard|touchpad dock the input devices tend to be directly connected
to that port and if the dock has more usbs tend to be a hub that then
exposes removable as unknow. If we don't set maxchild 0 we will not only
guess that the keyboard and touchpad are internal but also incorrectly
other input devices like mice connected to the dock's usb ports.

I have use a very generic name like INTEGRATION because is not actually
used for any other thing and is used to determine not only over usb bus
but for acpi, pci, platform actually.

Also a remap to actual libinput variables is done for compatibility
purposes. if it's possible to have only the INTEGRATION variable instead
multiple ones will be done in the future but is actually unclear.

This can also be used for example to achieve an actual feature that we
lack in linux, when a device with accelerometers and cameras is rotated
the video output is not, this tag the own device cameras as internal
while external ones as external to be able to only do that for the
internal ones.

Note that this has nothing to do with the removable attribute found in
usb storage devices where it's values can be 0 or 1. There is no
conflict at all because the removable attribute we check is specifically
the one found in usb port ones.

5 days agonetwork: add ModemManager support
Oleksandr Andrushchenko [Wed, 3 Sep 2025 07:20:24 +0000 (10:20 +0300)] 
network: add ModemManager support

[Match]
Name=wwan*

[Network]
LLDP=no
LinkLocalAddressing=no
IPv6AcceptRA=no

[ModemManager]
SimpleConnectPropertie]s=apn=internet ip-type=ipv4 allow-roaming=no pin=1111 operator-id=25503
RouteMetric=200
UseGateway=yes

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
5 days agobacklight: reduce clamp to 1%
David Santamaría Rogado [Mon, 29 Dec 2025 16:29:37 +0000 (17:29 +0100)] 
backlight: reduce clamp to 1%

Actually GNOME sets a clamp of 1% and divides in 20 steps the brightness
control. Using 5% clamp makes things like in a device with max value 640
to always be in the first brightness step in GNOME and we can't leave in
the minimum.

GNOME set steps of 640/20 = 32 with the zero step 640 * 1% = 6. When we
restart the device with the lowest bright systemd sees 6 but sets
640 * 5% = 32, so we get the brightness in the first step.

Tests in IPS and OLED panels have been done and 1% still seems a
comprensive minimun usable value so use that to allow all environments
to be able to set lower brightness values that won't be raised by
systemd at boot.

If your user enviroment allow to set excesive lower unusable values you
should blame it or yourself if you directle changes it through sysfs but
not systemd.

5 days agoudev: rules: guess devices if internal or external 40649/head
David Santamaría Rogado [Wed, 11 Feb 2026 18:28:02 +0000 (19:28 +0100)] 
udev: rules: guess devices if internal or external

Set ID_INTEGRATION variable to hint if a device is internal (inherent
part of the system) or external otherwise.

5 days agohwdb: don't error on empty hwdb file
David Santamaría Rogado [Sat, 14 Feb 2026 22:03:45 +0000 (23:03 +0100)] 
hwdb: don't error on empty hwdb file

5 days agotimesync: actually disables built-in fallback NTP servers when an empty string is... 40692/head
Yu Watanabe [Mon, 16 Feb 2026 00:00:42 +0000 (09:00 +0900)] 
timesync: actually disables built-in fallback NTP servers when an empty string is specified

Follow-up for 3745770ae4dcf262707882a38f6c5ba2684329a3.
Fixes #40621.

5 days agotimesync: return earlier when an empty string is specified
Yu Watanabe [Mon, 16 Feb 2026 00:51:36 +0000 (09:51 +0900)] 
timesync: return earlier when an empty string is specified

5 days agotimesync: rename have_fallbacks -> fallback_set
Yu Watanabe [Mon, 16 Feb 2026 00:50:46 +0000 (09:50 +0900)] 
timesync: rename have_fallbacks -> fallback_set

5 days agoboot: fix buffer alignment when doing block I/O (#40465)
Yu Watanabe [Mon, 16 Feb 2026 00:10:01 +0000 (09:10 +0900)] 
boot: fix buffer alignment when doing block I/O (#40465)

UEFI Block I/O Protocol has `Media->IoAlign` field dictating the minimum
alignment for I/O buffer. It's quite surprising this has been lingering
here unnoticed for years, seems like most UEFI implementations have
small or no alignment requirements. U-Boot is not the case here, and
requires at least 512 byte alignment, hence attempt to read GPT
partition table fail and in effect systemd-boot can not find XBOOTLDR
partition.

These patches allow to boot from XBOOTLDR partition on U-Boot - tested
with latest systemd revision and U-Boot master
(`8de6e8f8a076d2c9b6d38d8563db135c167077ec`) on x64 and ARM32, of which
both are failing without the patch.

Also fixes Bitlocker probing logic, which is the only other place where
raw block I/O is used, however this is untested.

6 days agolocale-util: allow overriding locale directory via environment
andre4ik3 [Wed, 11 Feb 2026 07:04:00 +0000 (07:04 +0000)] 
locale-util: allow overriding locale directory via environment

6 days agooomd: Return tristate status from oomd_cgroup_kill_mark() 40690/head
Chris Down [Sun, 15 Feb 2026 17:31:12 +0000 (01:31 +0800)] 
oomd: Return tristate status from oomd_cgroup_kill_mark()

oomd_cgroup_kill_mark() currently returns 0 on all non-error paths. But
the manager only logs that it marked for killing on `if (r > 0)`, which
is thus unreachable.

Changing it to `r >= 0` would also be wrong, because then we would log
on no-op paths.

So let's fix this by making the return value express what actually
happened:

- < 0: failure to queue the kill state
-   0: no new mark was created (already queued or dry-run)
- > 0: a new kill state was queued

6 days agooomd: Fix bug where we drop queued kill state on duplicate cgroup
Chris Down [Sun, 15 Feb 2026 17:30:02 +0000 (01:30 +0800)] 
oomd: Fix bug where we drop queued kill state on duplicate cgroup

oomd_cgroup_kill_mark() allocates a temporary OomdKillState and inserts
it into kill_states via set_ensure_put(). This is keyed by cgroup path.
When the same cgroup is already queued, set_ensure_put() dutifully
returns 0.

The function then returns with
_cleanup_(oomd_kill_state_removep) still armed, which eventually calls
oomd_kill_state_free().

oomd_kill_state_free() removes from kill_states by cgroup-path key, so
because this path already exists, it will remove the existing queued
kill state instead of just dropping the temporary object.

This is wrong and results in mistakenly drops the queued kill state on
duplicates.

This can happen when a cgroup is marked multiple times before the first
queued kill state is consumed. The result is lost kill-state tracking
and incorrect prekill/kill sequencing.

Handle r == 0 explicitly by freeing only the temporary object and
leaving the already queued state intact.

6 days agooomd: Prevent corruption of cgroup paths in Killed signal
Chris Down [Sat, 14 Feb 2026 16:05:12 +0000 (00:05 +0800)] 
oomd: Prevent corruption of cgroup paths in Killed signal

While looking at oomd behaviour in production I noticed that I always
get garbage cgroup paths for the Killed event. Looking more closely, I
noticed that while the signature is (string cgroup, string reason), we
currently erroneously pass the `OomdCGroupContext*` pointer itself as
the first argument to sd_bus_emit_signal(), rather than the ctx->path
string it contains.

The in-memory layout on affected machines in my case is:

    struct OomdCGroupContext {
        unsigned n_ref;
        /* padding */
        char *path;
        /* ... */
    }

...which explains the control characters, since they're garbage from
parsing n_ref, the path pointer, and later fields. At runtime, sd-bus
treats ctx as `const char *` and reads struct bytes as string data,
resulting in garbage being sent.

Pass ctx->path correctly so listeners receive the valid cgroup path.

6 days agoboot: respect minimal I/O alignment when doing block i/o 40465/head
Artur Kowalski [Thu, 29 Jan 2026 19:55:42 +0000 (20:55 +0100)] 
boot: respect minimal I/O alignment when doing block i/o

Fixes XBOOTLDR partition detection and bitlocker support when using
U-Boot as UEFI.

6 days agoboot: introduce xmalloc_aligned_pages
Artur Kowalski [Thu, 29 Jan 2026 17:42:24 +0000 (18:42 +0100)] 
boot: introduce xmalloc_aligned_pages

To be used for block I/O which may require specific buffer alignment.

6 days agomkosi: Remove some packages from the image
Daan De Meyer [Sat, 14 Feb 2026 22:05:52 +0000 (23:05 +0100)] 
mkosi: Remove some packages from the image

Let's slim down the image size a bit. None of the removed packages
should be required.

7 days agostring-util: Prevent infinite loop pegging CPU on malformed ESC input
Chris Down [Sat, 14 Feb 2026 16:40:14 +0000 (00:40 +0800)] 
string-util: Prevent infinite loop pegging CPU on malformed ESC input

string_has_ansi_sequence() currently does this to look for ESC input:

    t = memchr(s, 0x1B, ...)

So each iteration re-searches from the original start pointer. But if we
find an ESC byte that does *not* start a valid ANSI sequence (like "\x1B
", or an ESC at the end of the string), then ansi_sequence_length()
returns 0, and if that ESC is still in the search window, we will just
spin consuming 100% CPU forever.

Fix this by always advancing past rejected ESC bytes.

7 days agomkosi: update mkosi ref to 4b18ea8395e9cc2b1d247be93944f5539affe964 (#40681)
Daan De Meyer [Sat, 14 Feb 2026 17:31:26 +0000 (18:31 +0100)] 
mkosi: update mkosi ref to 4b18ea8395e9cc2b1d247be93944f5539affe964 (#40681)

4b18ea8395 sandbox: Make sure eventfd is CLOEXEC
23ea86d0cf Revert "Bump minimum python version to 3.10"
81fd30ec77 Revert "sandbox: Use os.eventfd()"
717020c97b Revert "Use python3.12 as interpreter in CentOS Stream 9
zipapp"
e1d0e45e3b Rework sandbox globbing and exist checks

7 days agomkosi: update mkosi ref to 4b18ea8395e9cc2b1d247be93944f5539affe964 40681/head
Daan De Meyer [Sat, 14 Feb 2026 15:04:57 +0000 (16:04 +0100)] 
mkosi: update mkosi ref to 4b18ea8395e9cc2b1d247be93944f5539affe964

4b18ea8395 sandbox: Make sure eventfd is CLOEXEC
23ea86d0cf Revert "Bump minimum python version to 3.10"
81fd30ec77 Revert "sandbox: Use os.eventfd()"
717020c97b Revert "Use python3.12 as interpreter in CentOS Stream 9 zipapp"
e1d0e45e3b Rework sandbox globbing and exist checks