1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-14 16:58:22 +03:00

63777 Commits

Author SHA1 Message Date
Ronan Pigott
b8316a0ca3 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)
(cherry picked from commit 030dbbc39e54666bd0f393ef47f0b0d9b2dfe8b4)
(cherry picked from commit 1b5bc5ab49fccd1e23d6ee6ba5f37d8347156790)
2024-08-19 20:22:44 +02:00
Yu Watanabe
2d261daa16 import: check overflow
Fixes CID#1548022 and CID#1548075.

(cherry picked from commit f7012a93a7f04fa29c7933a4963aa17fcf120e97)
(cherry picked from commit 11c15905cd4759b89a1da63d05772c1f7c3744a4)
(cherry picked from commit a920cc9b3a8fc8b9ee57fa5c4a30d9234eb7a819)
(cherry picked from commit ff17a1023e2715ee5f54cc741b47e1eb1c444f35)
2024-08-19 20:22:44 +02:00
Yu Watanabe
9d9458a00e network: request non-NULL SSID when a wlan interface is configured as station
To avoid conflicts with user .network file for the wlan interface with Bond=.
See https://github.com/systemd/systemd/issues/19832#issuecomment-857661200.

(cherry picked from commit e2becab08506d8a085f4c18231c7f354db16df9f)
(cherry picked from commit ad861b6ae6ee9660912f03f73f771c98f426753c)
(cherry picked from commit 2a182ae521331fc71cf5aabc20bf0e8f0b38ae42)
(cherry picked from commit d00860118d9fa6787ed4f35cbde047c819548c12)
2024-08-19 20:22:44 +02:00
Luca Boccassi
f94e0a3a6b efi: fix link to legacy EFI handover protocol
(cherry picked from commit 4d6ab7e8440845301c90211beb22015e7232faa1)
(cherry picked from commit c12c122e2ad3668848ffff69913006d420bda41d)
(cherry picked from commit 407ac39dd8c3ac41c7c9c6f2f9c8307cd60b5ce9)
(cherry picked from commit 2fa6dd17940b9f49d30d1be99f4f03ec99e9e000)
2024-08-19 20:22:44 +02:00
Yu Watanabe
5d28f089ab network: call link_handle_bound_by_list() before trying to reconfigure interface
Otherwise, when an interface gained its carrier, the interface may not
have matching .network file yet, then link_reconfigure_impl() returns
zero, and link_handle_bound_by_list() is skipped.

Fixes #33837.

(cherry picked from commit 36b8ad085c6902631ad7054bffbda33d6d168823)
(cherry picked from commit 0d98178abb5ea470d03d05680e58ff0e59fe69bd)
(cherry picked from commit 84c4a44f17b0cd68ba5f2ee0342a5a32299a3d62)
(cherry picked from commit 4efaf9dc9af9631e8d83ac7c3efa491f8567cdf7)
2024-08-19 20:22:44 +02:00
Yu Watanabe
bb8b029b3b network: do not bring down bound interfaces immediately
Even if a timespan specified to IgnoreCarrierLoss= for an interface,
when the carrier of the interface lost, bound interfaces might be bring
down immediately.

Let's also postpone bringing down bound interfaces with the specified
timespan.

(cherry picked from commit e8eaed0240d642e70c567b08f3593e4cf45a255a)
(cherry picked from commit 9468a6ea47cfb8412875923d09b8a8ae6ee02119)
(cherry picked from commit 80e93a0640e06b9fbe7d7354b4fad8a6ad140140)
(cherry picked from commit f2e34bdb57edbed90bb6eafd3d2d08d5f4e5436f)
2024-08-19 20:22:44 +02:00
Daan De Meyer
c98e7cdedf kernel-install: Try some more initrd variants in 90-loaderentry.install
On CentOS/Fedora, dracut is configured to write the initrd to
/boot/initramfs-$KERNEL_VERSION...img so let's check for that as well
if no initrds were supplied.

(cherry picked from commit b56920e36c5692c0dde701bfb48330653a9c62c9)
(cherry picked from commit 1cb21b2cb194501464c52c1f32ae55f593689cc3)
(cherry picked from commit 22acfc05a72da8d79e907e1a1f34896735e00b22)
(cherry picked from commit 7182b54b8660f2429115cf41dafa321cee7baf27)
2024-08-19 20:22:44 +02:00
Daan De Meyer
02edc3eef5 kernel-install: Only read cmdline from /proc/cmdline when not in container
If we're running from within a container, we're very likely not going
to want to use the kernel command line from /proc/cmdline, so let's add
a check to see if we're running from a container to decide whether we'll
use the kernel command line from /proc/cmdline.

