Debian Patches

Status for systemd/247.3-7+deb11u6

Patch Description Author Forwarded Bugs Origin Last update
Add-helper-for-case-independent-string-equality-checks.patch Add helper for case-independent string equality checks
(cherry picked from commit bd47b0dac4a1ff6e686c99b9958693e86d44007b)
Matthias Klumpp <matthias@tenstral.net> no 2020-10-10
localed-Run-locale-gen-if-available-to-generate-missing-l.patch localed: Run locale-gen if available to generate missing locale
This change improves integration with distributions using locale-gen to
generate missing locale on-demand, like Debian-based distributions
(Debian/Ubuntu/PureOS/Tanglu/...) and Arch Linux.
We only ever enable new locales for generation, and never disable them.
Furthermore, we only generate UTF-8 locale.

This feature is only used if explicitly enabled at compile-time, and
will also be inert at runtime if the locale-gen binary is missing.

(cherry picked from commit 8f20232fcb52dbe6255f3df6101fc057af90bcfa)
Matthias Klumpp <matthias@tenstral.net> no 2021-01-08
core-fix-mtime-calculation-of-dropin-files.patch core: fix mtime calculation of dropin files
Nominally, the bug was in unit_load_dropin(), which just took the last mtime
instead of calculating the maximum. But instead of adding code to wrap the
loop, this patch goes in the other direction.

All (correct) callers of config_parse() followed a very similar pattern to
calculate the maximum mtime. So let's simplify things by making config_parse()
assume that mtime is initialized and update it to the maximum. This makes all
the callers that care about mtime simpler and also fixes the issue in
unit_load_dropin().

config_parse_many_nulstr() and config_parse_many() are different, because it
makes sense to call them just once, and current ret_mtime behaviour make sense.

Fixes #17730, https://bugzilla.redhat.com/show_bug.cgi?id=1933137.

(cherry picked from commit da46a1bc3cd28ac36114002c216196dae004b05c)
=?utf-8?q?Zbigniew_J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl> no 2021-03-04
analyze-slightly-reword-PrivateTmp-message.patch analyze: slightly reword PrivateTmp= message
Apparently there way confusion about "does not apply". Let's say "is not
appropriate".

(cherry picked from commit 77552b9520ba0d47cbf33cdbe1ddedb9ce9b5bf3)
Lennart Poettering <lennart@poettering.net> no 2021-02-10
rules-Move-ID_SMARTCARD_READER-definition-to-a-70-configu.patch rules: Move ID_SMARTCARD_READER definition to a <70 configuration.
70-uaccess.rules sets the uaccess tag on devices with ID_SMARTCARD_READER
set, but it is set in 99-systemd.rules .
Move this to a 60-*.rules which already matches USB CCID class, factorising
the matching, so 70-uaccess.rules sets up these devices as expected.

(cherry picked from commit dbdcd51f78bde5e9033d98d61bbb750c868bde9d)
Vincent Pelletier <plr.vincent@gmail.com> no 2021-02-27
table-drop-trailing-white-spaces-of-the-last-cell-in-row.patch table: drop trailing white spaces of the last cell in row
Fixes #18415.

(cherry picked from commit 71894e18313e41a72cecdc77fea5037f95d6903f)
Yu Watanabe <watanabe.yu+github@gmail.com> no 2021-02-02
pkg-config-make-prefix-overridable-again.patch pkg-config: make prefix overridable again
While we don't support prefix being != /usr, and this is hardcoded
all over the place, variables in pkg-config file are expected
to have overridable base directory.

This is important for at least the following two use cases:

- Installing projects to non-FHS package-specific prefixes for Nix-style
package managers. Of course, it is then their responsibility
to ensure systemd can find the service files.
- Installing to local path for development purposes.
This is a compromise between running a program from a build directory,
and running it fully installed to system prefix.

You will not want to write to system prefix in either case.

For more information, see also
https://www.bassi.io/articles/2018/03/15/pkg-config-and-paths/

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

Partially reverts 6e65df89c348242dbd10036abc7dd5e8181cf733

(cherry picked from commit 60bce7c6d9606185114df1bdcd5ea100407688b8)
Jan Tojnar <jtojnar@gmail.com> no 2021-01-02
LoadCredentials-do-not-assert-on-invalid-syntax.patch LoadCredentials: do not assert on invalid syntax
LoadCredentials=foo causes an assertion to be triggered, as we
are not checking that the rvalue's right hand side part is non-empty
before using it in unit_full_printf.

Fixes #19178

# printf [Service]nLoadCredential=passwd.hashed-password.rootn > hello.service
# systemd-analyze verify ./hello.service
...
Assertion 'format' failed at src/core/unit-printf.c:232, function unit_full_printf(). Aborting.
Aborted (core dumped)

(cherry picked from commit f7a6f1226e800f7695c2073675523062ea697aa4)
Luca Boccassi <luca.boccassi@microsoft.com> no 2021-04-01
network-Delay-addition-of-IPv6-Proxy-NDP-addresses.patch network: Delay addition of IPv6 Proxy NDP addresses
Setting of IPv6 Proxy NDP addresses must be done at the same
time as static addresses, static routes, and other link attributes
that must be configured when the link is up. Doing this ensures
that they are reconfigured on the link if the link goes down
and returns to service.

