1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-13 12:58:20 +03:00

69991 Commits

Author SHA1 Message Date
Luca Boccassi
799ecea375 hwdb: update to main@{2024-09-10}
git restore -s origin/main hwdb.d/ test/hwdb.d

(cherry picked from commit f13e3a93d7c2c549ff9a83cdbb04c30ab9e46bea)
v255.12
2024-09-10 22:33:00 +02:00
Yu Watanabe
a505f10b4b tree-wide: check if non-empty password is acquired
(cherry picked from commit 204529d0fcde9a95119b489225620f36649c2f5b)
(cherry picked from commit e80e9dce63787d1d4494ed65d7c27018344387d5)
2024-09-10 22:33:00 +02:00
Yu Watanabe
553d5b03bd ask-password: refuse empty password strv
Fixes #34270.

(cherry picked from commit 623a8b1922bdbd2fb06bc5f2c67d3d6930efc58e)
(cherry picked from commit 34881c9d5afdd05e9e6f1824cbea9d1954ea80c0)
2024-09-10 22:33:00 +02:00
Yu Watanabe
6c44b31673 test: fix indentation
(cherry picked from commit fe6049d0210c89a595ae598d87dcefe7bfbe3a1d)
(cherry picked from commit dda8cb4a8ef702ba526f0c2021c92fa85431330b)
2024-09-10 22:33:00 +02:00
Yu Watanabe
fbfe769c45 test: add test case for systemd-repart --seed=random
For issue #34257.

(cherry picked from commit 56d6ebd40468e2a743b39ad7d87b0675bdf9a042)
(cherry picked from commit 69282da9aab90c2dc1e440b04af5b2163779515a)
2024-09-10 22:33:00 +02:00
Yu Watanabe
175dafa27b repart: initialize seed earlier
As the seed is used by context_load_partition_table() -> derive_uuid().

Fixes #34257.

(cherry picked from commit b8a8000aba4620a1d93ac1d04dbb86050d9c5fe8)
(cherry picked from commit f85a4fba330822c44f9b2deb527acecc03bcfed9)
2024-09-10 22:33:00 +02:00
Yu Watanabe
bc72d9557c nspawn: refuse to bind mount device node from host when --private-users= is specified
Also do not chown if a device node is bind-mounted.

Fixes #34243.

(cherry picked from commit efedb6b0f3cff37950112fd37cb750c16d599bc7)
(cherry picked from commit a23591891b9e85107f39d103eabbb5bc9a6ced6f)
2024-09-10 22:33:00 +02:00
Mike Yuan
a3872e60ae audit-util: check correct errno
(cherry picked from commit 190a0953808608b099f9465f9e786e4efe276c26)
(cherry picked from commit c90ae08b0a5f2844504a109f71dcd773c16d8260)
2024-09-10 22:33:00 +02:00
Daan De Meyer
7a3b3ad522 repart: Keep existing directory timestamps intact when copying
Otherwise, when merging multiple directory trees, the output becomes
unreproducible as the directory timestamps will be changed to the current
time when copying identical directories from the second tree.

We introduce a new copy flag to achieve this behavior.

(cherry picked from commit d850a544bc1f895decb452160c97a884a20b12b7)
(cherry picked from commit d5640c4f8583de2752a7f4e03006a1fa74942da1)
2024-09-10 22:33:00 +02:00
Daan De Meyer
4a86d30581 ukify: Skip test on architectures without UEFI
(cherry picked from commit 5121f7c45b37afca53c89f42123b1dd6a04fa80f)
(cherry picked from commit c355457fd349549b3f9187a9cb5e7e4bf9b6a184)
2024-09-10 22:33:00 +02:00
Ronan Pigott
6c243bbb70 resolved: clear the AD bit for bypass packets
When the bypass logic is invoked, such as for queries to the stub with
the DO bit set, be certain to clear the AD bit in the reply before
forwarding it if the answer is not known to be authentic.