(cherry picked from commit 35c01ec59e0c2e6bd06cb18ca2ff612c6a7ea35d)
(cherry picked from commit c386327fc851863abf4c27076bd368dfc55b83a0)
(cherry picked from commit 0b4d00b28469353df337add92930626744adf06e)
(cherry picked from commit 2b3cc8d4986bfde0b7ea6362f55d13ba060e01b3)
2024-08-19 20:22:44 +02:00
Vladimir Panteleev
ba8c10a195 man: clarify systemd-path variable source
(cherry picked from commit 3f24fa57df552accc2a6f9ab4d36724ba7227eff)
(cherry picked from commit ec3f2c8c8ad86004d6048510382167ee5f1ded61)
(cherry picked from commit 8e0cb57134161105f4eceae321a3ad3e51c60639)
(cherry picked from commit 53493370d24ecaa0b49175c9ab5849a193a5935c)
2024-08-19 20:22:44 +02:00
Vladimir Panteleev
0b5bb2b1da man: improve ManagerEnvironment documentation
- Improve wording for explanation when these variables are inherited

- Clarify that these variables are not placed in the process environment block,
  so /proc/PID/environ cannot be used as a debugging tool

(cherry picked from commit 6c1e0823b04525716d9ee0031a2b6735d3f7dfa4)
(cherry picked from commit 5cf0c45f64079430b0b7c12ad323f238386260b0)
(cherry picked from commit 79f335d0ef2d3c35fdf4c19988c711a3abd31ee0)
(cherry picked from commit bb28a6c0b68a4a9dc2aa33972b3419680d333c05)
2024-08-19 20:22:44 +02:00
Jose Ignacio Tornos Martinez
f410f29020 kernel-install: remove depmod generated file modules.weakdep
The new file, modules.weakdep, generated by depmod to get the weak
dpendencies information can be present
(05828b4a6e),
so remove it like the other similar files.

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
(cherry picked from commit eef4cd51f94d837bd0e71512c831634a2902522d)
(cherry picked from commit 0cdec6e1fef4174c0d04aaca195ab56750437535)
(cherry picked from commit ae0c61b4a722a7eacd2cc544798467e209238bf7)
(cherry picked from commit d9abcf946689cf26f531d0faa82c9be114b9cacc)
2024-08-19 20:22:44 +02:00
Yu Watanabe
7ac2395b6b sd-event: change error code -EINVAL -> -EIO
EINVAL should be used when a function is called with an invalid
argument. Here, the signal is not a function argument.

Follow-up for 7a64c5f23efbb51fe4f1229c1a8aed6dd858a0a9.

(cherry picked from commit ab9af70edb23f2a66e93e2e16f87cd98873885b7)
(cherry picked from commit 84f0eda3781f49ff7f3035861b02fe247b89d65e)
(cherry picked from commit da81ee2f78526f78b3c57661a59de681d208e35e)
(cherry picked from commit 42885ab01726b5937390704f1d6ec33f0321fd53)
2024-08-19 20:22:44 +02:00
David Tardon
e681d161fb sd-event: do not assert on invalid signal
The signalfd_siginfo struct is received from outside via a FD, hence
assert() is not appropriate way to check it. Just do a normal runtime
check.

(cherry picked from commit 7a64c5f23efbb51fe4f1229c1a8aed6dd858a0a9)
(cherry picked from commit 7a48ea958bf146a45cb4a3b7ff7aeb5885469196)
(cherry picked from commit 5fa8b5d74aa81e884613ba68c6f765834e6dd02c)
(cherry picked from commit 74fa56ebc3d323bd6cd2315eb8b1057f0ea359a8)
2024-08-19 20:22:44 +02:00
David Tardon
75aefdd9c4 logind-dbus: check auth. for all inhibitor operations
Fixes #33834

(cherry picked from commit 639719e01065c3a2f557d70e4d8088c2ec71c7c6)
(cherry picked from commit b2df49a87b17ba79b6e97d87199ceb1e4cbdb5de)
(cherry picked from commit 76d1f0664cf47b657040343ddb20298b157f2724)
(cherry picked from commit 0d624910a42961f0286229d95acd77cf73f5add0)
2024-08-19 20:22:44 +02:00
Dan Streetman
5a5d5b9c46 basic/bitfield: add bitfield operations
Add macros to manage bits in a bitfield (e.g. uint32_t, uint64_t, etc),
such as setting, clearing, checking bits, and iterating all set bits.

These are similiar to the bitmap operations, but operate on basic types
instead of requiring a Bitmap object.