(cherry picked from commit 12f7469bbe0142d7f360a29ca2b407ce7f5ff096)

Fixes https://github.com/systemd/systemd-stable/issues/89

(cherry picked from commit d5ea028e46673ef627843e90c3d01ebac8fe0e62)
"Kevin P. Fleming" <kevin@km6g.us> no 2021-02-06
unit-name-generate-a-clear-error-code-when-convertin.patch unit-name: generate a clear error code when converting an overly long fs path to a unit name

(cherry picked from commit 9d5acfab20c5f1177d877d0bec18063c0a6c5929)
(cherry picked from commit 1579dce2c2a162bb09afb9a8a46fd4f7e8fbf1d5)
(cherry picked from commit 0488b743e9c6ab1e885933eebda4ba9232003a2a)
Lennart Poettering <lennart@poettering.net> no 2021-06-01
basic-unit-name-do-not-use-strdupa-on-a-path.patch basic/unit-name: do not use strdupa() on a path
The path may have unbounded length, for example through a fuse mount.

CVE-2021-33910: attacked controlled alloca() leads to crash in systemd and
ultimately a kernel panic. Systemd parses the content of /proc/self/mountinfo
and each mountpoint is passed to mount_setup_unit(), which calls
unit_name_path_escape() underneath. A local attacker who is able to mount a
filesystem with a very long path can crash systemd and the whole system.

https://bugzilla.redhat.com/show_bug.cgi?id=1970887

The resulting string length is bounded by UNIT_NAME_MAX, which is 256. But we
can't easily check the length after simplification before doing the
simplification, which in turns uses a copy of the string we can write to.
So we can't reject paths that are too long before doing the duplication.
Hence the most obvious solution is to switch back to strdup(), as before
7410616cd9dbbec97cf98d75324da5cda2b2f7a2.

(cherry picked from commit 441e0115646d54f080e5c3bb0ba477c892861ab9)
(cherry picked from commit 764b74113e36ac5219a4b82a05f311b5a92136ce)
(cherry picked from commit 4a1c5f34bd3e1daed4490e9d97918e504d19733b)
(cherry picked from commit b00674347337b7531c92fdb65590ab253bb57538)
=?utf-8?q?Zbigniew_J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl> no 2021-06-23
basic-unit-name-adjust-comments.patch basic/unit-name: adjust comments
We already checked for "too long" right above…

(cherry picked from commit 4e2544c30bfb95e7cb4d1551ba066b1a56520ad6)
=?utf-8?q?Zbigniew_J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl> no 2021-06-23
udevadm-trigger-do-not-return-immediately-on-EACCES.patch udevadm-trigger: do not return immediately on EACCES
Prompted by https://github.com/systemd/systemd/pull/18559.

(cherry picked from commit 0e789e6d48046d43c50dd949a71ac56f1127bb96)
Yu Watanabe <watanabe.yu+github@gmail.com> no 2021-02-20
btrfs-util-add-helper-that-abstracts-might-be-btrfs-subvo.patch btrfs-util: add helper that abstracts "might be btrfs subvol?" check
Let#s not hardcode inode nr 256 everywhere, but abstract this check
slightly.

(cherry picked from commit 674b04ff1b6deab17f5d36c036c0275ba94e1ebc)
(cherry picked from commit 190c6bcfc3518bec964ab740085ac88ccc86dcc7)
Lennart Poettering <lennart@poettering.net> no 2021-02-26
rm-rf-fstatat-might-fail-if-containing-dir-has-limited-ac.patch rm-rf: fstatat() might fail if containing dir has limited access mode, patch that too

(cherry picked from commit 1b55621dabf741dd963f59ac706ea62cd6e3e95c)
(cherry picked from commit ce53b81a600e2162ee86e2f4d202e7f28eceb2c6)
Lennart Poettering <lennart@poettering.net> no 2021-01-26
rm-rf-refactor-rm_rf_children-split-out-body-of-directory.patch rm-rf: refactor rm_rf_children(), split out body of directory iteration loop

This splits out rm_rf_children_inner() as body of the loop. We can use
that to implement rm_rf_child() for deleting one specific entry in a
directory.

