]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 months agocore/cgroup: Properly handle aborting a pending freeze operation v256-stable
msizanoen [Tue, 18 Mar 2025 05:47:21 +0000 (12:47 +0700)] 
core/cgroup: Properly handle aborting a pending freeze operation

We must thaw the cgroup even if cgroup.events/frozen=0 if a freeze
operation is in flight as it means the cgroup is already partially
frozen.

Fixes #37590.
Fixes #38337.

(cherry picked from commit 85d00912c0fa08c80785d18a6818e7d92d40743e)
(cherry picked from commit 4bf37df99c905d21cf0febde59190d885ad201dc)

3 months agocore/unit: introduce unit_set_freezer_state, make logging consistent
Mike Yuan [Fri, 31 May 2024 12:46:16 +0000 (20:46 +0800)] 
core/unit: introduce unit_set_freezer_state, make logging consistent

Also, emit PropertiesChanged signal for FreezerState too.

Fixes #31115

(cherry picked from commit 0064290a54fe46047889d44b3215d04b60e77c17)

3 months agocore/cgroup: skip freezer action wholly if current == objective
Mike Yuan [Sat, 25 May 2024 10:46:55 +0000 (18:46 +0800)] 
core/cgroup: skip freezer action wholly if current == objective

(cherry picked from commit a9dc19617943d1db4f137005f5e467188c66e5a9)

3 months agocore/cgroup: replace hardcoded state set with freezer_state_finish()
Mike Yuan [Mon, 15 Jul 2024 18:32:47 +0000 (20:32 +0200)] 
core/cgroup: replace hardcoded state set with freezer_state_finish()

This makes code simpler and more readable.

(cherry picked from commit 27344f9acf7b23225020cc4a2d63d5e10d35308f)

3 months agocore/unit: rename freezer "target" to "objective"
Mike Yuan [Sat, 25 May 2024 10:44:51 +0000 (18:44 +0800)] 
core/unit: rename freezer "target" to "objective"

(cherry picked from commit f27f461b01926f08e9d1e88833b69b9b2ba4995c)

3 months agocore/cgroup: check CGroupRuntime.cgroup_path rather than _realized for freezer
Mike Yuan [Wed, 5 Jun 2024 17:23:40 +0000 (19:23 +0200)] 
core/cgroup: check CGroupRuntime.cgroup_path rather than _realized for freezer

The same check is used everywhere else.

(cherry picked from commit c97c79aded8d313237e0952062a2cce71fb88eb5)

4 months agomeson: bump version to 256.17 v256.17
Luca Boccassi [Wed, 25 Jun 2025 13:15:23 +0000 (14:15 +0100)] 
meson: bump version to 256.17

4 months agohwdb: update to v257-stable@{2025-06-25}
Luca Boccassi [Wed, 25 Jun 2025 13:14:25 +0000 (14:14 +0100)] 
hwdb: update to v257-stable@{2025-06-25}

git restore -s origin/v257-stable hwdb.d/ test/hwdb.d

4 months agotest: escape '+' from uname -r before using in regex via '=~'
Luca Boccassi [Tue, 24 Jun 2025 12:07:11 +0000 (13:07 +0100)] 
test: escape '+' from uname -r before using in regex via '=~'

It will otherwise interpret characters such as '+' as if they
were regex, and break matching.

For example TEST-71-HOSTNAME started failing when
uname -r started including a '+':

FAIL: 'Kernel: Linux 6.12.33+deb13-amd64' not found in:
 Static hostname: host
       Icon name: computer-vm
         Chassis: vm ðŸ–´
      Machine ID: e6471c1f95ab49098827498ed816cdf7
         Boot ID: 231da987f64d4af59f2076fbb638c611
  Virtualization: kvm
Operating System: Debian GNU/Linux 13 (trixie)
          Kernel: Linux 6.12.33+deb13-amd64
    Architecture: x86-64

(cherry picked from commit a0dfb0245662e31ded34730010e0e92be9bd9f1a)
(cherry picked from commit de5642b63e5c9210052b97105457a3debf5cc309)

4 months agonetwork/dhcp6: consider the DHCPv6 protocol as finished when conflict addresses exist
Yu Watanabe [Fri, 20 Jun 2025 18:51:30 +0000 (03:51 +0900)] 
network/dhcp6: consider the DHCPv6 protocol as finished when conflict addresses exist

Replaces #37891.

(cherry picked from commit 4c4fe8cd71da64506705736fda0ab7f7154f28d2)
(cherry picked from commit b53f734a65c7d6183bf8fad6cef465d2d1c11db5)

4 months agonetwork/dhcp6: refactoring for verify_dhcp6_address()
Yu Watanabe [Fri, 20 Jun 2025 18:48:51 +0000 (03:48 +0900)] 
network/dhcp6: refactoring for verify_dhcp6_address()

No functional change. Preparation for later changes.

(cherry picked from commit 03f0658460964bcc63b5194b69885b1dbf33f77d)
(cherry picked from commit 97d34af16068ba3a3d25f628cf620e2997738947)

4 months agobootctl: be more careful when opening arbitrary files from ESP
Lennart Poettering [Fri, 20 Jun 2025 11:59:04 +0000 (13:59 +0200)] 
bootctl: be more careful when opening arbitrary files from ESP

Let's refuse all kind of weird stuff early.

As suggested here: https://github.com/systemd/systemd/pull/30418#pullrequestreview-2128220792

(cherry picked from commit 95df8288c7dff8a95b86d48787ad03ae9bd5f5ed)
(cherry picked from commit 5b68d2a003b4708b113087261dcb3f4604dfc9f0)

4 months agocore: escape UTF-8 in mount unit Where field before sending to clients
Lennart Poettering [Fri, 20 Jun 2025 11:16:10 +0000 (13:16 +0200)] 
core: escape UTF-8 in mount unit Where field before sending to clients

Followup for: 4804da58536ab7ad46178a03f4d2da49fd8e4ba2 #27541

Fixes: #36206
(cherry picked from commit 222b0b05ce9ac29283cd89cf98444c4da3373568)
(cherry picked from commit 72db7dfd2778ac399eedac580b658e2d75e577a4)

4 months agotest: add test case for issue #36031
Yu Watanabe [Thu, 15 May 2025 04:45:13 +0000 (13:45 +0900)] 
test: add test case for issue #36031

(cherry picked from commit 7824e70a074316ff799cbbc98af4f9ba944d6535)
(cherry picked from commit 0846c1414402fc67080c90d235c543ec54576315)

4 months agocore: introduce Unit.dependency_generation counter and restart loop when dependency...
Yu Watanabe [Thu, 15 May 2025 03:34:35 +0000 (12:34 +0900)] 
core: introduce Unit.dependency_generation counter and restart loop when dependency is updated in the loop

When starting unit A, a dependent unit B may be loaded if it is not
loaded yet, and the dependencies in unit A may be updated.
As Hashmap does not allow a new entry to be added in a loop, we need to
restart loop in such case.

Fixes a bug introduced by cda667722c2218cf1a0185284d2a87f8a25f1b2d.
Fixes #36031.

(cherry picked from commit b7777d08846033859c5b734317fbbbfcca4cafcb)
(cherry picked from commit 4dc4fdcfe051b10aa4f7fe4d3ab220c27084eaf5)

4 months agocore/transaction: do not override unit load state when unit_load() failed
Yu Watanabe [Tue, 20 May 2025 19:38:07 +0000 (04:38 +0900)] 
core/transaction: do not override unit load state when unit_load() failed

When unit_load() failed for some reasons, previously we overrided the
load state with UNIT_NOT_FOUND, but we did not update the
Unit.fragment_not_found_timestamp_hash. So, the unit may be loaded
multiple times when the unit is in a dependency list of another unit,
as manager_unit_cache_should_retry_load() will be true again even on
next call.
Let's not override the unit state set by unit_load().

