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

62982 Commits

Author SHA1 Message Date
Daan De Meyer
1e39026869 network-generator: Add missing umask(0022)
(cherry picked from commit c9d85c22066f690ab09f0298772bee43583b7d2b)
2023-07-17 16:49:41 +02:00
Daan De Meyer
ed9f4ef014 network-generator: Add missing log_setup()
(cherry picked from commit 8b24bcdfa8c5a4b32cf273d74dc5130626c44c22)
2023-07-17 16:16:23 +02:00
Xeonacid
a4d70c015b seccomp: add riscv_hwprobe to @default
This syscall is for probing hardware capabilities from userspace and should do no harm.
Added in ea3de9ce8a

(cherry picked from commit ca15fc4820ad1ef2d54c695699de949974dc5bbc)
2023-07-17 16:15:36 +02:00
Luca Boccassi
47281053e4 Revert "unit: add ordering dep relative to credentials dir"
Causes a cycle at shutdown, undo the backport.

Jul 10 22:13:21 H systemd[1]: poweroff.target: Trying to enqueue job poweroff.target/start/replace-irreversibly
Jul 10 22:13:21 H systemd[1]: local-fs-pre.target: Found ordering cycle on run-credentials-systemd\x2dtmpfiles\x2dsetup\x2ddev.service.mount/stop
Jul 10 22:13:21 H systemd[1]: local-fs-pre.target: Found dependency on systemd-tmpfiles-setup-dev.service/stop
Jul 10 22:13:21 H systemd[1]: local-fs-pre.target: Found dependency on local-fs-pre.target/stop
Jul 10 22:13:21 H systemd[1]: local-fs-pre.target: Job run-credentials-systemd\x2dtmpfiles\x2dsetup\x2ddev.service.mount/stop deleted to break ordering cycle starting with local-fs-pre.target/stop
Jul 10 22:13:21 H systemd[1]: systemd-sysusers.service: Found ordering cycle on systemd-tmpfiles-setup-dev.service/stop
Jul 10 22:13:21 H systemd[1]: systemd-sysusers.service: Found dependency on local-fs-pre.target/stop
Jul 10 22:13:21 H systemd[1]: systemd-sysusers.service: Found dependency on run-credentials-systemd\x2dsysusers.service.mount/stop
Jul 10 22:13:21 H systemd[1]: systemd-sysusers.service: Found dependency on systemd-sysusers.service/stop
Jul 10 22:13:21 H systemd[1]: systemd-sysusers.service: Job systemd-tmpfiles-setup-dev.service/stop deleted to break ordering cycle starting with systemd-sysusers.service/stop

This reverts commit ad10ffe6a9dfe5244ffe0626bed0c0edd802388f.
v253.6
2023-07-10 22:22:11 +01:00
Frantisek Sumsal
7977cbd830 test: make the root/data partition size configurable per test
(cherry picked from commit 0334afe4d01b0f24d06995bb3ee4f5c2ff7d58c6)
2023-07-09 20:41:50 +01:00
Luca Boccassi
04e0ed93ee hwdb: update to 75a9122678e0cf852b6e9161db9a32e557213537
git restore -s origin/main hwdb.d/ test/hwdb.d test/hwdb-test.sh
2023-07-07 19:30:52 +01:00
Yu Watanabe
087b9a70b0 meson: allow to fallback to use libxcrypt.pc or glibc's libcrypt
Some distributions still use glibc's libcrypt. In that case, libcrypt.pc
does not exist and dependency() will fail.
Also, even if libxcrypt is used, there may not be a symlink
from libcrypt.pc to libxcrypt.pc. So, let's add a secondary name.

Follow-up for d625f717db6e151fd78742593c35eaba4cd2841d.

Fixes #28289.

[ fixed to fallback to extra dependency() call as multiple deps require meson 0.60 ]

(cherry picked from commit 555737878f66e64dea50dd7bf6f0b12cc54d2963)
2023-07-07 19:30:52 +01:00
Frantisek Sumsal
7dc6cccc4b test: replace readfp() with read_file()
ConfigParser.readfp() has been deprecated since Python 3.2 and was
dropped completely in Python 3.11.

(cherry picked from commit ba4a1cd8a863f65ff016be72e520c323aa1e1a6f)
2023-07-07 19:30:52 +01:00
Yu Watanabe
f74337b756 test-network: add one more testcase for DHCPv4 classless route
For issue #28280.

(cherry picked from commit 86f6760038477e9e27ccea580f1b3b27328a98a7)
2023-07-07 19:30:52 +01:00
Yu Watanabe
234b51fb73 network/dhcp4: do not ignore the gateway even if the destination is in the same network
Fixes #28280.