(cherry picked from commit 13e15dae9f0b4566d3ea2ed058a5dd44751216da)
(cherry picked from commit 3a2be652282db2d55d5e28546e6c9a594fb8c43e)
2024-09-10 22:33:00 +02:00
Alyssa Ross
a573fd1848 bootctl: don't load etc/machine-info from cwd
arg_root defaults to null, so if --root isn't given, this would try reading
etc/machine-info from the current working directory, which is likely to fail.

Fixes: 77db9ef2ab ("boot: Make sure we take --root into account everywhere.")
(cherry picked from commit 0452779b0054f5c2724b745b1db33bba1ac8e677)
(cherry picked from commit 8d7eef9ee5ead7c7b47b2ad4418529ac5cf17bb3)
2024-09-10 22:33:00 +02:00
maia x.
4c0da06e1d namespace: Fix extension release memory leak
In apply_one_mount(), in the MOUNT_EXTENSION_DIRECTORY case,
char **extension_release was used as a return pointer twice but only
cleaned up once in the end. Fix it by removing duplicate code that
was causing this issue.

Fixes issue introduced in 55ea4ef096543d2bceea9315868d5aca945d7a57.

(cherry picked from commit 010ea061fceb84d36259d576f52c09b940d0d615)
(cherry picked from commit 83f30941731ca454309c566edbfe3b3bfeaf8453)
2024-09-10 22:33:00 +02:00
Raphaël Mélotte
ed087e8658 src/basic/missing_loop.h: fix missing LOOP_SET_BLOCK_SIZE
Builds with kernels headers < 4.14 fail with:

../src/shared/loop-util.c: In function ‘loop_configure_fallback’:
../src/shared/loop-util.c:237:31: error: ‘LOOP_SET_BLOCK_SIZE’ undeclared (first use in this function); did you mean ‘LOOP_SET_DIRECT_IO’?
                 if (ioctl(fd, LOOP_SET_BLOCK_SIZE, (unsigned long) c->block_size) < 0)
                               ^~~~~~~~~~~~~~~~~~~
                               LOOP_SET_DIRECT_IO

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

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
(cherry picked from commit 56ab1c54497d9fac74380ff9e11aaf931a917d2b)
(cherry picked from commit 0730ec4f3ecbbb550864ff0dbadeeeb5e271eb50)
2024-09-10 22:33:00 +02:00
Yu Watanabe
834afe7dde test: allow to skip matrix_run_one() if $TEST_MATCH_TESTCASE is set
(cherry picked from commit 7908e1d459f5f2893d6aaf1d62009da7856f9410)
(cherry picked from commit 93759103e6164e69bc92d2ce6c11d79c95da0ced)
2024-09-10 22:33:00 +02:00
Daan De Meyer
db1d9bf996 test-dhcp-server: Gracefully handle the network being down
(cherry picked from commit 4cf7a676af9a79ff418227d8ff488dfca6f243ab)
(cherry picked from commit 2e52cf1df7f4a874331dcf607e0f4329ffb20bcd)
2024-09-10 22:33:00 +02:00
Daan De Meyer
4d4513c1fe test: Gracefully handle running within user namespace with single user
Unprivileged users often make themselves root by unsharing a user namespace
and then mapping their current user to root which does not require privileges.
Let's make sure our tests don't fail in such an environment by adding checks
where required to see if we're not running in a user namespace with only a
single user.