Note, after unit_load(), the unit state should not be UNIT_STUB.
Let's also add the assertion about that.

This change is important when combined with the next commit, as with the
next commit we will restart the FOREACH_UNIT_DEPENDENCY() loop if an unit
is reloaded, hence overriding load state with UNIT_NOT_FOUND may cause
infinit loop.

(cherry picked from commit 9b6aa9e443859f1eb69cfe37ca755ac4db31c475)
(cherry picked from commit 0e5fc0a29c4a98f781d4d4911b5f589f31c9f10e)

4 months agocore/transaction: drop redundant call of bus_unit_validate_load_state()
Yu Watanabe [Tue, 20 May 2025 19:32:09 +0000 (04:32 +0900)] 
core/transaction: drop redundant call of bus_unit_validate_load_state()

The function manager_unit_cache_should_retry_load() reutrns true only
when the unit state is UNIT_NOT_FOUND. Hence, it is not necessary to
call bus_unit_validate_load_state() before checking
manager_unit_cache_should_retry_load().

(cherry picked from commit 7ad2e660802be989d8ae8d0166c4fe1b7be0eb21)
(cherry picked from commit 915ffa770f3d65e28cf4ed8811140e9933eff242)

4 months agocore/transaction: fix comment
Yu Watanabe [Thu, 15 May 2025 00:14:07 +0000 (09:14 +0900)] 
core/transaction: fix comment

(cherry picked from commit fe51a6147779e10833273b141c960163c5f6cea2)
(cherry picked from commit e35d83a7065ef062f113522dfdacbb41622c13ab)

4 months agocore/transaction: rename ret -> job
Yu Watanabe [Thu, 15 May 2025 00:10:36 +0000 (09:10 +0900)] 
core/transaction: rename ret -> job

(cherry picked from commit fc49b2994d77338a0982a4d5ff78a35617311a42)
(cherry picked from commit 74682088723f62424ab6ad7e219d9e6ecbc51c38)

4 months agohome: Make sure we resolve /etc/skel symlink
Daan De Meyer [Sun, 22 Jun 2025 12:17:08 +0000 (14:17 +0200)] 
home: Make sure we resolve /etc/skel symlink

Otherwise copy_tree_at() will try to copy the symlink which we obviously
don't want.

(cherry picked from commit 1e0e7c7411ecb7dc1c6f4d7d6e6a2aa14f6f2395)
(cherry picked from commit 2a918e2a9741ccd28733e230f6e095cfdb5c6ff2)

4 months agobootspec: ensure memory free in one error path
Lennart Poettering [Mon, 23 Jun 2025 12:40:21 +0000 (14:40 +0200)] 
bootspec: ensure memory free in one error path

(cherry picked from commit 1bd9a3c916a26522ee1b26e08374282df66f734b)
(cherry picked from commit 56d2cd64561503d97944d355c61c2e6f5fbe37e6)

4 months agoconsole: when switching console modes and one doesn't work, always go for the next
Lennart Poettering [Fri, 20 Jun 2025 09:05:00 +0000 (11:05 +0200)] 
console: when switching console modes and one doesn't work, always go for the next

So far we already had a logic in place to go for the next mode if some
mode doesn't work â€“ but it was only applied if we'd actively cycle
through resolutions.

Let's extend the logic and always apply it: whenever we try to switch to
a mode, and it doesn't work, go to the next one until we find one that
works.

Fixes: #37324
(cherry picked from commit b53c3af3fe968fc2fc7631c9dab6737b08f0156a)
(cherry picked from commit 66235376a48d2d94bba6c5db0b9f5448243c2041)

4 months agohomed: do not log new password when debug logs are enabled
Luca Boccassi [Sun, 22 Jun 2025 15:44:02 +0000 (16:44 +0100)] 
homed: do not log new password when debug logs are enabled

systemd-homed[3443]: Sending to worker:
{
  "enforcePasswordPolicy": false,
  "userName": "foobarbaz",
  "perMachine": [
    {
      "storage": "directory",
      "matchMachineId": "c1082742b92c4f7e8d30d6b17f9d3351"
    }
  ],
  "disposition": "regular",
  "lastChangeUSec": 1750606709833174,
  "lastPasswordChangeUSec": 1750606709833174,
  "privileged": {
    "hashedPassword": [
      "$y$j9T$ai2Fshq0ev9W05WL4SoRJ1$EFfe41ACrJKXMCQ83A05n6UW.HrRr9/O4b1x0CXgAXD"
    ]
  },
  "binding": {
    "c1082742b92c4f7e8d30d6b17f9d3351": {
      "blobDirectory": "/var/cache/systemd/home/foobarbaz",
      "uid": 60056,
      "gid": 60056
    }
  },
  "secret": {
    "password": [
      "test"
    ]
  },
  "__systemd_homework_internal_blob_fdmap": {}
}

(cherry picked from commit e248790263b63822cdffa399b593a272d7abddc8)
(cherry picked from commit a283e832dabd35d9f6e6aace0525ecf4f6372b57)

4 months agoman: encourage the creation of empty machine-id instead of deleting it
Lukas Nykryn [Wed, 18 Jun 2025 11:33:25 +0000 (13:33 +0200)] 
man: encourage the creation of empty machine-id instead of deleting it

Current text hints that machine-id in template image should be empty
if the system is read-only. But most of the bare metal systems and
regular VMs have /etc read-only at this phase of boot.

(cherry picked from commit 64fcb07199f8409a074575eda5abb69b0caab06f)
(cherry picked from commit 5f55879673b119ebc98280518a9ab5bb7f4b1c5d)

4 months agoresolved: Tweak link-local addresses relevancy
George Tsiamasiotis [Tue, 17 Jun 2025 12:30:41 +0000 (15:30 +0300)] 
resolved: Tweak link-local addresses relevancy

We now consider link-local addresses routable when we have configured
unicast link-local dns servers. This allows creating the DNS scope, even
when the interface doesn't get a routable address.

(cherry picked from commit c60d2a626b88aec24e6f029f799b6631c1aaeee2)
(cherry picked from commit bd9a51fc67faead42dcaac819f5c432741b4a32a)

4 months agofstab-generator: set mode=0755 with root=tmpfs
Luca Boccassi [Mon, 16 Jun 2025 22:28:57 +0000 (23:28 +0100)] 
fstab-generator: set mode=0755 with root=tmpfs

If mode= is not set in rootflags= add mode=0755 when a tmpfs
is used on the rootfs, otherwise it will be group/world writable
as that's the default mode for tmpfs filesystems.

Follow-up for 725ad3b06288b2beeaaf178120010612a30646e4

(cherry picked from commit d3a57a0853de1a4a03b4ae1fbfa8bc59dc01b217)
(cherry picked from commit 0e8f13faf3fafc3679131713915a56c74403f3a3)

4 months agoTEST-75-RESOLVED: add test case for reloading DNSStubListenerExtra=
Yu Watanabe [Mon, 16 Jun 2025 10:13:51 +0000 (19:13 +0900)] 
TEST-75-RESOLVED: add test case for reloading DNSStubListenerExtra=

(cherry picked from commit 888e3f435770568643fc97aa20b112ded94f33eb)
(cherry picked from commit 7dd11425653c93560378f293b2860198085e1d74)

4 months agomanager: also restart stub listner on reload
Yu Watanabe [Mon, 16 Jun 2025 08:55:11 +0000 (17:55 +0900)] 
manager: also restart stub listner on reload

Previously, the extra stub listners were stopped but new ones were not
started. Also, the main stub listners were not restarted, hence the
new settings were not applied. This fixes the above two issues.