(cherry picked from commit 1f0fb7d544711248cba34615e43c5a76bc902d74)
(cherry picked from commit ca4a0e7d41f0b2a1fe2f99dbc3763187c16cf7ab)
(cherry picked from commit 85ccac3393e78d4bf2776ffb8c3a1d8a2a909a2a)
(cherry picked from commit a87d7ff1a60fe359978e12eb34224255a8f33e27)
Lennart Poettering <lennart@poettering.net> no 2021-01-26
rm-rf-optionally-fsync-after-removing-directory-tree.patch rm-rf: optionally fsync() after removing directory tree
(cherry picked from commit bdfe7ada0d4d66e6d6e65f2822acbb1ec230f9c2)
(cherry picked from commit 2426beacca09d84091759be45b25c88116302184)
(cherry picked from commit 0e180f8e9c25c707b0465ad1b9447a4360f785f1)
(cherry picked from commit 9a9c2220cd3cb61c2de9c482f8ed7fa60807b14a)
Lennart Poettering <lennart@poettering.net> no 2021-10-05
tmpfiles-st-may-have-been-used-uninitialized.patch tmpfiles: 'st' may have been used uninitialized
(cherry picked from commit 160dadc0350c77d612aa9d5569f57d9bc84c3dca)
(cherry picked from commit 7563de501246dccf5a9ea229933481aa1e7bd5c9)
(cherry picked from commit f54b97b1d05052bfee824ecc03ae9f07f6c37be8)
(cherry picked from commit ab927db9a7698ee1eceae14ecef7ab43ee3f104e)
=?utf-8?q?Zbigniew_J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl> no 2021-11-23
shared-rm_rf-refactor-rm_rf_children_inner-to-shorten-cod.patch shared/rm_rf: refactor rm_rf_children_inner() to shorten code a bit
(cherry picked from commit 3bac86abfa1b1720180840ffb9d06b3d54841c11)
(cherry picked from commit 47741ff9eae6311a03e4d3d837128191826a4a3a)
(cherry picked from commit 89395b63f04f1acc0db533c32637ea20379f97c0)
(cherry picked from commit 3976f244990aa1210ebe018647f32ab060e1c3d3)
(cherry picked from commit 988e43630bb7592947c75fe530a6f7dfebc00c4f)
=?utf-8?q?Zbigniew_J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl> no 2021-11-23
shared-rm_rf-refactor-rm_rf-to-shorten-code-a-bit.patch shared/rm_rf: refactor rm_rf() to shorten code a bit
(cherry picked from commit 84ced330020c0bae57bd4628f1f44eec91304e69)
(cherry picked from commit 664529efa9431edc043126013ea54e6c399ae2d3)
(cherry picked from commit 811b137d6137cc3e8932599e6ef9254ba43ff5eb)
(cherry picked from commit 39a53d4f1445a8981efd0adcc1734dfad46647c5)
(cherry picked from commit aaad978868bd6ac84d463a94357ddcbc43b24248)
=?utf-8?q?Zbigniew_J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl> no 2021-11-23
shared-rm-rf-loop-over-nested-directories-instead-of-inst.patch shared/rm-rf: loop over nested directories instead of instead of recursing

To remove directory structures, we need to remove the innermost items first,
and then recursively remove higher-level directories. We would recursively
descend into directories and invoke rm_rf_children and rm_rm_children_inner.
This is problematic when too many directories are nested.

Instead, let's create a "TODO" queue. In the the queue, for each level we
hold the DIR* object we were working on, and the name of the directory. This
allows us to leave a partially-processed directory, and restart the removal
loop one level down. When done with the inner directory, we use the name to
unlinkat() it from the parent, and proceed with the removal of other items.

Because the nesting is increased by one level, it is best to view this patch
with -b/--ignore-space-change.

This fixes CVE-2021-3997, https://bugzilla.redhat.com/show_bug.cgi?id=2024639.
The issue was reported and patches reviewed by Qualys Team.
Mauro Matteo Cascella and Riccardo Schirone from Red Hat handled the disclosure.

(cherry picked from commit 5b1cf7a9be37e20133c0208005274ce4a5b5c6a1)
(cherry picked from commit 911516e1614e435755814ada5fc6064fa107a105)
(cherry picked from commit 6a28f8b55904c818b25e4db2e1511faac79fd471)
(cherry picked from commit c752f27b7647c99b4a17477c99d84fd8c950ddf0)
(cherry picked from commit 921810ea23357988ce67f49190f43abef1788a9c)
=?utf-8?q?Zbigniew_J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl> no 2021-11-30
basic-add-make_mount_point_inode-helper.patch basic: add make_mount_point_inode helper
Creates a file or a directory depending on the source path, useful
for creating mount points.

(cherry picked from commit 8bab8029105e44ce78c5e11bffa203a1135fe201)
Luca Boccassi <bluca@debian.org> no 2020-12-19
machine-basic-factor-out-helper-function-to-add-airlocked.patch machine/basic: factor out helper function to add airlocked mount to namespace

(cherry picked from commit 6af52c3a458691b016bedeba34c1e72294a67c81)
Luca Boccassi <luca.boccassi@microsoft.com> no 2020-08-13
machine-adjust-error-message-to-use-normalized-instead-of.patch machine: adjust error message to use 'normalized' instead of ../
(cherry picked from commit 724e689715c8d9f23d035ab20d8c87b6b6c06e33)
Luca Boccassi <luca.boccassi@microsoft.com> no 2020-12-15
shared-mount-util-use-namespace_fork-utils.patch shared/mount-util: use namespace_fork utils
(cherry picked from commit 2338a175fdec3859eab03115ca82a0d58453f5d7)
Luca Boccassi <luca.boccassi@microsoft.com> no 2020-08-13
machine-enter-target-PID-namespace-when-adding-a-live-mou.patch machine: enter target PID namespace when adding a live mount
machinectl fails since 21935150a0c42b91a322105f6a9129116bfc8e2e as it's now
mounting onto a file descriptor in a target namespace, without joining the
target's PID namespace.
Note that it's not enough to setns CLONE_NEWPID, but a double-fork is required
as well, as implemented by namespace_fork().

Add a test case to TEST-13-NSPAWN to cover this use case.