(cherry picked from commit 33d9beed07b3dab05d07d57e8af13bb19b9e3095)
2024-08-19 20:22:44 +02:00
Mike Yuan
273146fc75 basic/log: do not treat all negative errnos as synthetic
Currently, IS_SYNTHETIC_ERRNO() evaluates to true for all negative errnos,
because of the two's-complement negative value representation.
Subsequently, ERRNO= is not logged for most of our own code.
Let's fix this, by formatting all synthetic errnos as positive.
Then, treat all negative values as non-synthetic.

While at it, mark the evaluation order explicitly, and remove
unneeded comment.

Fixes #33800

(cherry picked from commit 268f58076f7e0258dce75f521d08199092279853)
(cherry picked from commit 4ad6b2631d73a574859a62d33715a7bdef810bcf)
(cherry picked from commit 1fc7e3473c2fec27bdc0b19753e4ea84cd39644f)
(cherry picked from commit 9463b376bcbb1a177bf46d64845b52eae79af739)
2024-08-19 20:22:44 +02:00
Luca Boccassi
4990aaa954 hwdb: update to main@{2024-07-24}
git restore -s origin/main hwdb.d/ test/hwdb.d

(cherry picked from commit b731debea9221ca43edc49f85be23db2fde79492)
(cherry picked from commit 6c260ee0349c8ee169ac57d14f4effe366f19383)
(cherry picked from commit 4c3f4584cc7d11c9575377a8948bcbedaf698440)
v253.23
2024-07-25 09:16:58 +01:00
vdovhanych
0fcee2c4de add udev rules for trezor hw wallet devices
(cherry picked from commit 2cf425ec573b8f67025c5e74cd267015129e7349)
(cherry picked from commit a78a52465298e8f5a927da9c9fc56c41837018aa)
(cherry picked from commit e8fe599736d70fbaf553940ea99360575637408b)
(cherry picked from commit f3eff7a838128dc690683aa94b9e1fbea3924bae)
2024-07-25 09:16:58 +01:00
Mike Yuan
69985ea680 core: reliably check if varlink socket has been deserialized
Follow-up for 6906c028e83b77b35eaaf87b27d0fe5c6e1984b7

The mentioned commit uses access() to check if varlink socket
already exists in the filesystem, but that isn't sufficient.

> Varlink sockets are not serialized until v252, so upgrading from
> v251 or older means we will not listen anymore on the varlink sockets.
>
> See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1074789
> for more details as this was found when updating from Debian Bullseye to a new version.

After this commit, the set up of varlink_server is effectively
split into two steps. manager_varlink_init_system(), which is
called after deserialization, would no longer skip listening
even if Manager.varlink_server is in place, but actually
check if we're listening on desired sockets.
Then, manager_deserialize() can be switched back to using
manager_setup_varlink_server().

Alternative to #33817

Co-authored-by: Luca Boccassi <bluca@debian.org>
(cherry picked from commit d4e5c66ed469c822ca5346c7a445ec1446b1d17f)
(cherry picked from commit b825a8be0b7b857a715e982cee861e8ae6995ee8)
(cherry picked from commit 3b3875ead34bdd14b853e9c77565647244263fa0)
(cherry picked from commit e7155d8d0f5a2de02c800f08d949af0a8daa47a2)
2024-07-25 09:16:58 +01:00
Steve Traylen
ef5c7145a1 Document that MemorySwapMax supports % configuration
Certainly on systemd 252 at least a configuration of
```
MemorySwapMax=40%
```
is supported but this was missing from the man page.
Only MemoryMax was documented as supporting a %.

(cherry picked from commit 8af38e5b0475f514141d314088dcf9fffd7edc37)
(cherry picked from commit 766af3f782299a7cbfba24a4333444ac008c17d2)
(cherry picked from commit 69681c222e8198ed7327173eada85cdd7684546d)
(cherry picked from commit 5ff55bc33c7d8c29ed609e7fe1eb4237566c69b0)
2024-07-25 09:16:58 +01:00
Lennart Poettering
62f8196d7f import-creds: when we hit ENOENT on SMBIOS 11 do not even debug log
We'll *always* hit ENEOENT when iterating through SMBIOS type #11
fields, on the last one. it's very confusing to debug log about that,
let's just not do it.

(cherry picked from commit 5202ee42d5da0ae3a6655d2bc959a19d8c347e9d)
(cherry picked from commit 995c702a347d16cfad4605f3982d5278616ea1f8)
(cherry picked from commit f084959002e9efc2c4dccf410fa745b57f51f512)
(cherry picked from commit b5f3e791c34206befe0355e2fb71e954cbcea4e8)
2024-07-25 09:16:58 +01:00
Mauri de Souza Meneguzzo
b9a08c7558 shared: log error when execve fail
If there is an error with the execv call in fork_agent the
program exits without any meaningful log message. Log the
command and errno so the user gets more information about
the failure.