Note, to fix the issue, we need to keep CAP_NET_BIND_SERVICE capability
to make it allow to bind stub listner later.

Fixes #37843.

(cherry picked from commit 752cdf5051d4de17864e7b2dbfec0023207a3d4e)
(cherry picked from commit c2eda0d71b16d85c05c2e318027f74e46b3bac10)

4 months agounits: make sure the network tap driver is actually loaded
Lennart Poettering [Fri, 13 Jun 2025 13:14:06 +0000 (15:14 +0200)] 
units: make sure the network tap driver is actually loaded

We have the After= line, but not the Wants= line. Fix that.

(cherry picked from commit 008818ec96bc4b619967fb060a847cc6ef5b2b79)
(cherry picked from commit 1b0706a9e5094a40e9d185eb92ad5b58de36a21e)

4 months agozsh: complete positional devpath in udevadm info/trigger
Ronan Pigott [Fri, 13 Jun 2025 09:09:55 +0000 (02:09 -0700)] 
zsh: complete positional devpath in udevadm info/trigger

(cherry picked from commit 88036a47e42a5773c05b44c860a3f9b940384385)
(cherry picked from commit a39e06b059422788c060a24883f64f531dccd0e0)

4 months agoudev/rules.d: import hwdb before calling net_id builtin
Yu Watanabe [Thu, 12 Jun 2025 09:25:54 +0000 (18:25 +0900)] 
udev/rules.d: import hwdb before calling net_id builtin

The commit cdcb1eeeb883b2ecb3992865f458f874900ddb87 adds
ID_NET_NAME_INCLUDE_DOMAIN property support in net_id builtin.
The property is basically set through hwdb. However, previously hwdb was
imported after calling net_id builtin, hence when net_id is called, the
property was never set.

This makes hwdb is imported before calling net_id builtin, so that the
property is set when net_id is called if hwdb has an entry about that
for the interface.

Follow-up for cdcb1eeeb883b2ecb3992865f458f874900ddb87.
Fixes #37758.

(cherry picked from commit a7deadd763427fcff67b6697557dfbd0c91647ec)
(cherry picked from commit 137ba868c70f5bbfd0432e36266d49cf819b5a13)

4 months agoresolve: exit from loop for transactions when transactions has been regenerated
Yu Watanabe [Wed, 14 May 2025 22:18:38 +0000 (07:18 +0900)] 
resolve: exit from loop for transactions when transactions has been regenerated

Fixes #37458.

(cherry picked from commit 5814acca9aa4354d121de4bf174851f092a6b643)
(cherry picked from commit e40fbaa18e747ee213303cd0ff780d95f5c812e9)

4 months agosocket: downgrade not-supported logging for SO_PASSSEC
Luca Boccassi [Mon, 9 Jun 2025 16:24:24 +0000 (17:24 +0100)] 
socket: downgrade not-supported logging for SO_PASSSEC

Kernel 6.16 started returning EOPNOTSUPP when a required kconfig
is disabled. Downgrade to debug level in that case.

Fixes https://github.com/systemd/systemd/issues/37783

(cherry picked from commit bb887cf22e68b6c83ff8a9c9bccda04d95ac23b3)
(cherry picked from commit 42cc4991976821d33b094a4d3787cd6b80a8fbdb)

4 months agomeson: Don't fail install script if file doesn't exist
Daan De Meyer [Thu, 5 Jun 2025 10:14:45 +0000 (12:14 +0200)] 
meson: Don't fail install script if file doesn't exist

Depending on which optional features are enabled, the NSS module
might not have been built, which means the custom install script
will fail to remove the file. Let's pass -f so it succeeds regardless
of whether the file exists or not.

(cherry picked from commit a292b55980d6ff2afd98deb9bcc3118cfcac4c67)
(cherry picked from commit 1a3f658f037e77b38e8645b8fbdadc84c2bb39d8)

4 months agoman: suggest using --unlock-tpm2-device=auto in cryptenroll example
Lennart Poettering [Thu, 5 Jun 2025 12:40:42 +0000 (14:40 +0200)] 
man: suggest using --unlock-tpm2-device=auto in cryptenroll example

When refreshing a tpm2 enrollment, it makes sense to use tpm2 to unlock
the device.

Fixes: #35279
(cherry picked from commit c91f1a3db864650166d1b635470119b5072d7c41)
(cherry picked from commit 3c826b06f2610acc69f7ca1c4551e934312d9b83)

4 months agoresolvectl: improve error message if we do not support dumping payload of RR
Lennart Poettering [Thu, 5 Jun 2025 10:43:36 +0000 (12:43 +0200)] 
resolvectl: improve error message if we do not support dumping payload of RR

(cherry picked from commit 231a0417cdb10a60e566900d5525cf7ee0dd9027)
(cherry picked from commit 9df7a197c28553f48ebde9df2f225cb93cebdf32)

4 months agoman: reword --raw= explanation a bit
Lennart Poettering [Thu, 5 Jun 2025 10:22:34 +0000 (12:22 +0200)] 
man: reword --raw= explanation a bit

Explain what we mean by "payload", and for which RR types this is
intended.

And don#t claim we'd output a full packet, because we don't. We output
only the RR in binary.

Fixes: #37737
(cherry picked from commit 317054365eb11d98ac9d2439ef537e2ee6a3228c)
(cherry picked from commit 968cc61b2fed7686b1569d3b73e0c9ffc131caa0)

4 months agoresolvectl: output slightly more data when --raw=payload is used
Lennart Poettering [Thu, 5 Jun 2025 10:17:01 +0000 (12:17 +0200)] 
resolvectl: output slightly more data when --raw=payload is used

Let's also show A/AAAA data in binary form if --raw=payload is used. For
these RR types there's only a single data field, hence it's obbviously
meant.

Inspired by: #37737

(cherry picked from commit 141894f53ac02115cfc9821125619dc782c01122)
(cherry picked from commit 8a78ab58cc5a4d96c2375fc2f86a94601b9a094d)

4 months agovmspawn: fix call to GetUnitByPID
Sam Leonard [Mon, 2 Jun 2025 15:13:13 +0000 (16:13 +0100)] 
vmspawn: fix call to GetUnitByPID

This commit also adds a handler for SIGRTMIN+4 which is another signal
used to shutdown systemd.

(cherry picked from commit 305e58936f06faa221ddb9cb9a60c2b3d57f083f)
(cherry picked from commit 6af05bbf2935189abdbfef302d4393694092b2c3)

4 months agoio-util: protect against INT_MAX overflow in flush_fd()
Lennart Poettering [Wed, 4 Jun 2025 14:05:41 +0000 (16:05 +0200)] 
io-util: protect against INT_MAX overflow in flush_fd()

(cherry picked from commit 874c4beb24ade904589bf672685752727cbb791e)
(cherry picked from commit 93fc50ec2b3f505e20774dda45b37f1b594a4226)

4 months agotest-network: extend comments how to run the test
Yu Watanabe [Wed, 4 Jun 2025 15:22:14 +0000 (00:22 +0900)] 
test-network: extend comments how to run the test

(cherry picked from commit 356e9bc0181f575e6c208d343f8e2eef151abc47)
(cherry picked from commit 1104de48472ab2a31f968e8b9a050dc6fa766580)

4 months agodoc: clarify that root storage daemons need unit files
Lennart Poettering [Wed, 4 Jun 2025 12:50:11 +0000 (14:50 +0200)] 
doc: clarify that root storage daemons need unit files

Fixes: #37700
(cherry picked from commit d1bacb0b8d311413413a666d23f1025c15a74757)
(cherry picked from commit 7a0336a4a6b3c50a06e8eb29d8ef0c3ad0938318)