(cherry picked from commit 98f654fdeab1e1b6df2be76e29e4ccbb6624898d)
Luca Boccassi <bluca@debian.org> no 2021-01-13
Drop-bundled-copy-of-linux-if_arp.h.patch Drop bundled copy of linux/if_arp.h
As far as I can see, we use this to get a list of ARPHRD_* defines (used in
particular for Type= in .link files). If we drop our copy, and build against
old kernel headers, the user will have a shorter list of types available. This
seems OK, and I don't think it's worth carrying our own version of this file
just to have newest possible entries.

7c5b9952c4f6e2b72f90edbe439982528b7cf223 recently updated this file, but we'd
have to update it every time the kernel adds new entries. But if we look at
the failure carefully:

src/basic/arphrd-from-name.gperf:65:16: error: ‘ARPHRD_MCTP’ undeclared (first use in this function); did you mean ‘ARPHRD_FCPP’?
65 | MCTP, ARPHRD_MCTP
| ^~
| ARPHRD_FCPP

we see that the list we were generating was from the system headers, so it was
only as good as the system headers anyway, without the newer entries in our
bundled copy, if there were any. So let's make things simpler by always using
system headers.

And if somebody wants to fix things so that we always have the newest list,
then we should just generate and store the converted list, not the full header.

(cherry picked from commit e7f46ee3ae1cc66a94b293957721d68dc09d7449)
=?utf-8?q?Zbigniew_J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl> no 2021-09-15
virt-Support-detection-for-ARM64-Hyper-V-guests.patch virt: Support detection for ARM64 Hyper-V guests
The detection of Microsoft Hyper-V VMs is done by cpuid currently,
however there is no cpuid on ARM64. And since ARM64 is now a supported
architecture for Microsoft Hyper-V guests[1], then use DMI tables to
detect a Hyper-V guest, which is more generic and works for ARM64.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7aff79e297ee1aa0126924921fd87a4ae59d2467

(cherry picked from commit 506bbc8569014253ea8614b680ccbc4fc2513a87)
Boqun Feng <boqun.feng@gmail.com> no 2021-10-13
virt-Fix-the-detection-for-Hyper-V-VMs.patch virt: Fix the detection for Hyper-V VMs
Use product_version instead of product_name in DMI table and the string
"Hyper-V" to avoid misdetection.