(cherry picked from commit 77451f654a89d822cd288883edfac315949d1cb6)
2023-07-07 19:30:52 +01:00
Yu Watanabe
f9a8c8299c sd-device: do not read uevent file in device_clone_with_db()
Follow-up for 381f6d4ba5551898e7ff19189485072b94879281.

When the function is called, the device may be already removed, and
another device has the same syspath. Such situation can occur when a
partition removed and another is created. In that case, the sysfs paths
of the removed and newly created partitions can be same, but their
devnums are different, and thus the database files corresponding to the
devices are also different.

Fixes #27981.

(cherry picked from commit 35e49f2856dc7e80cfc6c9af3dca4e3aad9b8cb5)
2023-07-07 19:30:52 +01:00
Yu Watanabe
49fa7736f7 meson: first try dependency(), then fallback to find_library()
This also drops the fallback for libacl, libcap, libcrypt, and libgcrypt,
as recent Ubuntu (at least, 20.04 LTS and newer) and Debian (at least, buster
and newer) have relevant .pc files.

Fixes #28161.

(cherry picked from commit d625f717db6e151fd78742593c35eaba4cd2841d)
2023-07-07 19:30:52 +01:00
Yu Watanabe
abbd24e8a5 wait-online: request that at least one managed online interface exists
Fixes a regression caused by ab3aed4a0349bbaa26f53340770c1b59b463e05d.

I thought the commit does not cause any severe regression. However,
drivers for network interfaces may be loaded later. So, we should wait
if no network interface is found.

Fixes #27822.

(cherry picked from commit 2f96a29c2c55bdd67cdd8e0b0cfd6971968e4bca)
2023-07-07 19:30:52 +01:00
Dmitry V. Levin
ff63a08d57 pwquality: do not log password suggestions
As logging password suggestions might leak sensitive information,
print it instead.

Suggested-by: Yu Watanabe <watanabe.yu+github@gmail.com>
(cherry picked from commit 0351d560a25cb7caf94c1f9c1af1f5e9b6b6a01a)
2023-07-07 19:30:52 +01:00
Dmitry V. Levin
9ebacd3f72 pwquality: fix quality_check_password return value
quality_check_password() used to return the same value 0 in two
different cases: when pwq_allocate_context() failed with a
ERRNO_IS_NOT_SUPPORTED() code, and when pwquality_check() rejected the
password.  As result, users of quality_check_password() used to report
password weakness also in case when the underlying library was not
available.

Fix this by changing quality_check_password() to forward the
ERRNO_IS_NOT_SUPPORTED() code to its callers, and change the callers
to handle this case gracefully.

(cherry picked from commit 7fc3f9c032cad0690c08fcdee190d83f1c7a6d53)
2023-07-07 19:30:52 +01:00
Dmitry V. Levin
ac531ec920 pwquality: fix use of ERRNO_IS_NOT_SUPPORTED
Given that ERRNO_IS_*() also match positive values, call
ERRNO_IS_NOT_SUPPORTED() only if the value returned by
pwq_allocate_context() is negative.

(cherry picked from commit 29dd2e253c74c7ab2fed6fb6a67a87089197253f)
2023-07-07 19:30:52 +01:00
Yu Watanabe
21181e2e1c test-network: drop ExecReload= in networkd.service and udevd.service
Follow-up for 0e07cdb0e77d0322bc866b5e13abbe38e988059d and
f84331539deae28fbeb42d45ad0c8d583b3372a3.

(cherry picked from commit 62eaf8d039a14e7bc4e682fa3ad4b3bfe366c29a)
2023-07-07 19:30:52 +01:00
Lennart Poettering
e8731c0ef8 hostname-setup: don't pass "true" to a flags parameter
(cherry picked from commit 983d621e11b94e705bb017e8cad5b7d1442c03e5)
2023-07-07 19:30:52 +01:00
Yu Watanabe
f03f365dc1 test: update test for free area calculation in repart
(cherry picked from commit 937625c7c72e503d03b406de3e1859d7f00dbdcf)
2023-07-07 19:30:52 +01:00
Yu Watanabe
2299ca13f9 repart: fix free area calculation
Like fdisk_get_last_lba(), fdisk_partition_get_end() return the last
sector in the partition.

Fixes #28225.

