]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: do not leak resources when handling stale alias state on reload (#41986)
authorChris Down <chris@chrisdown.name>
Wed, 13 May 2026 12:25:08 +0000 (21:25 +0900)
committerGitHub <noreply@github.com>
Wed, 13 May 2026 12:25:08 +0000 (21:25 +0900)
The fix for the corrupted state when units become aliased on reload
leaks the now-aliased unit's resources, which become untracked and
essentially lost.

While fixing the state corruption is of course necessary, leaking
processes/etc. is not ideal for a system and service manager, so
instead attempt to keep track of them by creating stub units
on-the-fly.
This way resources are not leaked, there are clear indications of
where they moved, and all state can be tracked as expected.

1  2 
src/core/manager-serialize.c

index 528540e57e2e76275835c988d42e92bfdcd64837,7c557b2f3ff201e005d3452746d8d10063bd819b..9a64be40397dec81811ff01bae31c770f156780e
@@@ -1,7 -1,8 +1,9 @@@
  /* SPDX-License-Identifier: LGPL-2.1-or-later */
  
+ #include "sd-id128.h"
  #include "alloc-util.h"
 +#include "bpf-restrict-fsaccess.h"
  #include "dbus.h"
  #include "dynamic-user.h"
  #include "fd-util.h"