(cherry picked from commit 76eec0649936d9ae2f9087769f463feaf0cf5cb4)
Boqun Feng <boqun.feng@gmail.com> no 2021-11-23
virt-detect-OpenStack-Nova-instance.patch virt: detect OpenStack Nova instance
(cherry picked from commit 01d9fbccddd694bc584aed24eaa0543f831dc929)
Michael Biebl <biebl@debian.org> no 2022-08-07
ata_id-Fixed-getting-Response-Code-from-SCSI-Sense-Data-2.patch ata_id: Fixed getting Response Code from SCSI Sense Data (#24921)
The Response Code is contained in the first byte of the SCSI Sense Data.
Bit number 7 is reserved or has a different meaning for some Response Codes
and is set to 1 for some drives.

(cherry picked from commit 2be1ae54badf7a3a12908a8094ebaba8f91887ca)
Aleksey Vasenev <margtu-fivt@ya.ru> no 2022-10-05
udev-always-create-device-symlinks-for-USB-disks.patch udev: always create device symlinks for USB disks
Previously, ata_id might not be able to retrieve attributes correctly,
and properties from usb_id were used as a fallback. See issue #24921
and PR #24923. To keep backward compatibility, still we need to create
symlinks based on USB serial.

Fixes #25179.
Yu Watanabe <watanabe.yu+github@gmail.com> no 2022-10-30
Revert-udev-do-not-execute-hwdb-builtin-import-twice-or-t.patch Revert "udev: do not execute hwdb builtin import twice or thrice"
This reverts commit 876c75fe870846b09b54423a6b719d80bc879b27.

The patch seems to cause usb devices to get some attributes set from the parent
PCI device. 'hwdb' builtin has support for breaking iteration upwards on usb
devices. But when '--subsystem=foo' is specified, iteration is continued. I'm
sure it *could* be figured out, but it seems hard to get all the combinations
correct. So let's revert to functional status quo ante, even if does the lookup
more than once unnecessarily.

Fixes #18125.

(cherry picked from commit 451ba55fecd8b494add2001b3ca3c1915c8fd655)
=?utf-8?q?Zbigniew_J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl> no 2021-03-10
udev-first-set-properties-based-on-usb-subsystem.patch udev: first set properties based on usb subsystem
After 479da1107a0d4e2f7ef5cd938512b87a0e45f180, the usb_id builtin
command does not set ID_SERIAL if ID_BUS is already set.
Before the commit, all properties set based on pci bus were overwritten
by the usb_id, hence now it is sufficient setting them only when ID_BUS is
not set yet.

Fixes #25238.

(cherry picked from commit 01e704eba982fbc1517287cd261d229ff8e0a779)
Yu Watanabe <watanabe.yu+github@gmail.com> no 2022-11-03
logind-fix-getting-property-OnExternalPower-via-D-Bus.patch logind: fix getting property OnExternalPower via D-Bus
The BUS_DEFINE_PROPERTY_GET_GLOBAL macro requires a value as third
argument, so we need to call manager_is_on_external_power(). Otherwise
the function pointer is interpreted as a boolean and always returns
true:

```
$ busctl get-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager OnExternalPower
b true
$ /lib/systemd/systemd-ac-power --verbose
no
```

(cherry picked from commit 63168cb517a556b2f4f175b365f5a4b4c7e85150)
Michael Biebl <biebl@debian.org> no debian 2022-10-12
coredump-do-not-allow-user-to-access-coredumps-with-chang.patch coredump: do not allow user to access coredumps with changed uid/gid/capabilities

When the user starts a program which elevates its permissions via setuid,
setgid, or capabilities set on the file, it may access additional information
which would then be visible in the coredump. We shouldn't make the the coredump
visible to the user in such cases.


This reads the /proc/<pid>/auxv file and attaches it to the process metadata as
PROC_AUXV. Before the coredump is submitted, it is parsed and if either
at_secure was set (which the kernel will do for processes that are setuid,
setgid, or setcap), or if the effective uid/gid don't match uid/gid, the file
is not made accessible to the user. If we can't access this data, we assume the
file should not be made accessible either. In principle we could also access
the auxv data from a note in the core file, but that is much more complex and
it seems better to use the stand-alone file that is provided by the kernel.

Attaching auxv is both convient for this patch (because this way it's passed
between the stages along with other fields), but I think it makes sense to save
it in general.

We use the information early in the core file to figure out if the program was
32-bit or 64-bit and its endianness. This way we don't need heuristics to guess
whether the format of the auxv structure. This test might reject some cases on
fringe architecutes. But the impact would be limited: we just won't grant the
user permissions to view the coredump file. If people report that we're missing
some cases, we can always enhance this to support more architectures.

I tested auxv parsing on amd64, 32-bit program on amd64, arm64, arm32, and
ppc64el, but not the whole coredump handling.

(cherry picked from commit 3e4d0f6cf99f8677edd6a237382a65bfe758de03)
(cherry picked from commit 9b75a3d0502d6741c8ecb7175794345f8eb3827c)
(cherry picked from commit efca5283dc791a07171f80eef84e14fdb58fad57)
(cherry picked from commit 1d5e0e9910500f3c3584485f77bfc35e601036e3)
(cherry picked from commit 8215e1527d859e77dd1378fd7e42bbd32130edb3)
(cherry picked from commit 786df410b1cb3a2294c9a5d118c958525e7439e6)
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> no 2022-11-28
time-util-fix-buffer-over-run.patch time-util: fix buffer-over-run
Fixes #23928.

(cherry picked from commit 9102c625a673a3246d7e73d8737f3494446bad4e)
(cherry picked from commit 72d4c15a946d20143cd4c6783c802124bc894dc7)
(cherry picked from commit c32530f5bdd11c74e8f5a86eecd7c36b3bae739f)
(cherry picked from commit b2a25b5e64345bd0bb7697a956d33afd6980286a)
(cherry picked from commit 858dc1ad609290cc4ca288acf87046ee295c3d51)
Yu Watanabe <watanabe.yu+github@gmail.com> no 2022-07-07
machined-varlink-fix-double-free.patch machined-varlink: fix double free David Tardon <dtardon@redhat.com> no 2021-08-02
Always-free-deserialized_subscribed-on-reload.patch Always free deserialized_subscribed on reload
Otherwise, it will keep consuming memory on systemctl daemon-reload.

(cherry picked from commit 3deed59afdc2c18ecb76fe90b9bba0cd66045dfa)
Ali Abdallah <ali.abdallah@suse.com> no 2021-01-21
shared-calendarspec-abort-calculation-after-1000-iteratio.patch shared/calendarspec: abort calculation after 1000 iterations
We have a bug where we seem to enter an infinite loop when running in the
Europe/Dublin timezone. The timezone is "special" because it has negative SAVE
values. The handling of this should obviously be fixed, but let's use a
belt-and-suspenders approach, and gracefully fail if we fail to find an answer
within a specific number of attempts. The code in this function is rather
complex, and it's hard to rule out another bug in the future.

(cherry picked from commit 169615c9a8cdc54d748d4dfc8279be9b3c2bec44)
=?utf-8?q?Zbigniew_J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl> no 2021-03-21
shared-calendarspec-when-mktime-moves-us-backwards-jump-f.patch shared/calendarspec: when mktime() moves us backwards, jump forward
When trying to calculate the next firing of 'Sun *-*-* 01:00:00', we'd fall
into an infinite loop, because mktime() moves us "backwards":

Before this patch:
tm_within_bounds: good=0 2021-03-29 01:00:00 → 2021-03-29 00:00:00
tm_within_bounds: good=0 2021-03-29 01:00:00 → 2021-03-29 00:00:00
tm_within_bounds: good=0 2021-03-29 01:00:00 → 2021-03-29 00:00:00
...

We rely on mktime() normalizing the time. The man page does not say that it'll
move the time forward, but our algorithm relies on this. So let's catch this
case explicitly.

With this patch:
$ TZ=Europe/Dublin faketime 2021-03-21 build/systemd-analyze calendar --iterations=5 'Sun *-*-* 01:00:00'
Normalized form: Sun *-*-* 01:00:00
Next elapse: Sun 2021-03-21 01:00:00 GMT
(in UTC): Sun 2021-03-21 01:00:00 UTC
From now: 59min left
Iter. #2: Sun 2021-04-04 01:00:00 IST
(in UTC): Sun 2021-04-04 00:00:00 UTC
From now: 1 weeks 6 days left <---- note the 2 week jump here
Iter. #3: Sun 2021-04-11 01:00:00 IST
(in UTC): Sun 2021-04-11 00:00:00 UTC
From now: 2 weeks 6 days left
Iter. #4: Sun 2021-04-18 01:00:00 IST
(in UTC): Sun 2021-04-18 00:00:00 UTC
From now: 3 weeks 6 days left
Iter. #5: Sun 2021-04-25 01:00:00 IST
(in UTC): Sun 2021-04-25 00:00:00 UTC
From now: 1 months 4 days left

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1941335.

(cherry picked from commit 129cb6e249bef30dc33e08f98f0b27a6de976f6f)
=?utf-8?q?Zbigniew_J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl> no 2021-03-22
test-unset-TZ-before-timezone-sensitive-unit-tests-are-ru.patch test: unset TZ before timezone-sensitive unit tests are run
Some tests have hard-coded results that need to match, and change if
the caller has a timezone set via the TZ= environment variable, as it
is the case during reproducible build tests. Unset it.

(cherry picked from commit 1e902c3463024bb328bf0d01a5d58a69e1ccf739)
(cherry picked from commit 85c88db9c64242f65c814f1ede467ef66066e663)
(cherry picked from commit d7fa5b8acbb5013992ae93c120845f0dc3fcfa93)
(cherry picked from commit 4d6d1a9f0557771e09a210ea9e83a7ed20df78de)
(cherry picked from commit d91a1c0f2c661731bc8a2149807ed9fd613b7c80)
Luca Boccassi <bluca@debian.org> no 2024-01-26
meson-drop-arch-filtering-in-syscall-list.patch meson: drop arch filtering in syscall list
I added the filtering in 752fedbea7c02c82287c7ff2a4139f528b3f7ba8 as a way
to reduce the number of items in the tables. I thought it's "obvious", but
it might not be so.

One immediate problem is that the filter is broken, because on arm64,
os.uname().machine returns "aarch64", so we incorrectly filter out the arm
syscalls (there is just one: arm_fadvise64_64). Of course we could fix the
filter, but I think it's better to nuke it altogether. The filter on applies to
1 arm syscall and 5 s390 syscalls, and we have 500+ other syscalls, so this
"optimization" doesn't really matter. OTOH, if we get the filter wrong,
the result is bad. And also, the existence of the filter at all creates
problems for cross-builds.

I wanted to get rid of 'generate-syscall-list.py', but we need to generate a
backslash in the output. https://github.com/mesonbuild/meson/issues/1564 makes
this very very hard, since any attempt to put a backslash an inline argument
results in the backslash being replaces by a forward slash, which doesn't quite
have the same meaning. So let's use a standalone script until
https://github.com/mesonbuild/meson/issues/1564 is resolved.

(cherry picked from commit 58fcc6b013bbc8c6290348f701ddb862928cc1a0)
(cherry picked from commit ded73e68fcbfbf82beba15a8f0280e5c010c8bde)
(cherry picked from commit d31ac846b22dc7d1245b4df01a1868866b529447)
(cherry picked from commit f9242887943fa2e7345f915fbfacd235d67dbed7)
(cherry picked from commit b23b2680ff2520e760c6b0f7b285a2334a4ac1c7)
=?utf-8?q?Zbigniew_J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl> no 2024-01-25
debian/Use-Debian-specific-config-files.patch Use Debian specific config files
Use /etc/default/locale instead of /etc/locale.conf for locale settings.

Use /etc/default/keyboard instead of /etc/X11/xorg.conf.d/00-keyboard.conf for
keyboard configuration.

Read/write /etc/timezone if /etc/localtime does not exist.
Michael Biebl <biebl@debian.org> no 2013-07-18
debian/Bring-tmpfiles.d-tmp.conf-in-line-with-Debian-defaul.patch Bring tmpfiles.d/tmp.conf in line with Debian defaults Tollef Fog Heen <tfheen@err.no> no 2012-06-05
debian/Make-run-lock-tmpfs-an-API-fs.patch Make /run/lock tmpfs an API fs
The /run/lock directory is world-writable in Debian due to historic
reasons. To avoid user processes filling up /run, we mount a separate
tmpfs for /run/lock. As this directory needs to be available during
early boot, we make it an API fs.

Drop it from tmpfiles.d/legacy.conf to not clobber the permissions.
Michael Biebl <biebl@debian.org> no 2014-09-05
debian/Add-support-for-TuxOnIce-hibernation.patch Add support for TuxOnIce hibernation
systemd does not support non-mainline kernel features so upstream rejected this
patch.
It is however required for systemd integration by tuxonice-userui package.
Julien Muchembled <jm@jmuchemb.eu> yes 2014-04-29
debian/Re-enable-journal-forwarding-to-syslog.patch Re-enable journal forwarding to syslog
Revert upstream commit 46b131574fdd7d77 for now, until Debian's sysloggers
can/do all read from the journal directly. See

http://lists.freedesktop.org/archives/systemd-devel/2014-November/025550.html

for details. Once we grow a journal.conf.d/ directory, sysloggers can be moved
to pulling from the journal one by one and disable forwarding again in such a
conf.d snippet.
Martin Pitt <martin.pitt@ubuntu.com> no 2014-11-28
debian/Don-t-enable-audit-by-default.patch Don't enable audit by default
It causes flooding of dmesg and syslog, suppressing actually important
messages.

Don't enable it for now, until a better solution is found:
http://lists.freedesktop.org/archives/systemd-devel/2014-December/026591.html
Martin Pitt <martin.pitt@ubuntu.com> no debian 2014-12-28
debian/Only-start-logind-if-dbus-is-installed.patch Only start logind if dbus is installed
logind fails to start in environments without dbus, such as LXC containers or
servers. Add a startup condition to avoid the very noisy startup failure.

Part of #772700
Martin Pitt <martin.pitt@ubuntu.com> no 2015-02-09
debian/fsckd-daemon-for-inter-fsckd-communication.patch fsckd daemon for inter-fsckd communication
Global logic:
Add systemd-fsckd multiplexer which accepts multiple (via systemd-fsck's
/run/systemd/fsck.progress socket) fsck instances to connect to it and sends
progress report. systemd-fsckd then computes and writes to /dev/console the
number of devices currently being checked and the minimum fsck progress.

Plymouth and user interaction:
Forward the progress to plymouth and support canellation of in progress fsck.
Try to connect and send to plymouth (if running) some checked report progress,
using direct plymouth protocole.

Update message is the following:
fsckd:<num_devices>:<progress>:<string>
* num_devices corresponds to the current number of devices being checked (int)
* progress corresponds to the current minimum percentage of all devices being
checked (float, from 0 to 100)
* string is a translated message ready to be displayed by the plymouth theme
displaying the information above. It can be overridden by plymouth themes
supporting i18n.

Grab in fsckd plymouth watch key Control+C, and propagate this cancel request
to systemd-fsck which will terminate fsck.

Send a message to signal to user what key we are grabbing for fsck cancel.

Message is: fsckd-cancel-msg:<string>
Where string is a translated string ready to be displayed by the plymouth theme
indicating that Control+C can be used to cancel current checks. It can be
overridden (matching only fsckd-cancel-msg prefix) for themes supporting i18n.

Misc:
systemd-fsckd stops on idle when no fsck is connected.
Add man page explaining the plymouth theme protocol, usage of the daemon
as well as the socket activation part. Adapt existing fsck man page.

Note that fsckd had lived in the upstream tree for a while, but was removed.
More information at
http://lists.freedesktop.org/archives/systemd-devel/2015-April/030175.html
-
Didier Roche <didrocks@ubuntu.com> no 2015-05-22
debian/Skip-filesystem-check-if-already-done-by-the-initram.patch Skip filesystem check if already done by the initramfs
Newer versions of initramfs-tools already fsck and mount / and /usr in
the initramfs. Skip the filesystem check in this case.

Based on a previous patch by Michael Biebl <biebl@debian.org>.
Nis Martensen <nis.martensen@web.de> no 2016-01-19
debian/Revert-core-one-step-back-again-for-nspawn-we-actual.patch Revert "core: one step back again, for nspawn we actually can't wait for cgroups running empty since systemd
will get exactly zero notifications about it"

This reverts commit 743970d2ea6d08aa7c7bff8220f6b7702f2b1db7.
Martin Pitt <martin.pitt@ubuntu.com> no debian 2015-04-27
debian/Revert-core-set-RLIMIT_CORE-to-unlimited-by-default.patch Revert "core: set RLIMIT_CORE to unlimited by default"
Partially revert commit 15a900327ab as this completely breaks core dumps
without systemd-coredump. It's also contradicting core(8), and it's not
systemd's place to redefine the kernel definitions of core files.

Commit bdfd7b2c now honours the process' RLIMIT_CORE for systemd-coredump. This
isn't what RLIMIT_CORE is supposed to do (it limits the size of the core
*file*, but the kernel deliberately ignores it for piping), so set a static
2^63 core size limit for systemd-coredump to go back to the previous behaviour
(otherwise the change above would break systemd-coredump).
Martin Pitt <martin.pitt@ubuntu.com> no debian 2016-02-27
debian/Let-graphical-session-pre.target-be-manually-started.patch Let graphical-session-pre.target be manually started
This is needed until https://github.com/systemd/systemd/issues/3750 is fixed.
Iain Lane <iain@orangesquash.org.uk> not-needed 2016-08-22
debian/Add-env-variable-for-machine-ID-path.patch Add env variable for machine ID path
During package build, in minimal chroots, or other systems which do not already
have an /etc/machine-id we get six test failures. Introduce a
$SYSTEMD_MACHINE_ID_PATH environment variable which can specify a location
other than /etc/machine-id, so that the unit tests are independent from the
environment.