Fixes: #33418

Signed-off-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
(cherry picked from commit a408d4453145621902b9a3ef78a552f83b09bd8d)
(cherry picked from commit 7fcfb73d71ed1d4230f58de1a94790e0c28719ea)
(cherry picked from commit 76fe6ebee84c22c96f1c9a96707c7e72706989fd)
(cherry picked from commit 084b91100c8a139514382a0f2a6bb2beaa811963)
2024-07-25 09:16:58 +01:00
Lucas Werkmeister
7b09e915e3 man: Mention Type=oneshot timeout directive
Make the warning for oneshot services (where RuntimeMaxSec= has no
effect) more actionable by pointing to the directive people can use
instead to effectively limit their runtime.

(cherry picked from commit 8c4aa0f1c6a78b35712fa6a7acf6d755d0c0bd86)
(cherry picked from commit 468b0646342986c6cc9bd797b4ba189dc488ee8d)
(cherry picked from commit 017d7fd49085e8f877cfa2510f251b9a6b59f207)
(cherry picked from commit a7e6ebc98418bc28f30f89588127e6dbce526156)
2024-07-25 09:16:58 +01:00
Lennart Poettering
9988e0921f sd-device: remove debug log message when dirs are missing
This is a common case, and nothing noteworthy at all. For example, if we
establish an enumerator for listing all devices tagged by some tag, then
the per-tag dir is not going to exist if there are currently no devices
tagged that way, but that's a really common case, and doesn't really
deserve any mention, not even at debug level.

(cherry picked from commit a68c97a54527cacaeeac0c117493639fc455ef5e)
(cherry picked from commit 8aa9e60f89f84a90fb364ee66cf62432a6b877ba)
(cherry picked from commit a321caf0583cc70cf1ba66bdc41d07175ccc1f2a)
(cherry picked from commit 32a32002c77a66499786b2f23e2aab9b21ed9a60)
2024-07-25 09:16:58 +01:00
Luca Boccassi
dba4bb4ebf gpt: add more architecture aliases
Same as the other aliases. Allows chaining commands like:

$ systemd-id128 show -P root-$(dpkg-architecture --query DEB_HOST_ARCH)
4f68bce3e8cd4db196e7fbcaf984b709

(cherry picked from commit f0b151ce864371da06a4d4a63a2a8b5282817b7e)
(cherry picked from commit b60d5bc1b774f900dc5c5d45faed17e919bdf0b3)
(cherry picked from commit b4e43b53c4a2b6f3fd238a6ea073d9471514bf59)
(cherry picked from commit 11c456a8c8df417508b6eb590586860b356766b4)
2024-07-25 09:16:58 +01:00
Jörg Behrmann
e494f79a76 kernel-install: Remove existing loader entries and UKIs
When boot counting is enabled, adding a new loader entry or UKI can conflict
with an existing one that has booted successfully and therefore has its boot
counter removed. systemd-bless-boot will fail to bless the new successful boot,
since a file without a boot counter already exists. Since kernel-install will
clobber existing files without boot counting, we should therefore remove files
without a boot count as well, when we add a file with one.

Fixes: #33504
(cherry picked from commit 99d4575e541fa1fb00dc80f7aad572f3a66db461)
(cherry picked from commit b78618540659a40c4c26aa588b3cd8b9c46116d1)
(cherry picked from commit 85ca1588c07059cac6f45f22b4a712cf37c6604c)
(cherry picked from commit 59aad95fe9732184a5225fe1380fe7d9873b56c6)
2024-07-25 09:16:58 +01:00
Lennart Poettering
57077a0fa2 bootspec: implement sorting by tries left/done, to match what sd-boot does
(cherry picked from commit 35451a32043504013eed5725c8be46b36ccdf71a)
(cherry picked from commit 3736e21341500d98d878b84a34cc5b9d7cd9125f)
(cherry picked from commit 0672a43dd27dd4cd4f9b6188be2c51a572628b84)
(cherry picked from commit 43a62081fd551c9bef358eef33d9cee6c15621ca)
2024-07-25 09:16:58 +01:00
Lennart Poettering
11db58b106 boot: compare filename suffixes without case
This is VFAT world after all.