(cherry picked from commit d2eb1f8145dee61c6bddfdcc5dac3591fa03f744)
2023-07-07 19:30:52 +01:00
Yu Watanabe
2cda7651ac test: add reproducer for issue #28225
(cherry picked from commit beba8f2e1e5f08041d2a9955398a64d92dcc75a0)
2023-07-07 19:30:52 +01:00
Lennart Poettering
ee3ed28f42 execute: fix credential dir handling for fs which support ACLs
When the credential dir is backed by an fs that supports ACLs we must be
more careful with adjusting the 'x' bit of the directory, as any chmod()
call on the dir will reset the mask entry of the ACL entirely which we
don't want. Hence, do a manual set of ACL changes, that only add/drop
the 'x' bit but otherwise leave the ACL as it is.

This matters if we use tmpfs rather than ramfs to store credentials.

(cherry picked from commit f76ce81b91db1dac0d0a012e1cc903639002dd0a)
2023-07-07 19:30:52 +01:00
Frantisek Sumsal
1793682d98 test: wait for the interface to become routable after reconfiguring
Since 6e8477edd3 TEST-75 started failing with:

[  571.468298] testsuite-75.sh[46]: + for addr in "${DNS_ADDRESSES[@]}"
[  571.468298] testsuite-75.sh[46]: + run delv @fd00:dead:beef:cafe::1 -t A mail.signed.test
[  571.468899] testsuite-75.sh[562]: + tee /tmp/tmp.qKlHPbCCJZ
[  571.469317] testsuite-75.sh[561]: + delv @fd00:dead:beef:cafe::1 -t A mail.signed.test
[  571.501381] testsuite-75.sh[562]: ;; network unreachable resolving 'mail.signed.test/A/IN': fd00:dead:beef:cafe::1#53
[  571.501564] testsuite-75.sh[562]: ;; resolution failed: SERVFAIL
[  571.515457] testsuite-75.sh[46]: + grep -qF '; fully validated' /tmp/tmp.qKlHPbCCJZ

Let's wait for the dns0 interface to become routable again after
re-enabling IPv6 to, hopefully, mitigate this.

(cherry picked from commit f2492d39baa71748a20e774e7c95aec04571698a)
2023-07-07 19:30:52 +01:00
Yu Watanabe
16ddaafe3e test-network: add test for static route with preferred source
This adds possible reproducer for issue #28009 (though, the issue is
highly racy, hence this may not trigger the issue reliably).

(cherry picked from commit e4948bb2cdd1c8d1b6fc357e5b817170612aae33)
2023-07-07 19:30:52 +01:00
Yu Watanabe
a8db4fcac4 test-network: check route more strictly
(cherry picked from commit 7e30527806956b7240ca7bf8d92038170fda44d0)
2023-07-07 19:30:52 +01:00
Yu Watanabe
ea05cd2910 network: delay to configure address until it is removed on reconfigure
When we request an address that already exists and is under removing,
we need to wait for the address being removed. Otherwise, configuration
of a route whose preferred source is the address will fail.

Fixes #28009.
Replaces #28088.

(cherry picked from commit 6e8477edd3a988357ad5f5fa6610904d44ec402c)
2023-07-07 19:30:52 +01:00
Yu Watanabe
e1c54c81b4 network: constify several functions
(cherry picked from commit b088c3d3fc3a7a3a659ec0fe903a29cabd66dc49)
2023-07-07 19:30:52 +01:00
Daan De Meyer
72d6e8912c dbus-cgroup: Make sure we overwrite cpuset properties in drop-in
The DBUS property setter overwrites the value of the property but
writes a drop-in that extends the value. Let's make sure the drop-in
overwrites the property value as well by assigning the empty string
first.

(cherry picked from commit 1dbccd6d342d9f8dd8d4a1617e0081b61a553ca8)
2023-07-07 19:30:52 +01:00
Frantisek Sumsal
67aaab3381 test: fix test_vxlan with the latest iproute2
Some options were renamed and some options with default values are not
shown unless -d(etails) is repeated.

See: https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=1215e9d3862387353d8672296cb4c6c16e8cbb72
(cherry picked from commit a5e478b24c7c6bcb210a2fa7d3ccce1d381a19b7)
2023-07-07 19:30:52 +01:00
Frantisek Sumsal
884ab38057 core: reorder systemd arguments on reexec
When reexecuting system let's put our arguments carrying deserialization
info first followed by any existing arguments to make sure they get
parsed in case we get weird stuff from the kernel cmdline (like --).