(cherry picked from commit ef31767ed7e21672a50b77e7b3935948aaba114c)
(cherry picked from commit ec5cdf9ba0e003de6f824a000c0bbe46fb4e0925)
2024-09-10 22:33:00 +02:00
Daan De Meyer
77ee2a8d72 test-netlink: Gracefully handle the loopback interface being down
(cherry picked from commit d098b8df6e5c1b4c834272dd1397345483116db6)
(cherry picked from commit f6f96b05585ef3b05cef843a2c1cb2c55e77d3ba)
2024-09-10 22:33:00 +02:00
Luca Boccassi
e9190b013b mkosi: install libgcrypt20 and libcryptsetup12 manually in debian
Fixes kernel panic and initrd failure when booting in qemu,
as these are not getting pulled in the initrd automatically for
some reason
2024-08-16 12:05:49 +02:00
Yu Watanabe
bfe84a55f4 test: remove temporary directory for test-ukify on success
(cherry picked from commit e9a5b4a10eaa10fd43c69d148d57c7f4d8e10a4f)
(cherry picked from commit 8e9af7b18ac5f2adf64b5f9bdc9c4df67ec5d721)
v255.11
2024-08-16 11:07:11 +02:00
Chengen Du
5a50b4318b udev: Handle PTP device symlink properly on udev action 'change'
PTP device symlink creation rules are currently executed only when the
udev action is 'add'. If a user reloads the rules and runs the udevadm
trigger command to reapply changes, the symlink may be deleted, which
can prevent the chronyd service from restarting properly.

Signed-off-by: Chengen Du <chengen.du@canonical.com>
(cherry picked from commit 6bd12be3fa7761f190e17efdbdbff4440da7528b)
(cherry picked from commit 2a328ce80923baa55925c99a923c40ec46b86243)
2024-08-16 11:07:11 +02:00
Thorsten Scherer
f38c19bc69 repart: Fix misleading typo in GPT partition flag
Bit 60 is the one corresponding to ReadOnly, not 50.  Fix this.

(cherry picked from commit 932cc94436e653d0487c29e0dd44685610cd7bcb)
(cherry picked from commit 2665618555d08fc3877043cac392f1b6573811b7)
2024-08-16 11:07:11 +02:00
Daan De Meyer
6fc5d4bac1 mkosi: Disable pagination in gdb
(cherry picked from commit 7628565604f5a6a572cb4a33ccde9a64fcc9ff09)
(cherry picked from commit 46d6146776f1c0beebec77704d78ba2b62d10208)
2024-08-16 11:07:11 +02:00
Daan De Meyer
53d92de4b4 docs: Mention the new mount API in the container interface doc
Let's mention that the new mount API may be used to establish new
mounts in a container without needing the /run/host/incoming directory.

(cherry picked from commit 74cc5e2041a2c32e1824b32316bd95f2c8a811f5)
(cherry picked from commit 65eff444c4fa7be5eb1be71c5d94ab8732167e11)
2024-08-16 11:07:11 +02:00
Ivan Shapovalov
4994f15f35 core/exec-invoke: call setpriority() after sched_setattr()
The nice value is part of struct sched_attr, and consequently invoking
sched_setattr() after setpriority() would clobber the nice value with
the default (as we are not setting it in struct sched_attr).

It would be best to combine both calls, but for now simply invoke
setpriority() after sched_setattr() to make sure Nice= remains effective
when used together with CPUSchedulingPolicy=.

(cherry picked from commit 711a157738b3dcd29a5ebc8f498eb46bfac59652)
(cherry picked from commit b628d4dfa61234d28ffaa648ec09c5e9972f832a)
2024-08-16 11:07:11 +02:00
Nick Rosbrook
e6f8282051 core/unit: do not use unit path cache in unit_need_daemon_reload()
When unit_need_daemon_reload() calls unit_find_dropin_paths() to check
for new drop-in configs, the manager's unit path cache is used to limit
which directories are considered. If a new drop-in directory is created,
it may not be in the unit path cache, and hence unit_need_daemon_reload()
may return false, despite a new drop-in being present. However, if a
unit path cache is not given to unit_file_find_dropin_paths() at all,
then it behaves as if the target path was found in the unit path cache.

So, to fix this, adapt unit_find_dropin_paths() to take a boolean
argument indicating whether or not to pass along the unit path cache.
Set this to false in unit_need_daemon_reload().

Fixes #31752

(cherry picked from commit 82c482d573c9d2f3ab36f7be8d32772f90f2c335)
(cherry picked from commit 6f57f9b8aa4084179c82c98ec654315a63532fe9)
2024-08-16 11:07:11 +02:00
Daan De Meyer
cf82c71589 mkosi: Disable debuginfod
We generally don't care about library debuginfo so let's just disable
debuginfod so it doesn't get in the way when debugging.