(cherry picked from commit 764faf60400bafb1764b728aafe0dcf4cbf07364)
(cherry picked from commit 18143edf3e582d6b8c2933f5c181c9b29146023a)
(cherry picked from commit 04cd06e2f679376e932a1b1424bdffb326f607d6)
(cherry picked from commit 71da938d378d2dbf2bf1a6e1de6b07392901d22e)
2024-07-25 09:16:58 +01:00
Kuntal Majumder
aaad62626b man: fix typo in unit options section
Fixes #32918

(cherry picked from commit f9572d2b89341dfb224aa2c7222a316e59627bc9)
(cherry picked from commit bcda6d46373a7cf071d86e91917bbdd31a5597dd)
(cherry picked from commit 21e0842003f95701c766969bd4774c4f17a579d8)
(cherry picked from commit 90d912605344c407be9d291a3fc98e60cabf7da8)
2024-07-25 09:16:58 +01:00
ZHANG Yuntian
0179fb5afd man: fix typo in the alias symlink name
Symlink created by Alias will use the value as the file name.

(cherry picked from commit 3f0e7fd4fd1d20e3f4be18f485c76d25ce10f41b)
(cherry picked from commit a68188e985d29e46cfa6eb2e17419fad90f0b287)
(cherry picked from commit 4b8ce6a18720c2347063b6d681e5a1dac560b6c0)
(cherry picked from commit e8566d7bbfc4f269835ecbcc8c7960e025cdbd2b)
2024-07-25 09:16:58 +01:00
Ronan Pigott
8f85d9c9bf path: drop IN_ATTRIB from parent directory watches
When watching a given pathspec, systemd unconditionally installs
IN_ATTRIB watches to track the link count of the resolved file. This
way, we are notified if the watched path disappears, even if the
resolved file inode is not removed.

Similarly, systemd installs inotify watches on each parent directory, to
be notified when the specified path appears. However, for these watches
IN_ATTRIB is an unnecessary addition to the mask. In inotify, IN_ATTRIB
on a directory is emitted whenever the attributes of any child changes,
which, for many paths, has the potential to cause a high number of
spurious wakeups in systemd. Let's remove IN_ATTRIB from the mask when
installing watches on the parent directories of the specified path.

(cherry picked from commit 8bf8c7d83dcffffa55b5f534fb98db6b01315dc1)
(cherry picked from commit fa2b2da1466ff225363c1a0492b1b43c1d01dd8a)
(cherry picked from commit 2818d5a0d679f5205b5a369c8be0b9dfdf9e39eb)
(cherry picked from commit e9db26769ad1e6f6ebb34a5cc0c457b9df0bb932)
2024-07-25 09:16:58 +01:00
Luca Boccassi
cbfbcc0202 mkosi: policykit-1 was renamed to polkitd
(cherry picked from commit bffd3c52ad7113f21523568120d84326151f4600)
(cherry picked from commit ab11d7e177378704859703f4821784462c8966a5)
(cherry picked from commit 4b05dc62f17397c9ec22b05cf0b041eaee2afec7)
(cherry picked from commit 82080d648bad12b27d97e70c9352444316df2b5b)
2024-07-25 09:16:58 +01:00
Luca Boccassi
b686a2e067 README: update requirements for signed dm-verity
The newest kconfig enabling DB-verified dm-verity images is queued
for 6.11:

https://patchwork.kernel.org/project/dm-devel/patch/20240617220037.594792-1-luca.boccassi@gmail.com/
(cherry picked from commit a79b6dc0706dd5fe76ec56b3308b402c133ead23)
(cherry picked from commit c32f71aa1420b05711fa0593ddcffbeb76f272ab)
(cherry picked from commit d34f0dec5327ab9c2fc6da3135c640aa5ba473b1)
(cherry picked from commit 03d97a42c3b3a0a4c695479c2b95340b2a2c1d32)
2024-07-07 00:15:21 +02:00
Luca Boccassi
dfbd2c78af sysusers: handle NSS errors gracefully
If the io.systemd.DynamicUser or io.systemd.Machine files exist,
but nothing is listening on them, the nss-systemd module returns
ECONNREFUSED and systemd-sysusers fails to creat the user/group.

This is problematic when ran by packaging scripts, as the package
assumes that after this has run, the user/group exist and can
be used. adduser does not fail in the same situation.

Change sysusers to print a loud warning but otherwise continue
when NSS returns an error.

(cherry picked from commit fc9938d6f8e7081df5420bf88bf98f683b1391c0)
(cherry picked from commit abba1e6bc29b7e07354ca23906c6f485ba245a1a)
(cherry picked from commit 0f518750a44dc4b2987ecc0cea4b3d848ac46ee9)
(cherry picked from commit dffa62c85fb644c649f68b2c8f02b1d8440d2a9d)
2024-07-07 00:15:21 +02:00
Lennart Poettering
d7c1b80c68 man: fully adopt ~/.local/state/
The XDG base dir spec adopted ~/.local/state/ as a thing a while back,
and we updated our docs in b4d6bc63e602048188896110a585aa7de1c70c9b, but
forgot to to update the table at the bottom to fully reflect the update.
Fix that.