See: https://github.com/systemd/systemd/issues/28184
(cherry picked from commit 06afda6b38d5d730fca3c65449096425933272bc)
2023-07-07 19:30:52 +01:00
Yu Watanabe
c8c43dc3a7 test: add test for trailing invalid byte at the end
(cherry picked from commit 894f4417640286fa350203d70d858e11e261a3e0)
2023-07-07 19:30:52 +01:00
Philipp Kern
a11a0011a8 sd-dhcp6-lease: ignore invalid byte(s) at the end of the packet
Oracle Cloud sends malformed DHCPv6 replies that have an invalid
byte at the end, which cannot be parsed as an option code.

networkd currently can cope with the invalid option (it is ignored),
but the whole packet is ignored altogether because of the additional
null at the end.

It's better to be liberal in what we accept and actually assign an
address, given that the reply contains a valid IA_NA.

Fixes #28183.

(cherry picked from commit 81b7335912ce901c61b923218bcdf06a4fdcea07)
2023-07-07 19:30:52 +01:00
Lennart Poettering
f08c49b33e man: properly close XML tags
(cherry picked from commit cc8fdd5d307a620700d4729d74143ca434f0707c)
2023-07-07 19:30:52 +01:00
Lennart Poettering
ed87814cdf man: rebreak lines in file-hierarchy(7) a bit
(Does not change a single word, just rebreaks a bunch of paragraphs
matching our current line breaking rules)

(cherry picked from commit fa1d34825a9b410275e716b9b70f4fca02c71ba9)
2023-07-07 19:30:52 +01:00
Frantisek Sumsal
5a29fbba6c test: enable LSan for certain wrapped binaries
So we're able to detect memory leaks in our NSS modules.

An example after introducing a memory leak in nss-myhostname.c:

testsuite-71.sh[2881]: =================================================================
testsuite-71.sh[2881]: ==2880==ERROR: LeakSanitizer: detected memory leaks
testsuite-71.sh[2881]: Direct leak of 2 byte(s) in 1 object(s) allocated from:
testsuite-71.sh[2881]:     #0 0x7fa28907243b in strdup (/usr/lib64/libasan.so.8.0.0+0x7243b)
testsuite-71.sh[2881]:     #1 0x7fa286a7bc10 in gethostname_full ../src/basic/hostname-util.c:67
testsuite-71.sh[2881]:     #2 0x7fa286a74af9 in gethostname_malloc ../src/basic/hostname-util.h:24
testsuite-71.sh[2881]:     #3 0x7fa286a756f4 in _nss_myhostname_gethostbyname4_r ../src/nss-myhostname/nss-myhostname.c:79
testsuite-71.sh[2881]:     #4 0x7fa288f17588 in getaddrinfo (/lib64/libc.so.6+0xf4588)
testsuite-71.sh[2881]:     #5 0x7fa2890a4d93 in __interceptor_getaddrinfo.part.0 (/usr/lib64/libasan.so.8.0.0+0xa4d93)
testsuite-71.sh[2881]:     #6 0x55a54b2b7159 in ahosts_keys_int.part.0 (/usr/bin/getent.orig+0x4159)
testsuite-71.sh[2881]: SUMMARY: AddressSanitizer: 2 byte(s) leaked in 1 allocation(s).

(cherry picked from commit 2b5e786005d8854600bb43335fd0c4067ce8da08)
2023-07-07 19:30:52 +01:00
Lennart Poettering
a90ec12d82 man: rework BPFForeign= documentation a bit
Various assorted changes, among them make clear that a missing BPF
program is not reason to abort unit activation.

(cherry picked from commit a27e6fb71bf70f27347b0e1167b2de32c4dc6637)
2023-07-07 19:30:52 +01:00
Lennart Poettering
178fe97763 bpf-foreign: add an explicit, explanatory message when reference BPF program is not loaded yet
(cherry picked from commit 228459f5d7da200537895edf82260a79e6e99947)
2023-07-07 19:30:52 +01:00
Lennart Poettering
9e1e09066a bpf-foreign: if one program fails, still load the next
Let's make sure that if we load one program we don't prematurely fail,
and continue with the others still.

(cherry picked from commit f81450f2415f8fd77fc8edb3b4baab966aefa9fd)
2023-07-07 19:30:52 +01:00
Lennart Poettering
4592af1d77 bpf-foreign: remove duplicate various occasions of duplicate logging
(cherry picked from commit d512831a3ec93f6f29ccb21cb68f416114270840)
2023-07-07 19:30:52 +01:00
Yu Watanabe
750a0c01a2 test: skip if ldd command not found
Prompted by #28015.

(cherry picked from commit 9f4522591e4be076bf309e23b9cec9dddfc99e29)
2023-07-07 19:30:52 +01:00
François Rigault
134e55ef49 test: don't assume yum is a script
on Rawhide at the moment yum is a symlink to dnf5 which is a binary.