Also adjust test-fs-util to not assume that /etc/machine-id exists. Use
/etc/passwd instead which is created by base-files.
Martin Pitt <mpitt@debian.org> yes upstream 2017-01-18
debian/Drop-seccomp-system-call-filter-for-udev.patch Drop seccomp system call filter for udev
The seccomp based system call whitelist requires at least systemd 239 to
be the active init and during a dist-upgrade we can't guarantee that
systemd has been fully configured before udev is restarted.

This partially reverts upstream commit
ee8f26180d01e3ddd4e5f20b03b81e5e737657ae.

Once buster is released, this patch can be dropped.
Michael Biebl <biebl@debian.org> no 2018-07-18
debian/deny-list-upstream-test-25.patch deny-list-upstream-test-25 Dan Streetman <ddstreet@canonical.com> yes upstream 2019-11-06
debian/deny-list-upstream-test-02-ppc64el.patch deny-list-upstream-test-02-ppc64el Dan Streetman <ddstreet@canonical.com> yes upstream 2019-11-06
debian/udev-drop-SystemCallArchitectures-native-from-systemd-ude.patch udev: drop SystemCallArchitectures=native from systemd-udevd.service
We can't really control what helper programs are run from other udev
rules. E.g. running i386 binaries under amd64 is a valid use case and
should not trigger a SIGSYS failure.
Michael Biebl <biebl@debian.org> no 2019-11-19
debian/Keep-journal-files-compatible-with-older-versions.patch Keep journal files compatible with older versions
Disable the KEYED-HASH journal feature by default and keep LZ4 (instead
of ZSTD) as default compression for new journal files. Otherwise journal
files are incompatible and can't be read by older journalctl
implementations.