We use /root/.gdbinit as the systemwide gdbinit location is distribution
specific.

(cherry picked from commit 2561e2a35601383bfba30da58d378303cb9e39aa)
(cherry picked from commit afcc3f39a3fba9129325cdec0511bb63e0ba68c5)
2024-08-16 11:07:11 +02:00
Yu Watanabe
da229ea89a meson: enable -Wunterminated-string-initialization
With af1a6db58fde8f64edcf7d27e1f3b636c999934c, now we can build with the
option.

(cherry picked from commit f548bc4011bcdab008b125b9d0993817efa00718)
(cherry picked from commit 772549666cf291d85c28d3bfc1ab2b7227422d4f)
2024-08-16 11:07:11 +02:00
Cristian Rodríguez
f6f0d85135 basic|boot: silence Wunterminated-string-initialization gcc15 warnings
gcc15 has -Wunterminated-string-initialization in -Wextra and
warns about string constants that are not null terminated even though
the functions do do out of bounds access.
Silence the warnings by simply not providing an explicit size.

(cherry picked from commit af1a6db58fde8f64edcf7d27e1f3b636c999934c)
(cherry picked from commit ca09bc33e8b2cbc7c410c300b6df5cf3ce437a3b)
2024-08-16 11:07:11 +02:00
Nick Rosbrook
25003a6450 sysusers: check if requested group name matches user name in queue
When creating a user, check if the requested group name matches a user
name in the queue. If that matched user name is also going to be a group
name, then use it for the new user too. In other words, allow the
following:

 u foo -
 u bar -:foo

when both foo and bar are new users.

Fixes #33547

(cherry picked from commit 18a8f03e5160ca3828d327d9bbd1b32f26d792a3)
(cherry picked from commit edf52384c2e99cd5af9bcd4ae4b13fd8f79596d3)
2024-08-16 11:07:11 +02:00
Arnaud Patard
0bcea67612 src/pcrlock/pcrlock.c: Handle empty pcrlock.d directories
Running the following commands:

  # mkdir -p /var/lib/pcrlock.d/123-empty.pcrlock.d
  # /usr/lib/systemd/systemd-pcrlock predict --pcr=1+2+3+4+5+16

Will result in:

...
Floating point exception

Running the following commands:
  # mkdir -p /var/lib/pcrlock.d/123-empty.pcrlock.d
  # /usr/lib/systemd/systemd-pcrlock make-policy --pcr=1+2+3+4+5+16

Will result to this (partial) log:
...
Predicted future PCRs in 133us.
[]
...
Written policy digest 0000000000000000000000000000000000000000000000000000000000000000 to NV index 0x1921da6
...

So, add missing checks to handle gracefully cases where there's no variant
inside the component.

Signed-off-by: Arnaud Patard <arnaud.patard@collabora.com>
(cherry picked from commit e7a93e75219b22424bab95fe45982f5eef21d581)
(cherry picked from commit 74f830e048beab8b48c4a25dcb8666a861981aec)
2024-08-16 11:07:11 +02:00
Yu Watanabe
5ee15b924e journal: comment the default value in journald.conf
(cherry picked from commit 0d113f8e70243c1a8f0587105195e51e027a4725)
(cherry picked from commit 8d5806b1e22798d8ee18b889af47568f5fccf3ed)
2024-08-16 11:07:11 +02:00
Yu Watanabe
7b1bb6e0bc resolve: refuse invalid service without type field
Fixes Fixes #33935.

(cherry picked from commit b48ab08732a76b7337628e1e716f11c687000903)
(cherry picked from commit 0195db6e919e80bdd6b4b706ebc24d5e935f5422)
2024-08-16 11:07:11 +02:00
Luca Boccassi
b2738ee815 base-filesystem: do not attempt to create a /lib64 -> /usr/lib/<tuple> symlink
In multi-arch distributions (debian and derivatives) multiarch tuples under
/usr/lib are used, such as /usr/lib/x86_64-linux-gnu/ but the /lib64 symlink
should never point there, it should always point to /usr/lib64, as that's
how they are set up by distribution-specific tools.