(cherry picked from commit 4b95d5effd788ae660691e01144130e432e2f021)
2023-07-07 19:30:52 +01:00
Luca Boccassi
39459a5d80 TEST-55-OOMD: use swap file instead of partition
The partition seems not to work on Ubuntu for some reason, use a
swap file instead

(cherry picked from commit f434f182ccfd17a214e4b07cec033318e6c4f7b2)
2023-07-07 19:30:52 +01:00
Luca Boccassi
9654140f34 TEST-55-OOMD: use 'stress' to create high pressure
The test fails on my machine, running Debian stable, because
testsuite-55-testbloat.service just swaps and never goes over the
limit, so it's not killed. Use 'stress' instead which seems to be
able to overwhelm the swap too.

(cherry picked from commit 937e82cb7d82dbdbd287d82f4708f15d6032eb9f)
2023-07-07 19:30:52 +01:00
Antonio Alvarez Feijoo
69298e3b65 man: fix references to gethostname/sethostname
(cherry picked from commit 191b891bf1b01c1041509b951d9d797ceacb181d)
2023-07-07 19:30:52 +01:00
Frantisek Sumsal
b9990ee4a7 tree-wide: use https for the 0pointer.de doc links
(cherry picked from commit dc7e580e64a80e982619fb099ef736cd2379f92a)
2023-07-07 19:30:52 +01:00
Lennart Poettering
4e3ae43282 resolved: if ipv6 is off patch hostname→address query with unspec family to ipv4
If the client never specified the address family, and IPv6 is off in the
kernel, then look only for A, never for AAAA RRs.

Fixes: #23951
(cherry picked from commit 0438aa57751559295fee86d1c1f176486e518455)
2023-07-07 19:30:52 +01:00
Frantisek Sumsal
fdc6ce1d00 test: test transactions with cycles
Provides coverage for systemd/systemd#26872.

With systemd/systemd#26875 reverted:

[16444.287652] testsuite-03.sh[71]: + for i in {0..19}
[16444.287652] testsuite-03.sh[71]: + systemctl start transaction-cycle0.service
[16444.359503] systemd[1]: =================================================================
[16444.360321] systemd[1]: ==1==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6180002e578e at pc 0x7f73b25ec7a6 bp 0x7ffc5531c6f0 sp 0x7ffc5531be68
[16444.360798] systemd[1]:
[16444.361044] systemd[1]: READ of size 783 at 0x6180002e578e thread T0 (systemd)
[16444.391684] systemd[1]:     #0 0x7f73b25ec7a5  (/lib64/libasan.so.5+0x557a5)
[16444.392167] systemd[1]:     #1 0x7f73b260a1d5 in __interceptor_vasprintf (/lib64/libasan.so.5+0x731d5)
[16444.392442] systemd[1]:     #2 0x7f73afa1d1e1 in log_format_iovec ../src/basic/log.c:996
[16444.392750] systemd[1]:     #3 0x7f73afa1e7b6 in log_struct_internal ../src/basic/log.c:1058
[16444.393101] systemd[1]:     #4 0x7f73b1979136 in transaction_verify_order_one ../src/core/transaction.c:392
[16444.393540] systemd[1]:     #5 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
[16444.393946] systemd[1]:     #6 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
[16444.394262] systemd[1]:     #7 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
[16444.394532] systemd[1]:     #8 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
[16444.394812] systemd[1]:     #9 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
...

(cherry picked from commit 0651e717496aed30bcec7740286d719860995625)
2023-07-07 19:30:52 +01:00
Frantisek Sumsal
68c7905d9c test: make sure we get PID1's stack trace on ASan/UBSan errors
As hitting an ASan/UBSan error in PID1 results in a crash (and a kernel
panic when running under qemu), we usually lose the stack trace which
makes debugging quite painful. Let's mitigate this by forwarding the
stack trace to multiple places - namely to a file and the syslog.

(cherry picked from commit 88c98cb2614a2893ec2ae7197a1f234b579da7a7)
2023-07-07 19:30:52 +01:00
Romain Geissler
d0b2fdd513 elf-util: check for overflow when computing end of core's PT_LOAD segments
(cherry picked from commit 3965f173eae4701a014113cfaf4a28a6bb63bed7)
2023-07-07 19:30:52 +01:00
Lennart Poettering
fa0ef8eaa6 coredump: use loop_read() for reading coredump into memory
Fixes: #26748
(cherry picked from commit a73c74db66a14540eb043bf9535c0d9c37804062)
2023-07-07 19:30:52 +01:00