This patch can be dropped in bullseye+1, as journalctl from bullseye
will then be able to read journal files with those features.
Michael Biebl <biebl@debian.org> no 2020-08-17
debian/Move-sysusers.d-sysctl.d-binfmt.d-modules-load.d-back-to-.patch Move sysusers.d/sysctl.d/binfmt.d/modules-load.d back to /usr
In Debian, late mounting of /usr is no longer supported, so it is safe
to install those files in /usr.
We want those facilities in /usr, not /, as this will make an eventual
switch to a merged-usr setup easier.
Michael Biebl <biebl@debian.org> no 2020-10-15
debian/systemctl-do-not-shutdown-immediately-on-scheduled-shutdo.patch systemctl: do not shutdown immediately on scheduled shutdown
When, for whatever reason, a scheduled shutdown fails to be set, systemd
will proceed with immediate shutdown without allowing the user to react.
This is counterintuitive because when a scheduled shutdown is issued,
it means the user wants to shutdown at a specified time in the future,
not immediately. This patch prevents the immediate shutdown and informs
the user that no action will be taken.
Ioanna Alifieraki <ioanna-maria.alifieraki@canonical.com> no 2020-12-17
debian/test-disable-DnsmasqClientTest.test_resolved_etc_hosts-in.patch test: disable DnsmasqClientTest.test_resolved_etc_hosts in networkd-test.py