https://packages.debian.org/bookworm/amd64/libc6-i386/filelist
https://packages.debian.org/bookworm/mipsel/libc6-mips64/filelist
https://salsa.debian.org/md/usrmerge/-/blob/master/convert-usrmerge?ref_type=heads#L295
https://salsa.debian.org/md/usrmerge/-/blob/master/convert-usrmerge?ref_type=heads#L517
http://bugs.debian.org/1076491

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

(cherry picked from commit b75c13731ee0867a8d7889348fc8da1869af7551)
(cherry picked from commit 38caeac7680b3f7a81b741336f57f9b56d040297)
2024-08-16 11:07:11 +02:00
Daan De Meyer
828c900ec7 meson: Use -fstrict-flex-arrays=3
Let's explicitly pass the value to -fstrict-flex-arrays. This does
not change behavior but it does (selfishly) make my error not bug
out with an error saying -fstrict-flex-arrays does not exist.

(cherry picked from commit ad723ca3e5bd41d2d884760375534910bb55d9b3)
(cherry picked from commit 2925fc2c6f4b13a2f098912fa3d44ad31e9f2cf0)
2024-08-16 11:07:11 +02:00
Mike Yuan
510aa8b33d core/execute-serialize: use serialize_item_escaped() for external paths
Otherwise, read_stripped_line() would spuriously drop trailing spaces.

Fixes #33924

(cherry picked from commit 9be46b1da8b01c3f47e6c050185f2b45484d6300)
(cherry picked from commit c3ede0cfe78c4d70cfbeb333897969e27a6c6dda)
2024-08-16 11:07:11 +02:00
Mike Yuan
807f3ccb07 core/execute-serialize: drop extraneous '=' in ip-{in,e}gress serialization
(cherry picked from commit f0fdd13c2f06f9c78747103b971566e2c62b9333)
(cherry picked from commit 8beae811239830a86107abbbd6256b13cde2e33f)
2024-08-16 11:07:11 +02:00
Yu Watanabe
b126d0a8fc man/net-naming-scheme: mention that NAMING_BRIDGE_MULTIFUNCTION_SLOT is reverted
Follow-up for af7417ac7b07bc01232982bf46e9d72e69e7f820.
Closes #33596.

(cherry picked from commit 1c0130e8dc3c99d5a85be41e9172adb0ff0cf7fd)
(cherry picked from commit ce940b62acfca1f229818d82edee07986c05b50c)
2024-08-16 11:07:11 +02:00
Yu Watanabe
20c9efc5cc man: extend explanation for ConfigureWithoutCarrier= in systemd.network(5)
Prompted by #33702.

(cherry picked from commit 347c8822d1a8a5b70624920b3de2a91d4e0fca91)
(cherry picked from commit ab4e1faca6e5128a3c32d93eedd5609709da8229)
2024-08-16 11:07:11 +02:00
Daniel P. Berrangé
d326ecea87 man/systemd-detect-virt: list known CVM technologies
Add a section which lists the known confidential virtual machine
technologies.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit a8fb5d21fd6127a6d05757c793cc9ba47f65c893)
(cherry picked from commit 037510812fbcaf689b5b107a85f3a031d15dc505)
2024-08-16 11:07:11 +02:00
Daniel P. Berrangé
c9a3269181 confidential-virt: add detection for s390x target
The s390x platform provides confidential VMs using the "Secure Execution"
technology, which is also referred to as "Protected Virtualization" or
just "prot virt" in Linux / QEMU.