4 months agodoc: mention 'exitrd' term
Lennart Poettering [Wed, 4 Jun 2025 12:50:07 +0000 (14:50 +0200)] 
doc: mention 'exitrd' term

(cherry picked from commit 59fe8d74b57f54d1d6b7da2b3fe5b82c18c48db1)
(cherry picked from commit 69e6a7b4288ab4ab0065289ff2b91287215954e8)

4 months agoresolved: honour SD_RESOLVED_NO_CNAME flag when processing cache
Lennart Poettering [Wed, 4 Jun 2025 08:53:50 +0000 (10:53 +0200)] 
resolved: honour SD_RESOLVED_NO_CNAME flag when processing cache

Fixes: #33300
Replaces: #35102
(cherry picked from commit 959d7f1759d67994e3bed7b9d2f23e063475a872)
(cherry picked from commit 8f1b7ec9edd4ce7d5ced86d29e659fda95dd95f3)

4 months agocompress: avoid a bunch of div-by-zeroes
Lennart Poettering [Tue, 3 Jun 2025 14:26:17 +0000 (16:26 +0200)] 
compress: avoid a bunch of div-by-zeroes

Follow-up for #37706. Implements the same logic for all compression
algorithms we have.

(cherry picked from commit d483ac1d0d26f1df5237d15765a8fa782ed0db08)
(cherry picked from commit f3b35c3e9384e0a33a72e83bcc979415df677f64)

4 months agorepart: if partition already exists, required size may not be multiple of grain size
Yu Watanabe [Fri, 18 Apr 2025 18:41:45 +0000 (03:41 +0900)] 
repart: if partition already exists, required size may not be multiple of grain size

See partition_min_size_with_padding().
Fixes #37178.

(cherry picked from commit cb109e00c45c8e92b1020e6249aac4a212e7f72d)
(cherry picked from commit 4e6d6d885d320c27deb63b8a5ae5b330c00a174c)

4 months agovmspawn: do not preserve access permissions and xattrs of template OVMF vars
Arian van Putten [Sun, 1 Jun 2025 10:02:55 +0000 (12:02 +0200)] 
vmspawn: do not preserve access permissions and xattrs of template OVMF vars

This makes vmspawn work when /usr/share/qemu/edk2-i386-vars.fd is on
disk with 0444 permissions as is the case on NixOS.

The nix package manager does not store any access permissions, ownership,
timestamps, or extended attributes in its package format to increase
reproducibility. The only meta-data that is stored is the executable bit.

Thus when unpacking a nix package, the executable bit is preserved, but no other
access permissions are preserved and all files in /nix/store end up as
read-only.

This causes the template OVMF vars file to have 0444 permissions. If we preserve
those permissions when copying the template file to /tmp that means QEMU can not
write to the file and fails.

So lets not preserve permissions and keep the 0600 permissions that are set by
default.

(cherry picked from commit 96e481bfbd6c52aabc72116f7ff479f11baeead1)
(cherry picked from commit e9c4962cefe786aa6e563bc79657f9f56d0349c5)