This test appears to be flaky.
Michael Biebl <biebl@debian.org> no 2021-01-18
debian/Downgrade-a-couple-of-warnings-to-debug.patch Downgrade a couple of warnings to debug
If a package still ships only a SysV init script or if a service file or
tmpfile uses /var/run, downgrade those messages to debug. We can use
lintian to detect those issues.
For service files and tmpfiles in /etc, keep the warning, as those files
are typically added locally and aren't checked by lintian.
Michael Biebl <biebl@debian.org> no 2021-02-16
debian/Revert-udev-fix-memleak.patch Revert "udev: fix memleak"
This reverts commit 5dd2b56443e2ed81c238094f516a622804b35518.
Michael Biebl <biebl@debian.org> no 2021-09-25
debian/Revert-udev-link_update-should-fail-if-the-entry-in-symli.patch Revert "udev: link_update() should fail if the entry in symlink dir couldn't have been created"

This reverts commit c07dc6cedc6e6fbc28a0da3e8c8b12900423b409.
Michael Biebl <biebl@debian.org> no 2021-09-25
debian/Revert-udev-make-algorithm-that-selects-highest-priority-.patch Revert "udev: make algorithm that selects highest priority devlink less susceptible to race conditions"

This reverts commit 30f6dce62cb3a738b20253f2192270607c31b55b.
Michael Biebl <biebl@debian.org> no 2021-09-25
0001-resolved-actually-check-authenticated-flag-of-SOA-tr.patch resolved: actually check authenticated flag of SOA transaction
Fixes #25676
Michal Sekletar <msekleta@redhat.com> no 2023-12-20
0002-resolved-limit-the-number-of-signature-validations-i.patch resolved: limit the number of signature validations in a transaction
It has been demonstrated that tolerating an unbounded number of dnssec
signature validations is a bad idea. It is easy for a maliciously
crafted DNS reply to contain as many keytag collisions as desired,
causing us to iterate every dnskey and signature combination in vain.

The solution is to impose a maximum number of validations we will
tolerate. While collisions are not hard to craft, I still expect they
are unlikely in the wild so it should be safe to pick fairly small
values.

Here two limits are imposed: one on the maximum number of invalid
signatures encountered per rrset, and another on the total number of
validations performed per transaction.
Ronan Pigott <ronan@rjp.ie> no 2024-02-24
0003-resolved-reduce-the-maximum-nsec3-iterations-to-100.patch resolved: reduce the maximum nsec3 iterations to 100
According to RFC9267, the 2500 value is not helpful, and in fact it can
be harmful to permit a large number of iterations. Combined with limits
on the number of signature validations, I expect this will mitigate the
impact of maliciously crafted domains designed to cause excessive
cryptographic work.
Ronan Pigott <ronan@rjp.ie> no 2024-02-25

All known versions for source package 'systemd'

Links