(cherry picked from commit 72a6296b16a75d4e26eec972f2999e69c9967b9d)
(cherry picked from commit df1ed3fbe2d03e9c1d0eed7d836c5aa541f4fb52)
(cherry picked from commit 15352fa22315cd76582ae33a63d065c808b9e958)
(cherry picked from commit 083380e814ac5dc773a849315702d0707088aa8b)
2024-07-07 00:15:21 +02:00
James Hilliard
0f0af50be1 README: add missing CONFIG_MEMCG kernel config option for oomd
We need to enable this otherwise systemd-oomd.service fails to start.

Fixes:
ConditionControlGroupController=memory was not met

(cherry picked from commit aa329b89223a79793cde8288b1bc6e93db174938)
(cherry picked from commit a50e6c5709f5fde269e6522bc6e6992180705fb1)
(cherry picked from commit 1817431dbeb762adec771169626808ecfcbd8f86)
(cherry picked from commit 25bd5f43f90c127d59bb484f20d17ccc9db66d9f)
2024-07-07 00:15:21 +02:00
Luca Boccassi
4ed038cf49 coredump: correctly take tmpfs size into account for compression
We calculate the amount of uncompressed data we can write by taking the limits
into account and halving it to ensure there's room for switching to compression
on the fly when storing cores on a tmpfs (eg: due read-only rootfs).

But the logic is flawed, as taking into account the size of the tmpfs storage
was applied after the halving, so in practice when an uncompressed core file
was larger than the tmpfs, we fill it and then fail.

Rearrange the logic so that the halving is done after taking into account
the tmpfs size.

(cherry picked from commit e6b2508275aac2951aedfc842735d8ebc29850bb)
(cherry picked from commit a946258e9df627c675d13b2041ae186babf269dc)
(cherry picked from commit 3dacca114bde3a216605ab51d2f5203c4a6b9707)
(cherry picked from commit 523f91c0bb2b5f509fa2aa0c22c8ba0734498780)
2024-07-07 00:15:21 +02:00
Daan De Meyer
dffd9597fc docs: Add section to HACKING.md on distribution packages
(cherry picked from commit 17ef81a764995dfd0f43daf34dcf2ab04806e760)
(cherry picked from commit 0a97db87893e706011f0ed7e522a42fcd3767ac4)
(cherry picked from commit 3ced17fb98e225fd2e93937f82e043d41d39de93)
(cherry picked from commit 21184a6a827c13542245e4056872bbdc5120e586)
2024-07-07 00:15:21 +02:00
Mike Yuan
dfd7f210d3 docs/CODING_STYLE: document that we nowadays prefer (const char*) for func ret type
Addresses https://github.com/systemd/systemd/pull/33567#discussion_r1662818225

(cherry picked from commit 4b7249111a4c1d366f476bdbd6e03f7893eb9d42)
(cherry picked from commit 3c91ea49d249cda6e1fa84b53a42dee6d83339da)
(cherry picked from commit b8d993f0292f25cddbc284acb4ddc513cf0d1f3b)
(cherry picked from commit 661fa2d832baffd03f0adbb749f1a8a3bbae1979)
2024-07-07 00:15:21 +02:00
Franck Bui
03c639bcda test: fix TEST-24-CRYPTSETUP on SUSE
/etc/systemd/journald.conf.d drop-in dir already exists on SUSE.

(cherry picked from commit 56a894e888002f44f3463b3188f9d5abdcca4bb0)
(cherry picked from commit 10b7e0a0afc31dc6a3cc30fca3a276449a60ec7d)
(cherry picked from commit d0b9feab0158b57a3eff7becf9d35d07cb8cb20b)
(cherry picked from commit 58ff4df09596b725f7a654e427832e7d3829eec2)
2024-07-07 00:15:21 +02:00
Franck Bui
eabc948bd5 test: install /etc/hosts
Needed for resolving the "localhost" hostname.

(cherry picked from commit a09825ce9fb3bd315f35654b6e6ee4f92c675cde)
(cherry picked from commit 4f7d6885a12c0e5e27a9d29f9ef09fb2fa53d6ef)
(cherry picked from commit 58205cfea853a049f79e47ca336c320c881328d8)
(cherry picked from commit a5735d3653287ebea8e4dbdfa36b13b13ee06ec3)
2024-07-07 00:15:21 +02:00
rhellstrom
bbbcffa6fa Conditional PSI check to reflect changes done in 5.13
cpu.pressure 'full' is undefined for system-wide checks since 5.13 but still reported with values set to 0 for backwards compatibility. Made changes to reflect this for system-wide checks so that the conditional comparison is not made against the 0 value and instead fall back to 'some'.