4 months agocompress: prevent divide-by-zero when no data is read (#37706)
Alex [Tue, 3 Jun 2025 01:51:00 +0000 (21:51 -0400)] 
compress: prevent divide-by-zero when no data is read (#37706)

If the first call to `loop_read()` returns 0 (no input), `total_in`
remains 0, causing `total_out/total_in` to potential divide by zero.

We add a check before logging the compression ratio to skip the
percentage calculation when total_in is zero.

Co-authored-by: jinyaoguo <guo846@purdue.edu>
(cherry picked from commit 2584f745e0509472e68449bd81c60c26056d514a)
(cherry picked from commit 18a42e321d699e7f3ae46930fa070228d02774ed)

4 months agonetwork: fix a potential divide-by-zero (#37705)
Alex [Mon, 2 Jun 2025 22:47:49 +0000 (18:47 -0400)] 
network: fix a potential divide-by-zero (#37705)

In function `tc_init`, hz is parsed from the content of file
`"/proc/net/psched"` and can be 0.
In function `hierarchy_token_bucket_class_verify`, hz is directly used
as a divisor in
`htb->buffer = htb->rate / hz + htb->mtu;` without any check. This adds a check on hz before using it as a divisor.

Co-authored-by: jinyaoguo <guo846@purdue.edu>
(cherry picked from commit 1a596054a0f937bfc244580f07510759a0e45657)
(cherry picked from commit e2c9fdd5c0f84eb234e122fe8fce9c4d949882cd)

4 months agorepart: fix generation of UUID= line for vfat in fstab entries
Lennart Poettering [Mon, 2 Jun 2025 08:12:10 +0000 (10:12 +0200)] 
repart: fix generation of UUID= line for vfat in fstab entries

Fixes: #36735
(cherry picked from commit 8504721e0e758aadf454141de014fe28d14cefcd)
(cherry picked from commit ddddef495d7f59db6040d89336c1eeccc7251fce)

4 months agobootctl: fix unclosed quote in debug log
Joaquim Monteiro [Sat, 31 May 2025 18:56:28 +0000 (19:56 +0100)] 
bootctl: fix unclosed quote in debug log

(cherry picked from commit c9e614eb256ec2591170c1b840558103dfa3d2b0)
(cherry picked from commit 4af9f5044a352fc0d67b3eb57ae09b595f724eee)

4 months agomount-util: avoid unnecessary mount_setattr() call in make_fsmount()
Lennart Poettering [Sat, 31 May 2025 05:58:30 +0000 (07:58 +0200)] 
mount-util: avoid unnecessary mount_setattr() call in make_fsmount()

If .attr_set is zero (and .att_clr, .propagation too), then there's no
point in calling mount_setattr().

Fixes: #37062
Note that this optimization is not precisely load-bearing anymore, since
3cc23a2c2345eb188551565349c89ec1fa8f650f got merged which removes the
only caller of make_fsmount() that might trigger it. But it's worth
fixing generic code anyway, in case it gets used like this later again.

(cherry picked from commit 249752d1ecd0f8e160d6e8633f71771b51db5a84)
(cherry picked from commit 77babb252d94e1e9e46f0cdb13d198bd1e4e5958)

4 months agotest: wait for coredump to appear before parsing
Luca Boccassi [Fri, 30 May 2025 21:08:39 +0000 (22:08 +0100)] 
test: wait for coredump to appear before parsing

A new core was added to the test, but the loop counter was not increased
to wait for it, so the test races against systemd-coredump's processing.

This failed at least once in debci:

8015s [   32.227813] TEST-87-AUX-UTILS-VM.sh[1038]: + coredumpctl info COREDUMP_TIMESTAMP=1679509902000000
8015s [   32.228684] TEST-87-AUX-UTILS-VM.sh[1723]: No coredumps found.

Follow-up for 0c49e0049b7665bb7769a13ef346fef92e1ad4d6

Fixes https://github.com/systemd/systemd/issues/37666

(cherry picked from commit 703fbb0bba7f1a1b46342d6efedda30e51d46135)
(cherry picked from commit ccbad62c42ab8e00b824aaa22036cc5cc65ab203)

4 months agosync-docs: add '(latest stable)' next to the latest version in the menu
Luca Boccassi [Fri, 30 May 2025 01:03:08 +0000 (02:03 +0100)] 
sync-docs: add '(latest stable)' next to the latest version in the menu

Add visual indicator of what is the latest version in the
version menu

(cherry picked from commit 90b0222091e23ed21ecf7dacc9f885e72bcdfdc5)
(cherry picked from commit 1b4abc331415147e00fbbdef5dbf7282f44f970b)

4 months agosync-docs: fix selection menu when opening 'latest' man
Luca Boccassi [Fri, 30 May 2025 01:02:01 +0000 (02:02 +0100)] 
sync-docs: fix selection menu when opening 'latest' man

'devel' will always sort first, so the highest version is the second
entry, not the first one

(cherry picked from commit 1cd995185bcd0ea3612ebaee2c311a5f36b2fa64)
(cherry picked from commit 5b7dccd5dd8fc44e86f6e5054450035be2e3b52a)

4 months agosync-docs: fix syntax warning
Luca Boccassi [Fri, 30 May 2025 00:59:15 +0000 (01:59 +0100)] 
sync-docs: fix syntax warning

sync-docs.py:94: SyntaxWarning: invalid escape sequence '\d'
  m = re.match("v?(\d+).*", tag)

(cherry picked from commit 34d63ac87930ab64cb0f7b9a956ee91ba29148f0)
(cherry picked from commit 2518c6261864bc405d6bc7d275faece62d71cf65)

4 months agosysupdate: change status once operation has completed
Luca Boccassi [Wed, 28 May 2025 23:36:47 +0000 (00:36 +0100)] 
sysupdate: change status once operation has completed

Otherwise after the service exits it will still show
"Installing 'foobar'" as the status, which is confusing

(cherry picked from commit 5cfc9c34f4a38cc82c233e453373d48231944d81)
(cherry picked from commit 0e502d986b724f195385ad99f7f214d8586fec7f)

4 months agossh-generator: add missing newline before [Service] and trailing NL to generated...
Mike Yuan [Wed, 28 May 2025 20:30:46 +0000 (22:30 +0200)] 
ssh-generator: add missing newline before [Service] and trailing NL to generated service

(cherry picked from commit e72bd8dbc867dbd68fa48b22f258feeb7760caa6)
(cherry picked from commit 654c60ba171aa47a466f91557f058fa30e7f7234)

4 months agossh-generator: fix typo
Mike Yuan [Wed, 28 May 2025 20:30:39 +0000 (22:30 +0200)] 
ssh-generator: fix typo

(cherry picked from commit 0aa4c3f0f90f22b566b3c1002ccdce5ab5fb4062)
(cherry picked from commit 2fc4bc803c6eb8abbc6684a5be66cb9daa817cd0)

4 months agotest-network: add test case for issue #37629
Yu Watanabe [Tue, 27 May 2025 14:31:48 +0000 (23:31 +0900)] 
test-network: add test case for issue #37629

(cherry picked from commit b1bed07d84d76f3ab2f11a42fefce2685dbbe685)
(cherry picked from commit a11a8221019a3c364e783052e18dcf438fa3dace)

4 months agonetwork/link: update state file when master ifindex is changed
Yu Watanabe [Tue, 27 May 2025 17:09:52 +0000 (02:09 +0900)] 
network/link: update state file when master ifindex is changed

If master ifindex is non-zero, then the carrier state and operational
state of the interface may be the enslaved state.
As the operational state is saved in link state file, and read by
wait-online, we need to update the state file when the master ifindex is
changed.

(cherry picked from commit 7dde00ca57cf20a5d71e580d0bc6173f454095e5)
(cherry picked from commit e9655c7865d632bd05437f8ebd4264a13b8011e4)

4 months agonetwork/link: ENODATA from reading IFLA_MASTER when an interface has no master
Yu Watanabe [Tue, 27 May 2025 14:17:40 +0000 (23:17 +0900)] 
network/link: ENODATA from reading IFLA_MASTER when an interface has no master

When an interface leaved from the master interface, then reading
IFLA_MASTER attribute causes ENODATA. When the interface was previously
enslaved to another interface, we need to remove reference to the
interface from the previous master interface.

This is especially important when
```
ip link set dev eth0 nomaster
```
is called.

Fixes a bug introduced by 0d411b7f8f5407e9ce84dcb4ede0b029ade7fede (v249).
Fixes #37629.

(cherry picked from commit f44b20b7b6c6b0a089a3ec2392ac85e4772e0357)
(cherry picked from commit 2ad46c06069ad4241c94124dd5a3a73da7828048)

4 months agoman/systemd.timer: Correct inaccuracy in man page
Adrian Vovk [Tue, 18 Feb 2025 20:59:03 +0000 (15:59 -0500)] 
man/systemd.timer: Correct inaccuracy in man page

The docs previously stated that RandomizedDelaySec is applied onto the
next scheduled time, but after 9fa326b18aef0c1e5c80e23a5b41de02155e6f7e
this is no longer the case.

I also reworded FixedRandomDelay= slightly, to make it a bit clearer

(cherry picked from commit fca20a1be69d0ffe3067e5c8676d75b5f8af1a5d)
(cherry picked from commit 0930949e64cd91e366865e104a295ddc83170fdd)

4 months agomkosi: install util-linux-systemd in SUSE
Luca Boccassi [Tue, 3 Jun 2025 17:54:52 +0000 (18:54 +0100)] 
mkosi: install util-linux-systemd in SUSE

Some tools (findmnt, logger, lsblk, lslogins) got moved to a
new util-linux-systemd package in Tumbleweed so install it explicitly

(cherry picked from commit aba73b88a224f03c9fdddb2a410bbb29a4d395aa)
(cherry picked from commit b3339c8df5313383bf136d9b6e01092f1d808fd0)

4 months agodocs: fix mkosi section for Environment= setting
Yu Watanabe [Tue, 15 Apr 2025 23:30:25 +0000 (08:30 +0900)] 
docs: fix mkosi section for Environment= setting

(cherry picked from commit f477751b10178d2a5b8c6a186b03fcc04479cbd9)
(cherry picked from commit 329945c70524bd61c3bff4b18814b3eaf3f01428)

4 months agomkosi: Set mitigations=off
Daan De Meyer [Tue, 8 Apr 2025 16:56:39 +0000 (18:56 +0200)] 
mkosi: Set mitigations=off

Might as well disable mitigations for these VMs. Who knows, maybe it'll
speed something up.

(cherry picked from commit 36645ec255b1508a76e3d07efb129616e89ca3ac)
(cherry picked from commit 9f549793eed325fce7da462beeb7a9731109d689)

5 months agomeson: bump version to 256.16 v256.16
Luca Boccassi [Thu, 29 May 2025 18:45:42 +0000 (19:45 +0100)] 
meson: bump version to 256.16

5 months agoRevert "man: remove version-info.xml tag, does not exist on this branch"
Luca Boccassi [Thu, 29 May 2025 18:44:43 +0000 (19:44 +0100)] 
Revert "man: remove version-info.xml tag, does not exist on this branch"

This is not applicable to the v255-stable branch, and it breaks a unit
test:

1287/1652 systemd:dist / check-version-history    FAIL     1.62s   exit status 1

This reverts commit d73cf4cf06cd9e3ae01cfd66ecf51bbb4ebebdfa.

5 months agoman: fix copy-and-paste error
Yu Watanabe [Mon, 18 Nov 2024 06:18:23 +0000 (15:18 +0900)] 
man: fix copy-and-paste error

Follow-up for 85a1360ecffd8929151e09279ea62dedea364dfa.

(cherry picked from commit 4d9cac56db1d74908e278d016f0520f5d2f6af0f)

5 months agoman: add several future version info tags
Yu Watanabe [Mon, 18 Nov 2024 06:04:17 +0000 (15:04 +0900)] 
man: add several future version info tags

(cherry picked from commit 85a1360ecffd8929151e09279ea62dedea364dfa)

5 months agomeson: bump version to 256.15 v256.15
Zbigniew JÄ™drzejewski-Szmek [Thu, 29 May 2025 17:51:20 +0000 (19:51 +0200)] 
meson: bump version to 256.15

5 months agoman: remove version-info.xml tag, does not exist on this branch
Luca Boccassi [Thu, 29 May 2025 17:41:44 +0000 (18:41 +0100)] 
man: remove version-info.xml tag, does not exist on this branch

Follow-up for 7fc7aa5a4d28d7768dfd1eb85be385c3ea949168

(cherry picked from commit 04e9e27e2760b2df014195ca2a66193f28ae99cc)

5 months agomeson: bump version to 256.14 v256.14
Zbigniew JÄ™drzejewski-Szmek [Thu, 29 May 2025 16:42:40 +0000 (18:42 +0200)] 
meson: bump version to 256.14

5 months agocoredump: get rid of a bogus assertion
Zbigniew JÄ™drzejewski-Szmek [Mon, 26 May 2025 13:24:04 +0000 (15:24 +0200)] 
coredump: get rid of a bogus assertion

The check looks plausible, but when I started checking whether it needs
to be lowered for the recent changes, I realized that it doesn't make
much sense.

context_parse_iovw() is called from a few places, e.g.:
- process_socket(), where the other side controls the contents of the
  message. We already do other checks on the correctness of the message
  and this assert is not needed.
- gather_pid_metadata_from_argv(), which is called after
  inserting MESSAGE_ID= and PRIORITY= into the array, so there is no
  direct relation between _META_ARGV_MAX and the number of args in the
  iovw.
- gather_pid_metadata_from_procfs(), where we insert a bazillion fields,
  but without any relation to _META_ARGV_MAX.

Since we already separately check if the required stuff was set, drop this
misleading check.

(cherry picked from commit 13902e025321242b1d95c6d8b4e482b37f58cdef)
(cherry picked from commit 4c424072b3cc6a68265345cef2d29a6903081dcf)

5 months agocoredump: also stop forwarding non-dumpable processes
Zbigniew JÄ™drzejewski-Szmek [Mon, 5 May 2025 13:48:40 +0000 (15:48 +0200)] 
coredump: also stop forwarding non-dumpable processes

See the comment in the patch for details.

Suggested-by: Qualys Security Advisory <qsa@qualys.com>
(cherry-picked from 8fc7b2a211eb13ef1a94250b28e1c79cab8bdcb9)
(cherry-picked from 101058955eb41023e0dba5766f6bfb190ebbb4f6)

5 months agocoredump: use %d in kernel core pattern
Zbigniew JÄ™drzejewski-Szmek [Tue, 29 Apr 2025 12:47:59 +0000 (14:47 +0200)] 
coredump: use %d in kernel core pattern

The kernel provides %d which is documented as
"dump mode—same as value returned by prctl(2) PR_GET_DUMPABLE".

We already query /proc/pid/auxv for this information, but unfortunately this
check is subject to a race, because the crashed process may be replaced by an
attacker before we read this data, for example replacing a SUID process that
was killed by a signal with another process that is not SUID, tricking us into
making the coredump of the original process readable by the attacker.

With this patch, we effectively add one more check to the list of conditions
that need be satisfied if we are to make the coredump accessible to the user.

Reportedy-by: Qualys Security Advisory <qsa@qualys.com>
(cherry-picked from 0c49e0049b7665bb7769a13ef346fef92e1ad4d6)
(cherry-picked from c58a8a6ec9817275bb4babaa2c08e0e35090d4e3)

5 months agocoredump: get rid of _META_MANDATORY_MAX
Zbigniew JÄ™drzejewski-Szmek [Mon, 26 May 2025 10:04:44 +0000 (12:04 +0200)] 
coredump: get rid of _META_MANDATORY_MAX

No functional change. This change is done in preparation for future changes.
Currently, the list of fields which are received on the command line is a
strict subset of the fields which are always expected to be received on a
socket. But when we add new kernel args in the future, we'll have two
non-overlapping sets and this approach will not work. Get rid of the variable
and enumerate the required fields. This set will never change, so this is
actually more maintainable.

The message with the hint where to add new fields is switched with
_META_ARGV_MAX. The new order is more correct.

(cherry-picked from 49f1f2d4a7612bbed5211a73d11d6a94fbe3bb69)
(cherry-picked from aea6a631bca93e8b04a11aaced694f25f4da155e)

5 months agotest: fix TEST-84-STORAGETM with nvme-cli < 2.7
Luca Boccassi [Wed, 28 May 2025 22:48:27 +0000 (23:48 +0100)] 
test: fix TEST-84-STORAGETM with nvme-cli < 2.7

The -vv parameter was added in version 2.7, check before using it

Follow-up for ebc0514a6507d51e536b269e30a036a7992beeb7

(cherry picked from commit 60491ceb12aac9f2b9423490158bd9291d735b36)
(cherry picked from commit f75ca4648efd92e6a7a5a244a5de09187a30e43c)

5 months agoCI: drop .packit.yml
Luca Boccassi [Wed, 28 May 2025 12:24:12 +0000 (13:24 +0100)] 
CI: drop .packit.yml

It fails on this branch, and nobody knows how to fix it:

'Cannot create a new Copr project (owner=packit project=systemd-systemd-37643 chroots=[]): chroots: '[]' is not a valid choice for this field..'

Disable it, as it just generates noise

5 months agocore/manager: do not pop gc_unit_queue before unit_gc_sweep()
Mike Yuan [Sat, 17 May 2025 14:59:32 +0000 (16:59 +0200)] 
core/manager: do not pop gc_unit_queue before unit_gc_sweep()

Follow-up for 52e3671bf7e6321c58c6d3a6c8ad8e167259a569

unit_gc_sweep() might try to add the unit to gc queue again.
While that becomes no-op as Unit.in_gc_queue is not cleared
yet, it induces minor inconsistency of states.

(cherry picked from commit 741a184a31127305fb4363833ca9d97a1057fc68)
(cherry picked from commit 9645e946f9e323965116d89fce8009cc86418c9d)

5 months agotest: fix test_qdisc_tbf regex with iproute2 v6.15
Luca Boccassi [Tue, 27 May 2025 13:56:32 +0000 (14:56 +0100)] 
test: fix test_qdisc_tbf regex with iproute2 v6.15

iproute2 v6.15 fixed some rounding errors in the reported stats:

https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=d947f365602b30657d1b797e7464000d0ab88d5a

so the current regex doesn't work anymore. Fix it to check for both
old and new values.

systemd-networkd-tests.py[523]: FAIL: test_qdisc_tbf (__main__.NetworkdTCTests.test_qdisc_tbf)
systemd-networkd-tests.py[523]: ----------------------------------------------------------------------
systemd-networkd-tests.py[523]: Traceback (most recent call last):
systemd-networkd-tests.py[523]:   File "/usr/lib/systemd/tests/testdata/test-network/systemd-networkd-tests.py", line 5402, in test_qdisc_tbf
systemd-networkd-tests.py[523]:     self.assertRegex(output, 'rate 1Gbit burst 5000b peakrate 100Gbit minburst 987500b lat 70(.0)?ms')
systemd-networkd-tests.py[523]:     ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
systemd-networkd-tests.py[523]: AssertionError: Regex didn't match: 'rate 1Gbit burst 5000b peakrate 100Gbit minburst 987500b lat 70(.0)?ms' not found in 'qdisc tbf 35: root refcnt 2 rate 1Gbit burst 5000b peakrate 100Gbit minburst 999200b lat 70ms \nqdisc pfifo 37: parent 35: limit 100000p'

(cherry picked from commit f9a85b74903f5588d08f54ea7d9b53edc639b824)
(cherry picked from commit 6e67969b10d111177f72a53f9f7158bf9f14d2a3)

5 months agohomed: generate proper error if we cannot create mountpoint for homedir
Lennart Poettering [Fri, 23 May 2025 10:15:45 +0000 (12:15 +0200)] 
homed: generate proper error if we cannot create mountpoint for homedir

Let's make this easier to debug. (When this failed for me due to disk
full it took me a bit to figure out what was going on.)

(cherry picked from commit 5b759bf5fd3a915a5b4756590caff7faf43a9693)
(cherry picked from commit 8158c87c36d5725818a2a9cda4270b8839553f86)

5 months agodocs: add man pages for sd_device_enumerator_[new,ref,unref,unrefp] (#37586)
Shubhendra Kushwaha [Sat, 24 May 2025 20:01:27 +0000 (01:31 +0530)] 
docs: add man pages for sd_device_enumerator_[new,ref,unref,unrefp] (#37586)

For #20929.

(cherry picked from commit ac8ed83947237956b867de9cfbf5fcd26de8ea96)
(cherry picked from commit 17e5c276b90f45bd0ed496352d254105ecdea935)

5 months agojournald: clarify doc for usage-related values cap (#37528)
TheHillBright [Wed, 21 May 2025 10:38:12 +0000 (18:38 +0800)] 
journald: clarify doc for usage-related values cap (#37528)

The old description makes users wrongly assume that the cap of 4G
applied, even when the user specifies a value that will result in higher
than 4G. This commit avoids this misunderstanding.

(cherry picked from commit 33084145315029775748a89da836465783d65bb3)
(cherry picked from commit 137d765b2d01dc93a0ec182654ddf4b9b4114bcf)

5 months agoshell-completion: improve completion of systemd-tmpfiles
Eisuke Kawashima [Thu, 15 May 2025 22:46:46 +0000 (07:46 +0900)] 
shell-completion: improve completion of systemd-tmpfiles

(cherry picked from commit b9df3d6447955e59f4e83e2b10ca97d4a484a6a5)
(cherry picked from commit 8462cb0b9dd502a31df23745b74791a7fe74fb32)

5 months agonetwork: do not drop duplicated entries in loop
Yu Watanabe [Wed, 14 May 2025 21:36:55 +0000 (06:36 +0900)] 
network: do not drop duplicated entries in loop

Fixes #37456.

(cherry picked from commit 6a4fe38f7fed6b1a94caad49c5aa3dd102658df4)
(cherry picked from commit 936cba12c9ab098948b996723cde42b613343f8c)

5 months agoman: correct version information when $REMOTE_ADDR/$REMOTE_PORT where added
Lennart Poettering [Thu, 15 May 2025 07:44:02 +0000 (09:44 +0200)] 
man: correct version information when $REMOTE_ADDR/$REMOTE_PORT where added

This was in commit 3b1c524154c876aecebc98787975cc2943100210, i.e. in the
v220 cycle.

(cherry picked from commit 3bdcd994cd707bcf34664edaa21afff6025d15d2)
(cherry picked from commit 89b4f52775fdd455990a54094bf61d5f71c7d4ed)

5 months agoman/systemd-run: --wait shows more than CPU accounting data
Mike Yuan [Wed, 14 May 2025 16:47:16 +0000 (18:47 +0200)] 
man/systemd-run: --wait shows more than CPU accounting data

(cherry picked from commit 72594d6771a68fbb7d5ebe1d004f4d942a1fac97)
(cherry picked from commit b7acbc464b38e1bee42a993b1bd0346d8e5c186f)

5 months agoTEST-73-LOCALE: skip lv keymap and friends
Yu Watanabe [Fri, 9 May 2025 07:33:12 +0000 (16:33 +0900)] 
TEST-73-LOCALE: skip lv keymap and friends

The following failure should be in libxkbcommon and/or sanitizer.
There is nothing we can do here. Let's skip it.

```
TEST-73-LOCALE.sh[3733]: + assert_rc 0 localectl set-keymap lv
TEST-73-LOCALE.sh[6699]: + set +ex
TEST-73-LOCALE.sh[6700]: Failed to set keymap: Remote peer disconnected
TEST-73-LOCALE.sh[6703]: FAIL: expected: '0' actual: '1'
TEST-73-LOCALE.sh[157]: + rm -f /etc/dbus-1/system.d/systemd-localed-read-only.conf
[FAILED] Failed to start TEST-73-LOCALE.service - TEST-73-LOCALE.
```
```
==3719==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7fa51f161000 at pc 0x7fa521250be4 bp 0x7ffe49130a80 sp 0x7ffe49130240
READ of size 19126 at 0x7fa51f161000 thread T0
    #0 0x7fa521250be3 in strndup (/usr/lib/clang/20/lib/x86_64-redhat-linux-gnu/libclang_rt.asan.so+0x50be3) (BuildId: aa6231e817f72469c44a6c6cee9f0694a87db7fb)
    #1 0x7fa51f128325  (/lib64/libxkbcommon.so.0+0x1c325) (BuildId: 72e8cb985db37963272d140f7b2aee551c465ff5)
    #2 0x7fa51f121952  (/lib64/libxkbcommon.so.0+0x15952) (BuildId: 72e8cb985db37963272d140f7b2aee551c465ff5)
    #3 0x7fa51f123d3a  (/lib64/libxkbcommon.so.0+0x17d3a) (BuildId: 72e8cb985db37963272d140f7b2aee551c465ff5)
    #4 0x7fa51f117c86  (/lib64/libxkbcommon.so.0+0xbc86) (BuildId: 72e8cb985db37963272d140f7b2aee551c465ff5)
    #5 0x7fa51f12548f  (/lib64/libxkbcommon.so.0+0x1948f) (BuildId: 72e8cb985db37963272d140f7b2aee551c465ff5)
    #6 0x7fa51f125c9e  (/lib64/libxkbcommon.so.0+0x19c9e) (BuildId: 72e8cb985db37963272d140f7b2aee551c465ff5)
    #7 0x7fa51f126a59  (/lib64/libxkbcommon.so.0+0x1aa59) (BuildId: 72e8cb985db37963272d140f7b2aee551c465ff5)
    #8 0x7fa51f12cec6  (/lib64/libxkbcommon.so.0+0x20ec6) (BuildId: 72e8cb985db37963272d140f7b2aee551c465ff5)
    #9 0x7fa51f12e3c2  (/lib64/libxkbcommon.so.0+0x223c2) (BuildId: 72e8cb985db37963272d140f7b2aee551c465ff5)
    #10 0x7fa51f12a4e5 in xkb_keymap_new_from_names (/lib64/libxkbcommon.so.0+0x1e4e5) (BuildId: 72e8cb985db37963272d140f7b2aee551c465ff5)
    #11 0x5574dd63f864 in verify_xkb_rmlvo /usr/src/debug/systemd/src/locale/xkbcommon-util.c:69:14
(snip)
```

(cherry picked from commit 18609909d93a4d17e962b47e51fffe38845e99f5)
(cherry picked from commit 5d7d60b8dd01282adbe89084b479a51aaff4cf47)

5 months agocoredump: restore compatibility with older patterns
Zbigniew JÄ™drzejewski-Szmek [Tue, 29 Apr 2025 12:47:59 +0000 (14:47 +0200)] 
coredump: restore compatibility with older patterns

This was broken in f45b8015513d38ee5f7cc361db9c5b88c9aae704. Unfortunately
the review does not talk about backward compatibility at all. There are
two places where it matters:
- During upgrades, the replacement of kernel.core_pattern is asynchronous.
  For example, during rpm upgrades, it would be updated a post-transaction
  file trigger. In other scenarios, the update might only happen after
  reboot. We have a potentially long window where the old pattern is in
  place. We need to capture coredumps during upgrades too.
- With --backtrace. The interface of --backtrace, in hindsight, is not
  great. But there are users of --backtrace which were written to use
  a specific set of arguments, and we can't just break compatiblity.
  One example is systemd-coredump-python, but there are also reports of
  users using --backtrace to generate coredump logs.

Thus, we require the original set of args, and will use the additional args if
found.

A test is added to verify that --backtrace works with and without the optional
args.

(cherry picked from commit ded0aac389e647d35bce7ec4a48e718d77c0435b)
(cherry picked from commit f9b8b75c11bba9b63096904be98cc529c304eb97)

5 months agoRevert "core/socket: do not enter failed state when we cannot start service due to...
Luca Boccassi [Tue, 20 May 2025 13:13:07 +0000 (14:13 +0100)] 
Revert "core/socket: do not enter failed state when we cannot start service due to conflicting transaction being queued"

This reverts commit 03be978776f90f28195e412a5babdbd2aba96752.

Post-merge review found problems:
https://github.com/systemd/systemd/pull/37222#pullrequestreview-2848299600

5 months agoRevert "units: stop systemd-udevd before soft-reboot"
Luca Boccassi [Tue, 20 May 2025 13:13:06 +0000 (14:13 +0100)] 
Revert "units: stop systemd-udevd before soft-reboot"

This reverts commit fd7b8e12aa9437ecc4df8ba1d0ad11972601f65f.

Post-merge review found problems:
https://github.com/systemd/systemd/pull/37222#pullrequestreview-2848299600

5 months agoRevert "TEST-82-SOFTREBOOT: add test case for uevents generated during soft-reboot"
Luca Boccassi [Tue, 20 May 2025 13:13:05 +0000 (14:13 +0100)] 
Revert "TEST-82-SOFTREBOOT: add test case for uevents generated during soft-reboot"

This reverts commit e8b3b46921ee5aacd9f5d5132c64af79b685d941.

Post-merge review found problems:
https://github.com/systemd/systemd/pull/37222#pullrequestreview-2848299600

5 months agopager: also check for $SUDO_UID
Zbigniew JÄ™drzejewski-Szmek [Tue, 6 May 2025 12:29:02 +0000 (14:29 +0200)] 
pager: also check for $SUDO_UID

This returns to the original approach proposed in
https://github.com/systemd/systemd/pull/17270. After review, the approach was
changed to use sd_pid_get_owner_uid() instead. Back then, when running in a
typical graphical session, sd_pid_get_owner_uid() would usually return the user
UID, and when running under sudo, geteuid() would return 0, so we'd trigger the
secure path.

sudo may allocate a new session if is invoked outside of a session (depending
on the PAM config). Since nowadays desktop environments usually start the user
shell through user units, the typical shell in a terminal emulator is not part
of a session, and when sudo is invoked, a new session is allocated, and
sd_pid_get_owner_uid() returns 0 too. Technically, the code still works as
documented in the man page, but in the common case, it doesn't do the expected
thing.

$ build/test-sd-login |& rg 'get_(owner_uid|cgroup|session)'
sd_pid_get_session(0) â†’ No data available
sd_pid_get_owner_uid(0) â†’ 1000
sd_pid_get_cgroup(0) â†’ /user.slice/user-1000.slice/user@1000.service/app.slice/app-ghostty-transient-5088.scope/surfaces/556FAF50BA40.scope

$ sudo build/test-sd-login |& rg 'get_(owner_uid|cgroup|session)'
sd_pid_get_session(0) â†’ c289
sd_pid_get_owner_uid(0) â†’ 0
sd_pid_get_cgroup(0) â†’ /user.slice/user-0.slice/session-c289.scope

I think it's worth checking for sudo because it is a common case used by users.
There obviously are other mechanims, so the man page is extended to say that
only some common mechanisms are supported, and to (again) recommend setting
SYSTEMD_LESSSECURE explicitly. The other option would be to set "secure mode"
by default. But this would create an inconvenience for users doing the right
thing, running systemctl and other tools directly, because then they can't run
privileged commands from the pager, e.g. to save the output to a file. (Or the
user would need to explicitly set SYSTEMD_LESSSECURE. One option would be to
set it always in the environment and to rely on sudo and other tools stripping
it from the environment before running privileged code. But that is also fairly
fragile and it obviously relies on the user doing a complicated setup to
support a fairly common use case. I think this decreases usability of the
system quite a bit. I don't think we should build solutions that work in
priniciple, but are painfully inconvenient in common cases.)

Fixes https://yeswehack.com/vulnerability-center/reports/346802.

Also see https://github.com/polkit-org/polkit/pull/562, which adds support for
$SUDO_UID/$SUDO_GID to pkexec.

(cherry picked from commit cd93478af8b9dc69478d5667f113b67d175090fa)
(cherry picked from commit b93f53c122124582fa80ae246343791063d65074)

5 months agoman: rework the description of $SYSTEMD_PAGER and $PAGER
Zbigniew JÄ™drzejewski-Szmek [Tue, 6 May 2025 09:37:26 +0000 (11:37 +0200)] 
man: rework the description of $SYSTEMD_PAGER and $PAGER

$PAGER wasn't documented, but actually we treat it same as $SYSTEMD_PAGER,
except for lower priority. And the two variables can be used to disable the
pager, even if $SYSTEMD_PAGERSECURE is not set.

Behaviour is (obviously) not changed by this patch, it intentionally just
updates the docs to match the code.

(cherry picked from commit b6b78170e17727ca0ec320d5703b36d0597d0cc9)
(cherry picked from commit affb45d6b2dfdb3a87da2e0241be8c5c5c9a9d8f)

5 months agoman: reword the description of "secure pager" handling
Zbigniew JÄ™drzejewski-Szmek [Tue, 6 May 2025 09:14:10 +0000 (11:14 +0200)] 
man: reword the description of "secure pager" handling

The existing description was not *wrong*, but it was a bit muddled. Let's
reorder the text to give a short intro and then describe what the options
actually do and the clear "true" and "false" cases first, and then describe
autodetection.

Related to https://yeswehack.com/vulnerability-center/reports/346802.

(cherry picked from commit 718dbdb2ca4458cf91711cd9a7de3a972e46658e)
(cherry picked from commit d8659058f40186f07799bc2a8e624aece33412ac)

5 months agosystemct: show all in output of systemctl clean --what=help
Jörg Behrmann [Tue, 13 May 2025 15:21:02 +0000 (17:21 +0200)] 
systemct: show all in output of systemctl clean --what=help

(cherry picked from commit 68b6289a9e4a8a9cc3567f066f921388e99da9d9)
(cherry picked from commit f9e68aa2b5dd14e0be29d13ea0c45f50bfe6b986)

5 months agoman: note for systemctl clean --what that commas separate values
Jörg Behrmann [Tue, 13 May 2025 15:20:37 +0000 (17:20 +0200)] 
man: note for systemctl clean --what that commas separate values

(cherry picked from commit 652e4dd7434d1603866c059aa8a67eaf8b73346f)
(cherry picked from commit 2d5982e4f2c76e41fa1d5524fcbcdfcbecdf656c)

5 months agoman, systemctl: document --what=help
Jörg Behrmann [Tue, 13 May 2025 15:19:39 +0000 (17:19 +0200)] 
man, systemctl: document --what=help

(cherry picked from commit 028de7292d6923c4b77c5d03d47097aeda24fc1d)
(cherry picked from commit d865854eae9d11e755f5f12e043d5e741c4a1fe1)

5 months agoman: add missing fdstore in systemctl clean --what documentation
Jörg Behrmann [Tue, 13 May 2025 15:19:02 +0000 (17:19 +0200)] 
man: add missing fdstore in systemctl clean --what documentation

(cherry picked from commit 5689365a909362d82ad4959d3fec9ebacfd5ec96)
(cherry picked from commit cca8e2077f982e5cf636137a92eb7f177a0b4a29)