This can be detected through a simple sysfs attribute.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 6c35e0a51cc6a852ce239ea46cd75c133212a68e)
(cherry picked from commit 7a6d4cdc483c3cff03342d8c69b10c6792192171)
2024-08-16 11:07:11 +02:00
Daniel P. Berrangé
4804c2b1b0 confidential-virt: split caching of CVM detection into separate method
We have different impls of detect_confidential_virtualization per
architecture. The detection is cached in the x86_64 impl, and as we
add support for more targets, we want to use caching for all. It thus
makes sense to split caching out into an architecture independent
method.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 1c4bd7adcc281af2a2dd40867f64f2ac54a43c7a)
(cherry picked from commit a1359ac94068580b4a12b2714a590a8ac1d30cae)
2024-08-16 11:07:11 +02:00
Ronan Pigott
030dbbc39e resolved: don't treat conn reset as packet loss
tcp reset / icmp port-unreachable are markedly different conditions than
packet loss. It doesn't make much sense to retry in this case. It's
actually not clear if there is any benefit at all retrying tcp
connections, which were presumably already retried as necessary by the
tcp stack.

(cherry picked from commit ddd710a355acc698b48159f3e501dda5a7dc2704)
(cherry picked from commit f5376fea7de173e9369e8af569fc6ecabd0d7282)
2024-08-16 11:07:11 +02:00
Yu Watanabe
a920cc9b3a import: check overflow
Fixes CID#1548022 and CID#1548075.

(cherry picked from commit f7012a93a7f04fa29c7933a4963aa17fcf120e97)
(cherry picked from commit 11c15905cd4759b89a1da63d05772c1f7c3744a4)
2024-08-16 11:07:11 +02:00
Michal Sekletar
3888d11d2d socket: fix socket activation of stopped services with pinned FD store
(cherry picked from commit 941a12dcba57f6673230a9c413738c51374d2998)
(cherry picked from commit 1a3d8368bcc8c123145955affd76a9c97f819ad5)
2024-08-16 11:07:11 +02:00
Daan De Meyer
4fad4203fc exec-credential: Log if we skip duplicate credential
(cherry picked from commit 590348e2bf8415053487324d47d0083b49dfdeb0)
(cherry picked from commit ee85ef4ffa9367ff5122b5955039009080659ce0)
2024-08-16 11:07:11 +02:00
Daan De Meyer
8747a45cca cgroup-util: Don't try to open pidfd for kernel threads
The kernel might start returning -EINVAL when trying to open pidfd's
for kernel threads so let's not try to open pidfd's for kernel threads.

(cherry picked from commit ead48ec35c863650944352a3455f26ce3b393058)
(cherry picked from commit f1d4e79eff71102199d864175efb7a2353c36502)
2024-08-16 11:07:11 +02:00
Daan De Meyer
f58fc0ffaa log: Fix size calculation for number of iovecs
Each log context field can expand to up to three iovecs (key, value
and newline) so let's fix the size calculation to take this into
account.

(cherry picked from commit fc83ff3f55ee53fd9101d4e45736f3f996ee7ca6)
(cherry picked from commit f2edebce25779018beca0acd28457864869c2546)
2024-08-16 11:07:11 +02:00
Daan De Meyer
af9add0e1d execute: Drop log level to unit log level in exec_spawn()
All messages logged from exec_spawn() are attributed to the unit
and as such we should set the log level to the unit's max log level
for the duration of the function.

(cherry picked from commit 7881f485c9f57b1c7de4308eeab54458890c5c19)
(cherry picked from commit 4fd349953ea1d1ed580ecb94e5c0bf98c59d0fac)
2024-08-16 11:07:11 +02:00
Dan Nicholson
c40900af22 firstboot: fix root params with creds and prompting disabled
Remove an early return that prevents --prompt-root-password or
--prompt-root-shell and systemd.firstboot=off using credentials. In that case,
arg_prompt_root_password and arg_prompt_root_shell will be false, but the
prompt helpers still need to be called to read the credentials. Furthermore, if
only the root shell has been set, don't overwrite the root password.

(cherry picked from commit 35bc4c34240afdd55e117b909f26fa9a5dc54f3b)
(cherry picked from commit b5448c16f8f7a67da5266bec7d5c6677cc34ab24)
2024-08-16 11:07:11 +02:00