https://www.kernel.org/doc/html/latest/accounting/psi.html
(cherry picked from commit 98b1ecc9175a8bb241292f6f441a754b6759dd97)
(cherry picked from commit c2f74defaad3c2d0eb114d3f5aeded07890d9989)
(cherry picked from commit a28883e2d666ae17361c2f268041d9696e2dfe6b)
(cherry picked from commit f6b35b802ca236151296d3d155a6bb0e4200ad1f)
2024-07-07 00:15:21 +02:00
Mike Yuan
7c0b8650ce core/unit: follow merged units before updating SourcePath= timestamp too
Currently, we only follow merged units for unit_load_dropin() call.
But if the unit is an alias, we should always perform operations
on the "canonical" unit.

(cherry picked from commit 740cd1e0f2ae5cc1a10d2111d63cc4e975761091)
(cherry picked from commit 86d47d63b01c1910f8f186668948f0dc7b80db37)
(cherry picked from commit 82871b071b960e31c59fb397a5a68b32fc4bf617)
(cherry picked from commit 81f515d64f464e9f62a62f31bf26cd8555eef9dd)
2024-07-07 00:15:21 +02:00
James Coglan
d6389c41c8 resolved: correct parsing of OPT extended RCODEs
The DNS_PACKET_RCODE() function works out the full RCODE by taking the
first octet from the OPT record TTL field and bitwise-OR-ing this with
the basic RCODE from the packet header. This results in RCODE values
being lower than they should be.

For example, if the first TTL octet is 0x7a and the basic RCODE is 3,
this function currently returns `0x7a | 3` = 123, rather than 0x7a3 =
1955.

The first TTL octet is supposed to form the upper 8 bits of a 12-bit
value, whereas the current implementation constraints the value to 8
bits and results in mis-interpreted RCODEs.

This fixes things by shifting the TTL 20 places instead of 24 and
masking off the low nibble that comes from the upper bits of the version
octet.

Note that dns_packet_append_opt() correctly converts the input RCODE
into the high octet of the OPT TTL field; this problem only affects
parsing of incoming packets.

(cherry picked from commit c40f3714c9a4d1f2bcd308625c9c835892e3d41c)
(cherry picked from commit 7ee60a86140ebe3e60858ef3c4e749dcd2e7fd21)
(cherry picked from commit c572f1ed2b7565263007b26a10872fb047526d73)
(cherry picked from commit 7a9d6fd9b6564b0bf54b62cb05242964a9763f9e)
2024-07-07 00:15:21 +02:00
James Coglan
6553c41852 resolved: allow the full TTL to be used by OPT records
Whereas RFC 1035 says the TTL field takes the "positive values of a
signed 32 bit number", and RFC 2181 says "Implementations should treat
TTL values received with the most significant bit set as if the entire
value received was zero,", the dns_packet_read_rr() function sets
rr->ttl to zero if the MSB is set.

However, EDNS(0) as specified in RFC 6891 repurposes the TTL field's 4
octets to store other information, c.f.:

                  +0 (MSB)                            +1 (LSB)
       +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
    0: |         EXTENDED-RCODE        |            VERSION            |
       +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
    2: | DO|                           Z                               |
       +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

The first octet extends the usual 4-bit RCODE from the packet header by
providing an additional 8 bits of space, extending the RCODE to 12 bits.
But, our handling of the TTL field means that the high bit in the first
octet is not actually usable, since setting it will mean these 4 octets
are replaced with 0. This may have the effect of making us believe a
server does not support DNSSEC when it actually set the DO bit in its
OPT record.

Here we change things so that the TTL is only set to zero for record
types other than OPT.

(cherry picked from commit 131787979c700becaf6ec24a810658d1313587cc)
(cherry picked from commit 6ead24fcac878b3623408ecb1a05d07f29c4c04c)
(cherry picked from commit 964b184f8e4272b5f18c96e611268c522e67a715)
(cherry picked from commit ad876e65c4c9d8f7da552cfe899f0ff246b5b2a9)
2024-07-07 00:15:21 +02:00
Daan De Meyer
dc1bc1a377 TEST-64-UDEV-STORAGE: Make nvme_subsystem expected pci symlinks more generic
When running the test on aarch64 the symlinks look as follows:

"""
[root@H ~]# ls /dev/disk/by-path
platform-4010000000.pcie-pci-0000:00:04.0-scsi-0:0:0:0       platform-4010000000.pcie-pci-0000:00:04.0-scsi-0:0:0:0-part1  platform-4010000000.pcie-pci-0000:00:05.0-nvme-16
platform-4010000000.pcie-pci-0000:00:04.0-scsi-0:0:0:0-part  platform-4010000000.pcie-pci-0000:00:04.0-scsi-0:0:0:0-part2  platform-4010000000.pcie-pci-0000:00:05.0-nvme-17
"""

So let's make the PCI patterns a little more generic so they match
both the x86 and the aarch64 paths.

(cherry picked from commit 72d121b60174b825bf1390958eb1b55f34c5ff5b)
(cherry picked from commit dc0167b674bc6b555c25f374719c818bc6ad1416)
(cherry picked from commit d34128a1f1a2fe0148e95fbe76157895a7b951af)
(cherry picked from commit 466a9d3e700a1cecacd54ff60732c931396e666d)
2024-07-07 00:15:21 +02:00
Zbigniew Jędrzejewski-Szmek
12df2461c6 LICENSES/README: expand text to summarize state for binaries and libs
We would say how *sources* are licensed, but actually most user care about the
resulting binaries. So say how the *binaries* are licensed. I used the word
"effectively" because the permissive licenses don't set any requirements on the
binaries, so the license of sources is a complex mix, but the resulting
binaries have a simple effective license.

Also, make it clear that the GPLv2 license applies to udev programs, but not
the shared library. Based on private correspondence, there's some confusion
about this.

(cherry picked from commit bd7236912f373e0a06a1b0395000ec67d96767af)
(cherry picked from commit fb747bd8cdcbeb55f9ef3c62289fff8ff5a25b68)
(cherry picked from commit e22e239cd9d60fd41d197ea39d41c1413d5c9cc6)
(cherry picked from commit 6aa191405e874aace5b7ed54055edaae6e11fc7a)
2024-07-07 00:15:21 +02:00
Zbigniew Jędrzejewski-Szmek
bae78a8373 TEST-58-REPART: reverse order of diff args
I expect the test output to be the second argument, so we're diffing "expected"
and "output", not the other way around.

I noticed this when working on https://github.com/systemd/systemd/pull/33081.

(cherry picked from commit 6bb3ea655d08c0602c99ccd2a580ba102fd19114)
(cherry picked from commit 9663bb74100dd79c1e4e9c6b2377ea1b817ddee5)
(cherry picked from commit 5469bc61185163119bec209612e0a72381ba232c)
(cherry picked from commit b8b652d11f2c49be5a841fe61c28e038ea1ea04a)
2024-07-07 00:15:21 +02:00
Mike Yuan
f2d03b7030 mountpoint-util: do not assume symlinks are not mountpoints
They very much can be with the new mount API.

(cherry picked from commit 36e48f22af102843b6cceeda5a2292e57434d2ee)
(cherry picked from commit 99cb4bdbbb15f3812de7f0fd161f91335000790d)
(cherry picked from commit 98a4c8009b655b74ccdbe3664ca9191d40cf3343)
(cherry picked from commit a7828d53dd2bbf7e03683429754ac173e6f5966d)
2024-07-07 00:15:21 +02:00
Florian Schmaus
f8cf25286c core/exec-invoke: use sched_setattr instead of sched_setscheduler
The kernel's sched_setattr interface allows for more control over a processes
scheduling attributes as the previously used sched_setscheduler interface.

Using sched_setattr is also the prerequisite for support of utilization
clamping (UCLAMP [1], see #26705) and allows to set sched_runtime. The latter,
sched_runtime, will probably become a relevant scheduling parameter of the
EEVDF scheduler [2, 3], and therefore will not only apply to processes
scheduled via SCHED_DEADLINE, but also for processes scheduled via
SCHED_OTHER/SCHED_BATCH (i.e., most processes).

1: https://docs.kernel.org/next/scheduler/sched-util-clamp.html
2: https://lwn.net/Articles/969062/
3: https://lwn.net/ml/linux-kernel/20240405110010.934104715@infradead.org/
(cherry picked from commit 016e9d8d08ce66f5e81b42e0a0db398afc17336a)
(cherry picked from commit fb7ec285c98d9eeaa69d1efda3e450e6f7207e57)
(cherry picked from commit 02e50f7a4b53e56b051889b982fa43118c577493)
(cherry picked from commit fc96019babd5658b140ea2f45bfda5fd101434c7)
2024-07-07 00:15:21 +02:00