]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agoMerge pull request #22175 from keszybz/kernel-install-mkosi-initrd
Luca Boccassi [Mon, 31 Jan 2022 23:09:46 +0000 (23:09 +0000)] 
Merge pull request #22175 from keszybz/kernel-install-mkosi-initrd

kernel-install: add support for KERNEL_INSTALL_INITRD_GENERATOR and KERNEL_INSTALL_STAGING_AREA

2 years agonetwork: s/confiured/configured/
Frantisek Sumsal [Mon, 31 Jan 2022 21:17:48 +0000 (22:17 +0100)] 
network: s/confiured/configured/

A quick typo fix I noticed whilst debugging.

2 years agotree-wide: some additional checks to avoid CVE-2021-4034 style weaknesses
Lennart Poettering [Mon, 31 Jan 2022 16:58:18 +0000 (17:58 +0100)] 
tree-wide: some additional checks to avoid CVE-2021-4034 style weaknesses

2 years agorandom-seed: add missing %m in error message
Lennart Poettering [Mon, 31 Jan 2022 16:58:42 +0000 (17:58 +0100)] 
random-seed: add missing %m in error message

2 years agoMerge pull request #22323 from mrc0mmand/fix-TEST-69-on-C8S
Frantisek Sumsal [Mon, 31 Jan 2022 19:04:02 +0000 (19:04 +0000)] 
Merge pull request #22323 from mrc0mmand/fix-TEST-69-on-C8S

test: use ~/.bashrc instead of /etc/bash.bashrc

2 years agoupdate TODO
Lennart Poettering [Mon, 31 Jan 2022 16:58:25 +0000 (17:58 +0100)] 
update TODO

2 years agotest: copy portable profiles into the image if they don't exist there
Frantisek Sumsal [Mon, 31 Jan 2022 13:19:09 +0000 (14:19 +0100)] 
test: copy portable profiles into the image if they don't exist there

If we're built with `-Dportable=false`, the portable profiles won't get
installed into the image. Since we need only the profile files and
nothing else, let's copy them into the image explicitly in such case.

2 years agotest: use ~/.bashrc instead of /etc/bash.bashrc 22323/head
Frantisek Sumsal [Mon, 31 Jan 2022 16:11:06 +0000 (17:11 +0100)] 
test: use ~/.bashrc instead of /etc/bash.bashrc

/etc/bash.bashrc appears to be Debian-specific[0] (or specific to bash
versions compiled with -DSYS_BASHRC), which doesn't seem to be the case
for C8S. Let's use ~/.bashrc instead to make the CIs happy again.

[0] https://sources.debian.org/src/bash/5.1-6/debian/README/#L50-L56

2 years agotest: make the code less error-prone
Frantisek Sumsal [Mon, 31 Jan 2022 15:48:15 +0000 (16:48 +0100)] 
test: make the code less error-prone

2 years agoMerge pull request #22316 from yuwata/network-mac-address-length
Luca Boccassi [Mon, 31 Jan 2022 14:21:28 +0000 (14:21 +0000)] 
Merge pull request #22316 from yuwata/network-mac-address-length

network: several cleanups related to MAC address length

2 years agoMerge pull request #22300 from yuwata/bus-fix-error-handling
Luca Boccassi [Mon, 31 Jan 2022 14:03:00 +0000 (14:03 +0000)] 
Merge pull request #22300 from yuwata/bus-fix-error-handling

tree-wide: fix bus method error handling

2 years agoboot: Don't require a machine ID to be available
Daan De Meyer [Fri, 28 Jan 2022 15:40:09 +0000 (15:40 +0000)] 
boot: Don't require a machine ID to be available

Regression introduced in https://github.com/systemd/systemd/pull/21807.

Fixes #22224

2 years agoMerge pull request #22274 from yuwata/resolve-comment
Luca Boccassi [Mon, 31 Jan 2022 13:56:04 +0000 (13:56 +0000)] 
Merge pull request #22274 from yuwata/resolve-comment

resolve: cleanups for on_stream_io()

2 years agocore: don't fail on EEXIST when creating mount point
Luca Boccassi [Fri, 28 Jan 2022 22:56:10 +0000 (22:56 +0000)] 
core: don't fail on EEXIST when creating mount point

systemd[1016]: Failed to mount /tmp/app1 (type n/a) on /run/systemd/unit-extensions/1 (MS_BIND ): No such file or directory
systemd[1016]: Failed to create destination mount point node '/run/systemd/unit-extensions/1': File exists

2 years agocore: check argc/argv uncoditionally
Frantisek Sumsal [Sun, 30 Jan 2022 14:49:27 +0000 (15:49 +0100)] 
core: check argc/argv uncoditionally

as `assert()` might be dropped with `-DNDEBUG`.

Follow-up to cf3095a and 1637e75.

2 years agoMerge pull request #21838 from lnussel/logind-refactor
Yu Watanabe [Mon, 31 Jan 2022 10:45:33 +0000 (19:45 +0900)] 
Merge pull request #21838 from lnussel/logind-refactor

Logind shutdown refactor

2 years agomeson: use bpftool based strip when available
James Hilliard [Mon, 31 Jan 2022 04:47:38 +0000 (21:47 -0700)] 
meson: use bpftool based strip when available

This should be useable in bpftool v5.13 or newer based on:
https://github.com/torvalds/linux/commit/d80b2fcbe0a023619e0fc73112f2a02c2662f6ab

2 years agomeson: set minimum clang/llvm versions for bpf support
James Hilliard [Mon, 31 Jan 2022 02:33:55 +0000 (19:33 -0700)] 
meson: set minimum clang/llvm versions for bpf support

The minimum clang/llvm-strip version needed for building libbpf based
programs is 10.0.0, this is documented here:
https://github.com/libbpf/libbpf/tree/v0.6.1#bpf-co-re-compile-once--run-everywhere

Using an older version such as 9.0.0 will generate objects that
bpftool will not be able to generate skeletons for.

2 years agonetwork: currently IPv4ACD requires MAC address whose length is ETH_ALEN 22316/head
Yu Watanabe [Mon, 31 Jan 2022 04:07:34 +0000 (13:07 +0900)] 
network: currently IPv4ACD requires MAC address whose length is ETH_ALEN

2 years agonetwork: currently RADV requires MAC address whose length is ETH_ALEN
Yu Watanabe [Mon, 31 Jan 2022 04:02:57 +0000 (13:02 +0900)] 
network: currently RADV requires MAC address whose length is ETH_ALEN

2 years agonetwork: disable NDisc for CAN interfaces
Yu Watanabe [Mon, 31 Jan 2022 03:54:21 +0000 (12:54 +0900)] 
network: disable NDisc for CAN interfaces

We already disabled DHCP clients for CAN interfaces.

2 years agonetwork: configure NDisc after MAC address is assigned
Yu Watanabe [Mon, 31 Jan 2022 03:35:44 +0000 (12:35 +0900)] 
network: configure NDisc after MAC address is assigned

2 years agonetwork: configure DHCP clients after MAC address is assigned
Yu Watanabe [Mon, 31 Jan 2022 03:08:24 +0000 (12:08 +0900)] 
network: configure DHCP clients after MAC address is assigned

Prompted by #20090.

2 years agobasic: update CIFS magic
Frantisek Sumsal [Sun, 30 Jan 2022 22:40:05 +0000 (23:40 +0100)] 
basic: update CIFS magic

Kernel commit dea2903719283c156b53741126228c4a1b40440f exposed (and
renamed) CIFS_MAGIC_NUMBER as CIFS_SUPER_MAGIC along with
SMB2_SUPER_MAGIC.

This fixes the following build fail on current Fedora Rawhide:
```
../src/basic/meson.build:389:8: ERROR: Problem encountered: found unknown filesystem(s) defined in kernel headers:

Filesystem found in kernel header but not in filesystems-gperf.gperf: CIFS_SUPER_MAGIC
Filesystem found in kernel header but not in filesystems-gperf.gperf: SMB2_SUPER_MAGIC
```

2 years agohwdb: add support for Surface Laptop 2 & 3 (#22303)
Dorian Clay [Sun, 30 Jan 2022 19:50:09 +0000 (11:50 -0800)] 
hwdb: add support for Surface Laptop 2 & 3 (#22303)

2 years agohwdb: add new database file for PDA devices
Davide Cavalca [Sun, 30 Jan 2022 17:28:52 +0000 (09:28 -0800)] 
hwdb: add new database file for PDA devices

Add a new database for handhelds (PDAs, calculators, etc.) that should be
accessible the seat owner.

The database is initially populated with Texas Instruments calculators
and linking cables, which removes the need to installing dedicated udev
rules for them.

2 years agobasic: mac_[selinux,smack]_apply_fd does not work when applying labels
Donald Chan [Fri, 28 Jan 2022 22:53:46 +0000 (22:53 +0000)] 
basic: mac_[selinux,smack]_apply_fd does not work when applying labels

Commit a7fdc6c introduced a regression where file descriptors are opened
using O_PATH option. mac_smack_apply_fd() calls fsetxattr() and would fail
with a -EBADF (Bad file descriptor) error.

Use FORMAT_PROC_FD_PATH(fd) to convert the fd back into a full path and
call setxattr() or setfilecon() instead.

Signed-off-by: Donald Chan <hoiho@amazon.com>
2 years agoshared: Handle filesystems that don't support hole punching in COPY_HOLES
Daan De Meyer [Fri, 28 Jan 2022 16:18:49 +0000 (16:18 +0000)] 
shared: Handle filesystems that don't support hole punching in COPY_HOLES

2 years agoMerge pull request #22294 from evverx/fuzz-dhcp-client
Yu Watanabe [Sun, 30 Jan 2022 19:41:07 +0000 (04:41 +0900)] 
Merge pull request #22294 from evverx/fuzz-dhcp-client

tests: fuzz client_handle_offer

2 years agoMerge pull request #22302 from evverx/merge-oss-fuzz-corpora
Frantisek Sumsal [Sun, 30 Jan 2022 18:35:28 +0000 (18:35 +0000)] 
Merge pull request #22302 from evverx/merge-oss-fuzz-corpora

ci: merge seed corpora with public OSS-Fuzz corpora on CFLite

2 years agocore: check if argc > 0 and argv[0] is set
Yu Watanabe [Sun, 30 Jan 2022 08:54:55 +0000 (17:54 +0900)] 
core: check if argc > 0 and argv[0] is set

Follow-up for 1637e757070a61b12b26a2a4ef547330562dc77f.

2 years agoci: no longer upload the latest builds on commits 22302/head
Evgeny Vereshchagin [Sun, 30 Jan 2022 09:18:53 +0000 (09:18 +0000)] 
ci: no longer upload the latest builds on commits

The idea behind this action is to make it possible to compare the
latest fuzz targets with PRs to figure out whether bugs are really
reproducible in PRs only. Since forks (including systemd-stable) are
usually based on the upstream repository where almost all the bugs
are fixed before releases are cut it should be safe to assume that
if CFLite finds bugs in PRs they are most likely introduced in those
PRs.

It should probably be brought back once https://github.com/google/clusterfuzzlite/issues/84
is fixed.

2 years agoci: merge seed corpora with public OSS-Fuzz corpora on CFLite
Evgeny Vereshchagin [Sat, 29 Jan 2022 21:36:41 +0000 (21:36 +0000)] 
ci: merge seed corpora with public OSS-Fuzz corpora on CFLite

to let it cover as much code as possible. It should help to catch
most regressions in a few minutes.

2 years agoshared: be extra paranoid and check if argc > 0
Frantisek Sumsal [Fri, 28 Jan 2022 20:44:32 +0000 (21:44 +0100)] 
shared: be extra paranoid and check if argc > 0

and also if argv[0] is non-empty as a precaution for issues similar to
CVE-2021-4034.

2 years agoMerge pull request #22301 from mrc0mmand/cocci-tweaks
Yu Watanabe [Sun, 30 Jan 2022 00:34:44 +0000 (09:34 +0900)] 
Merge pull request #22301 from mrc0mmand/cocci-tweaks

fstab-generator: use str(n)dupa_safe() instead of plain str(n)dupa()

2 years agotest: make use of strv_isempty() 22301/head
Frantisek Sumsal [Sat, 29 Jan 2022 21:36:29 +0000 (22:36 +0100)] 
test: make use of strv_isempty()

2 years agofstab-generator: use str(n)dupa_safe() instead of plain str(n)dupa()
Frantisek Sumsal [Sat, 29 Jan 2022 21:34:02 +0000 (22:34 +0100)] 
fstab-generator: use str(n)dupa_safe() instead of plain str(n)dupa()

2 years agologin: use bus_error_message() at one more place 22300/head
Yu Watanabe [Sat, 29 Jan 2022 20:38:35 +0000 (05:38 +0900)] 
login: use bus_error_message() at one more place

2 years agocore/unit: use bus_error_message() at one more place
Yu Watanabe [Sat, 29 Jan 2022 20:38:01 +0000 (05:38 +0900)] 
core/unit: use bus_error_message() at one more place

2 years agobus-util: retrieve bus error from message
Yu Watanabe [Sat, 29 Jan 2022 20:36:56 +0000 (05:36 +0900)] 
bus-util: retrieve bus error from message

The error in argument is not input, but used for output.

2 years agoci: update GHActions once a month
Evgeny Vereshchagin [Sat, 29 Jan 2022 18:16:16 +0000 (18:16 +0000)] 
ci: update GHActions once a month

Apparently some actions like CodeQL are released a few times a week so let's
just update them once a month in one fell swoop.

2 years agoci: use CFLite to test forks (including systemd-stable)
Evgeny Vereshchagin [Sat, 29 Jan 2022 15:22:43 +0000 (15:22 +0000)] 
ci: use CFLite to test forks (including systemd-stable)

It's like CIFuzz but unlike CIFuzz it's compatible with forks and
it should make it possible to run the fuzzers to make sure that
patches backported to them are backported correctly without introducing
new bugs and regressions.

2 years agosd-dhcp-lease: fix a memory leak in dhcp_lease_parse_search_domains 22294/head
Evgeny Vereshchagin [Sat, 29 Jan 2022 03:16:40 +0000 (03:16 +0000)] 
sd-dhcp-lease: fix a memory leak in dhcp_lease_parse_search_domains

=================================================================
==81071==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x51245c in __interceptor_reallocarray (/home/vagrant/systemd/build/fuzz-dhcp-client+0x51245c)
    #1 0x7f01440c67e6 in strv_push /home/vagrant/systemd/build/../src/basic/strv.c:435:13
    #2 0x7f01440ca9e1 in strv_consume /home/vagrant/systemd/build/../src/basic/strv.c:506:13
    #3 0x7f01440ca9e1 in strv_extend /home/vagrant/systemd/build/../src/basic/strv.c:558:16
    #4 0x5806e3 in dhcp_lease_parse_search_domains /home/vagrant/systemd/build/../src/libsystemd-network/sd-dhcp-lease.c:900:21
    #5 0x57c1be in dhcp_lease_parse_options /home/vagrant/systemd/build/../src/libsystemd-network/sd-dhcp-lease.c:727:21
    #6 0x572450 in parse_options /home/vagrant/systemd/build/../src/libsystemd-network/dhcp-option.c:348:33
    #7 0x571c6a in dhcp_option_parse /home/vagrant/systemd/build/../src/libsystemd-network/dhcp-option.c:376:13
    #8 0x559a01 in client_handle_offer /home/vagrant/systemd/build/../src/libsystemd-network/sd-dhcp-client.c:1543:13
    #9 0x5592bd in LLVMFuzzerTestOneInput /home/vagrant/systemd/build/../src/libsystemd-network/fuzz-dhcp-client.c:74:16
    #10 0x44a379 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) (/home/vagrant/systemd/build/fuzz-dhcp-client+0x44a379)
    #11 0x42ae1f in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) (/home/vagrant/systemd/build/fuzz-dhcp-client+0x42ae1f)
    #12 0x432ade in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) (/home/vagrant/systemd/build/fuzz-dhcp-client+0x432ade)
    #13 0x421f86 in main (/home/vagrant/systemd/build/fuzz-dhcp-client+0x421f86)
    #14 0x7f0142fff55f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f)

2 years agotests: add a file triggering a memory leak in dhcp_lease_parse_search_domains
Evgeny Vereshchagin [Sat, 29 Jan 2022 03:18:31 +0000 (03:18 +0000)] 
tests: add a file triggering a memory leak in dhcp_lease_parse_search_domains

2 years agosd-dhcp-lease: fix an infinite loop found by the fuzzer
Evgeny Vereshchagin [Sat, 29 Jan 2022 02:08:39 +0000 (02:08 +0000)] 
sd-dhcp-lease: fix an infinite loop found by the fuzzer

2 years agotests: fuzz client_handle_offer
Evgeny Vereshchagin [Fri, 28 Jan 2022 20:35:38 +0000 (20:35 +0000)] 
tests: fuzz client_handle_offer

Turns out that part of systemd isn't covered by any fuzz targets and
that's not ideal considering that it parses data sent remotely. The
fuzzer triggers an infinite loop in lease_parse_routes as soon as it
starts so it seems to be working :-)
```
INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 23620602
INFO: Loaded 2 modules   (182073 inline 8-bit counters): 176548 [0x7fdf511fc8d0, 0x7fdf51227a74), 5525 [0x5f6ef0, 0x5f8485),
INFO: Loaded 2 PC tables (182073 PCs): 176548 [0x7fdf51227a78,0x7fdf514d94b8), 5525 [0x5f8488,0x60ddd8),
./build/fuzz-dhcp-client: Running 1 inputs 1 time(s) each.
Running: test/fuzz/fuzz-dhcp-client/timeout-ed34161922c7075c4773f2ada3dee8685d220980
ALARM: working on the last Unit for 31 seconds
       and the timeout value is 30 (use -timeout=N to change)
==80731== ERROR: libFuzzer: timeout after 31 seconds
    #0 0x51b32e in __sanitizer_print_stack_trace (/home/vagrant/systemd/build/fuzz-dhcp-client+0x51b32e)
    #1 0x4689e9 in fuzzer::PrintStackTrace() (/home/vagrant/systemd/build/fuzz-dhcp-client+0x4689e9)
    #2 0x44a0f4 in fuzzer::Fuzzer::StaticAlarmCallback() (/home/vagrant/systemd/build/fuzz-dhcp-client+0x44a0f4)
    #3 0x7fdf4f8b474f  (/lib64/libc.so.6+0x4274f)
    #4 0x465fee in __sanitizer_cov_trace_const_cmp4 (/home/vagrant/systemd/build/fuzz-dhcp-client+0x465fee)
    #5 0x57eee5 in lease_parse_routes /home/vagrant/systemd/build/../src/libsystemd-network/sd-dhcp-lease.c:495:23
    #6 0x57baf3 in dhcp_lease_parse_options /home/vagrant/systemd/build/../src/libsystemd-network/sd-dhcp-lease.c:701:21
    #7 0x572450 in parse_options /home/vagrant/systemd/build/../src/libsystemd-network/dhcp-option.c:348:33
    #8 0x571cea in dhcp_option_parse /home/vagrant/systemd/build/../src/libsystemd-network/dhcp-option.c:381:21
    #9 0x559a01 in client_handle_offer /home/vagrant/systemd/build/../src/libsystemd-network/sd-dhcp-client.c:1543:13
    #10 0x5592bd in LLVMFuzzerTestOneInput /home/vagrant/systemd/build/../src/libsystemd-network/fuzz-dhcp-client.c:78:9
    #11 0x44a379 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) (/home/vagrant/systemd/build/fuzz-dhcp-client+0x44a379)
    #12 0x42ae1f in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) (/home/vagrant/systemd/build/fuzz-dhcp-client+0x42ae1f)
    #13 0x432ade in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) (/home/vagrant/systemd/build/fuzz-dhcp-client+0x432ade)
    #14 0x421f86 in main (/home/vagrant/systemd/build/fuzz-dhcp-client+0x421f86)
    #15 0x7fdf4f89f55f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f)
    #16 0x7fdf4f89f60b in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x2d60b)
    #17 0x421fd4 in _start (/home/vagrant/systemd/build/fuzz-dhcp-client+0x421fd4)

SUMMARY: libFuzzer: timeout
```

2 years agoMerge pull request #22289 from yuwata/network-hashmap-remove-value
Anita Zhang [Fri, 28 Jan 2022 19:57:59 +0000 (11:57 -0800)] 
Merge pull request #22289 from yuwata/network-hashmap-remove-value

network: use hashmap_remove_value() at two more places

2 years agonetwork: use hashmap_remove_value() at two more places 22289/head
Yu Watanabe [Fri, 28 Jan 2022 15:30:22 +0000 (00:30 +0900)] 
network: use hashmap_remove_value() at two more places

2 years agokernel-install: add missing log line 22175/head
Zbigniew Jędrzejewski-Szmek [Wed, 19 Jan 2022 13:03:24 +0000 (14:03 +0100)] 
kernel-install: add missing log line

2 years agokernel-install: add "$KERNEL_INSTALL_STAGING_AREA" directory
Zbigniew Jędrzejewski-Szmek [Wed, 19 Jan 2022 11:20:22 +0000 (12:20 +0100)] 
kernel-install: add "$KERNEL_INSTALL_STAGING_AREA" directory

The general approach of kernel-install was that each plugin would drop in some
files into the entry directory. But this doesn't scale well, because if we have
multiple initrd generators, or multiple initrds, each generator would need to
recreate the logic to put the generated files in the right place.

Also, effective cleanup is impossible if anything goes wrong on the way, so we
could end up with unused files in $BOOT.

So let's invert the process: plugins drop files into $KERNEL_INSTALL_STAGING_AREA,
and at the end 90-loaderentry.install DTRT with those files.

This allow new plugins like 50-mkosi-initrd.install to be significantly simpler.

2 years agokernel-install: prefix errors with "Error:", exit immediately
Zbigniew Jędrzejewski-Szmek [Wed, 19 Jan 2022 11:15:16 +0000 (12:15 +0100)] 
kernel-install: prefix errors with "Error:", exit immediately

kernel-install would continue after errors… We don't want this, as it
makes the results totally unpredicatable. If we didn't install the kernel
or didn't do some important part of the setup, let's just return an error
and let the user deal with it.

When looking at output, the error was often hard to distinguish, esp.
with -v. Add "Error:" everywhere to make the output easier to parse.

2 years agokernel-install: k-i already creates $ENTRY_DIR_ABS, no need to do it again
Zbigniew Jędrzejewski-Szmek [Wed, 19 Jan 2022 11:10:37 +0000 (12:10 +0100)] 
kernel-install: k-i already creates $ENTRY_DIR_ABS, no need to do it again

2 years agotest: add missing oom check
Yu Watanabe [Fri, 28 Jan 2022 01:20:31 +0000 (10:20 +0900)] 
test: add missing oom check

Fixes CID#1469129.

2 years agoMerge pull request #22283 from yuwata/sd-device-suppress-log
Daan De Meyer [Fri, 28 Jan 2022 12:55:16 +0000 (12:55 +0000)] 
Merge pull request #22283 from yuwata/sd-device-suppress-log

sd-device: suppress log

2 years agounit: introduce wait-online@.service for specific interface
Yu Watanabe [Fri, 28 Jan 2022 06:30:01 +0000 (15:30 +0900)] 
unit: introduce wait-online@.service for specific interface

This should be useful when a host has multiple interfaces.

Inspired by #22246.

2 years agoMerge pull request #22282 from yuwata/test-revert-workaronds
Frantisek Sumsal [Fri, 28 Jan 2022 12:37:12 +0000 (12:37 +0000)] 
Merge pull request #22282 from yuwata/test-revert-workaronds

test: revert workaronds

2 years agosd-dhcp-server: refuse too large packet to send
Yu Watanabe [Fri, 28 Jan 2022 02:53:49 +0000 (11:53 +0900)] 
sd-dhcp-server: refuse too large packet to send

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=44134.

2 years agohwdb: add two Elecom trackballs
Ryan Hendrickson [Thu, 27 Jan 2022 23:06:14 +0000 (18:06 -0500)] 
hwdb: add two Elecom trackballs

2 years agonetwork: fix log messages
Yu Watanabe [Fri, 28 Jan 2022 01:40:30 +0000 (10:40 +0900)] 
network: fix log messages

2 years agotest: frequency in mouse DPI is optional
Yu Watanabe [Fri, 28 Jan 2022 02:08:43 +0000 (11:08 +0900)] 
test: frequency in mouse DPI is optional

Prompted by #22278.

2 years agoMerge pull request #22277 from yuwata/test-network-activation-policy
Yu Watanabe [Fri, 28 Jan 2022 03:45:49 +0000 (12:45 +0900)] 
Merge pull request #22277 from yuwata/test-network-activation-policy

test-network: fixes for test_activation_policy

2 years agobpf: load firewall with name only if supported
Julia Kartseva [Fri, 28 Jan 2022 00:36:25 +0000 (16:36 -0800)] 
bpf: load firewall with name only if supported

BPF firewall is supported starting from v4.9 kernel where
BPF_PROG_TYPE_SOCKET_FILTER support was added [0].

However, program name support was added to v4.15 [1] and BPF_PROG_LOAD
syscall will fail on older kernels if called with prog_name attribute.
BPF_F_ALLOW_MULTI was also added to v4.15 kernel which allows reusing
BPF_F_ALLOW_MULTI probe to indicate that program name is also supported.

It is no problem for BPF_PROG_TYPE_CGROUP_DEVICE since it was added in
v4.15.

[0] https://elixir.bootlin.com/linux/v4.9/source/include/uapi/linux/bpf.h#L92
[1] https://elixir.bootlin.com/linux/v4.15/source/include/uapi/linux/bpf.h#L191

Follow-up of https://github.com/systemd/systemd/pull/22214

2 years agoMerge pull request #22272 from bluca/state_dir_private_rootfs
Yu Watanabe [Fri, 28 Jan 2022 03:04:41 +0000 (12:04 +0900)] 
Merge pull request #22272 from bluca/state_dir_private_rootfs

core: do not attempt to add 'private' symlinks when RootImage/RootDirectory are used

2 years agoman: extend the DHCPv6-PD example and add a DHCPv4-6RD example
Yu Watanabe [Thu, 27 Jan 2022 20:25:47 +0000 (05:25 +0900)] 
man: extend the DHCPv6-PD example and add a DHCPv4-6RD example

2 years agosd-device: suppress too many debugging log when enumerating devices 22283/head
Yu Watanabe [Fri, 28 Jan 2022 01:56:38 +0000 (10:56 +0900)] 
sd-device: suppress too many debugging log when enumerating devices

Follow-up for d7cb60daf6d3769f1e26753195d62e8fcee025fa.

2 years agolog: introduce log_trace_errno()
Yu Watanabe [Fri, 28 Jan 2022 01:50:36 +0000 (10:50 +0900)] 
log: introduce log_trace_errno()

2 years agoRevert "test: wait for user inactive" 22282/head
Yu Watanabe [Fri, 28 Jan 2022 01:44:12 +0000 (10:44 +0900)] 
Revert "test: wait for user inactive"

As it does not work, and the test still randomly fails.

This reverts commit de27f4c8b8dd230a936f1b467a1da275f6fe024b.

2 years agoRevert "test: wait for newly created btrfs triggered"
Yu Watanabe [Fri, 28 Jan 2022 01:42:51 +0000 (10:42 +0900)] 
Revert "test: wait for newly created btrfs triggered"

This reverts commit 39f83dd7606730f65eb9831703a8ea3667682a85.

As this does not solve the issue.

2 years agoMerge pull request #22276 from mrc0mmand/TEST-64-workaround
Luca Boccassi [Fri, 28 Jan 2022 00:56:04 +0000 (00:56 +0000)] 
Merge pull request #22276 from mrc0mmand/TEST-64-workaround

test: temporary workaround for #21819

2 years agocore: do not attempt to add 'private' symlinks when RootImage/RootDirectory are used 22272/head
Luca Boccassi [Thu, 27 Jan 2022 14:10:34 +0000 (14:10 +0000)] 
core: do not attempt to add 'private' symlinks when RootImage/RootDirectory are used

A bind mount is added directly from private on the host to the actual
destination directory, no need for the symlinks (which cannot be created
as the bind mount happens first and creates the target as an actual directory)

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

2 years agohwdb: treat logitech craft keyboard as a keyboard
Seth Falco [Thu, 27 Jan 2022 21:08:30 +0000 (21:08 +0000)] 
hwdb: treat logitech craft keyboard as a keyboard

2 years agoresolve: llmnr: fix never hit condition 22274/head
Yu Watanabe [Fri, 28 Jan 2022 00:29:59 +0000 (09:29 +0900)] 
resolve: llmnr: fix never hit condition

Previously, the condition in on_stream_io_impl() never hit, as the
read packet is always taken from the stream in the few lines above.

Instead of the dns_stream_complete() under the condition, the stream
is unref()ed in the on_packet callback for LLMNR stream, unlike the
other on_packet callbacks.

That's quite tricky. Also, potentially, the stream may still have
queued packets to write.

This fix the condition, and drops the unref() in the on_packet callback.

C.f. https://github.com/systemd/systemd/pull/22274#issuecomment-1023708449.

Closes #22266.

2 years agoresolve: mention that dns_stream_update() needs to be called after dns_stream_take_re...
Yu Watanabe [Fri, 28 Jan 2022 00:01:07 +0000 (09:01 +0900)] 
resolve: mention that dns_stream_update() needs to be called after dns_stream_take_read_packet()

Based on the analysis by Joan Bruguera <joanbrugueram@gmail.com>.
See https://github.com/systemd/systemd/pull/22132#discussion_r793951650.

2 years agoresolve: call dns_stream_take_read_packet() in on_stream_io()
Yu Watanabe [Thu, 27 Jan 2022 23:57:05 +0000 (08:57 +0900)] 
resolve: call dns_stream_take_read_packet() in on_stream_io()

As dns_stream_take_read_packet() is called only in on_packet callbacks,
and all on_packet callbacks call it.

2 years agoresolve: make dns_stream_new() take on_packet and complete callbacks
Yu Watanabe [Thu, 27 Jan 2022 23:30:36 +0000 (08:30 +0900)] 
resolve: make dns_stream_new() take on_packet and complete callbacks

And make on_packet callback mandatory.

2 years agotest-network: wait for a while if manual policy is always-{up,down} 22277/head
Yu Watanabe [Thu, 27 Jan 2022 22:29:32 +0000 (07:29 +0900)] 
test-network: wait for a while if manual policy is always-{up,down}

If wait_operstate() is called super quickly after ip command, then the
up/down state may not be changed and propagated to networkd, and
wait_operstate() mistakenly pass with the previous state.

To avoid such situation, wait for a while to make networkd actually
detect the interface brought up/down.

2 years agotest-network: dummy interface is initially down when activation policy is manual
Yu Watanabe [Thu, 27 Jan 2022 22:17:08 +0000 (07:17 +0900)] 
test-network: dummy interface is initially down when activation policy is manual

2 years agotest-network: wait for the link is activated
Yu Watanabe [Thu, 27 Jan 2022 22:02:00 +0000 (07:02 +0900)] 
test-network: wait for the link is activated

This fixes the following race:
1. when a dummy interface is created, it is initially down state,
2. hence, wait_operstate() may pass before the link is activated,
3. and the ip command bring up the interface before the activation,
4. and networkd activates, that is, brings down the interface,
5. thus, next wait_operstate() timedout, as it waits for the interface up.

To fix the race, let's wait the link is activated, before enter the loop
of wait_operstate().

Fixes #22267.

2 years agotest-network: always cleanup the testing environment
Yu Watanabe [Thu, 27 Jan 2022 21:59:43 +0000 (06:59 +0900)] 
test-network: always cleanup the testing environment

Previously, if a subtest fail, then the cleanup process does not run,
and affects the subsequent tests.

2 years agotest: temporary workaround for #21819 22276/head
Frantisek Sumsal [Thu, 27 Jan 2022 21:51:15 +0000 (22:51 +0100)] 
test: temporary workaround for #21819

Since the TEST-64-UDEV-STORAGE fails are quite frequent now and the root
cause is yet to be discovered, let's add a kludge that attempts to retry
the test up to two more times in case it fails, so we don't
unnecessarily disturb CIs while the issue is being investigated.

Revert this commit once #21819 is sorted out.

2 years agotest: don't leak local variable to outer scopes
Frantisek Sumsal [Thu, 27 Jan 2022 21:50:58 +0000 (22:50 +0100)] 
test: don't leak local variable to outer scopes

2 years agotree-wide: fix typo
Yu Watanabe [Thu, 27 Jan 2022 19:47:39 +0000 (04:47 +0900)] 
tree-wide: fix typo

2 years agoMerge pull request #22132 from joanbm/main
Yu Watanabe [Thu, 27 Jan 2022 19:23:34 +0000 (04:23 +0900)] 
Merge pull request #22132 from joanbm/main

resolved: Fix DoT timeout on multiple answer records (for CloudFlare, Google, etc. DoT servers)

2 years agoMerge pull request #22262 from DaanDeMeyer/journal-fixes
Yu Watanabe [Thu, 27 Jan 2022 19:15:11 +0000 (04:15 +0900)] 
Merge pull request #22262 from DaanDeMeyer/journal-fixes

Journal fixes

2 years agojournal: Truncate file instead of punching hole in final object 22262/head
Daan De Meyer [Thu, 27 Jan 2022 14:44:35 +0000 (14:44 +0000)] 
journal: Truncate file instead of punching hole in final object

Instead of punching a hole in the final object if it's an entry array,
let's just truncate the file instead.

2 years agojournal: stat journal file after truncating
Daan De Meyer [Tue, 25 Jan 2022 23:53:58 +0000 (23:53 +0000)] 
journal: stat journal file after truncating

Let's make sure the data stored in last_stat is up-to-date after
truncating the journal file.

2 years agocore: add clearer debug log when setting up ExecDirectories symlinks fails
Luca Boccassi [Thu, 27 Jan 2022 14:08:44 +0000 (14:08 +0000)] 
core: add clearer debug log when setting up ExecDirectories symlinks fails

2 years agotest: use mksquashfs -noappend
Luca Boccassi [Thu, 27 Jan 2022 14:08:05 +0000 (14:08 +0000)] 
test: use mksquashfs -noappend

Makes the setup idempotent, as mksquashfs by default attempts to
append to an existing image

2 years agotest: rename service used in TEST-29-PORTABLE to avoid conflict
Luca Boccassi [Thu, 27 Jan 2022 14:07:20 +0000 (14:07 +0000)] 
test: rename service used in TEST-29-PORTABLE to avoid conflict

There's an app0.service in the extension app0.raw, so don't use the same
name for a unit in minimal.raw

2 years agotest: initialize buffer to make Coverity silent
Yu Watanabe [Thu, 27 Jan 2022 07:29:20 +0000 (16:29 +0900)] 
test: initialize buffer to make Coverity silent

Follow-up for f82f0b993740f4a9a3719c4df7c185411710df2b.

Fixes CID#1469119.

2 years agoNEWS: mention temporary limitations for running containers in systemd-homed directories
Christian Brauner [Thu, 27 Jan 2022 09:39:47 +0000 (10:39 +0100)] 
NEWS: mention temporary limitations for running containers in systemd-homed directories

2 years agoMerge pull request #22259 from bluca/exec_cond_restart
Yu Watanabe [Thu, 27 Jan 2022 06:09:47 +0000 (15:09 +0900)] 
Merge pull request #22259 from bluca/exec_cond_restart

core: do not restart a service with Restart=always when ExecCondition fails

2 years agoresolved: Test for DnsStream (plain TCP DNS and DoT) 22132/head
Joan Bruguera [Sun, 23 Jan 2022 16:08:12 +0000 (17:08 +0100)] 
resolved: Test for DnsStream (plain TCP DNS and DoT)

Tests DnsStream event handling, both for plain TCP DNS and DNS over TLS.

The DoT test requires the "openssl s_server" command line tool to mock a simple
TLS server. Thus the test's TLS part is skipped if openssl it not available.
The test works for both DNS_OVER_TLS_USE_GNUTLS and DNS_OVER_TLS_USE_OPENSSL.

The DoT case fails due to a bug, which is fixed on the next commit.

2 years agoresolved: Fix DoT timeout on multiple answer records
Joan Bruguera [Sat, 15 Jan 2022 16:33:25 +0000 (17:33 +0100)] 
resolved: Fix DoT timeout on multiple answer records

When sending multiple DNS questions to a DNS-over-TLS server (e.g. a question
for A and AAAA records, as is typical) on the same session, the server may
answer to each question in a separate TLS record, but it may also aggregate
multiple answers in a single TLS record.
(Some servers do this very often (e.g. Cloudflare 1.0.0.1), some do it sometimes
(e.g. Google 8.8.8.8) and some seem to never do it (e.g. Quad9 9.9.9.10)).

Both cases should be handled equivalently, as the byte stream is the same, but
when multiple answers came in a single TLS record, usually the first answer was
processed, but the second answer was entirely ignored, which caused a 10s delay
until the resolution timed out and the missing question was retried.
This can be reproduced by configuring one of the offending server and running
`resolvectl query google.com --cache=no` a few times.

To be notified of incoming data, systemd-resolved listens to `EPOLLIN` events
on the underlying socket. However, when DNS-over-TLS is used, the TLS library
(OpenSSL or GnuTLS) may read and buffer the entire TLS record when reading the
first answer, so usually no further `EPOLLIN` events will be generated, and the
second answer will never be processed.

To avoid this, if there's buffered TLS data, generate a "fake" EPOLLIN event.
This is hacky, but it makes this case transparent to the rest of the IO code.

2 years agologind.conf: Fix name of option: RuntimeDirectoryInodes -> RuntimeDirectoryInodesMax
Arfrever Frehtes Taifersar Arahesis [Thu, 27 Jan 2022 00:00:00 +0000 (00:00 +0000)] 
logind.conf: Fix name of option: RuntimeDirectoryInodes -> RuntimeDirectoryInodesMax

2 years agotests: fuzz dhcp_server_relay_message
Evgeny Vereshchagin [Wed, 26 Jan 2022 18:45:55 +0000 (18:45 +0000)] 
tests: fuzz dhcp_server_relay_message

It's a follow-up to https://github.com/systemd/systemd/pull/19384 where
dhcp_server_relay_message was introduced.

This PR was prompted by https://github.com/systemd/systemd/pull/22236#issuecomment-1020113269
for the most part.

2 years agotree-wide: don't use strjoina() on getenv() values
Anita Zhang [Wed, 26 Jan 2022 18:53:40 +0000 (10:53 -0800)] 
tree-wide: don't use strjoina() on getenv() values

Avoid doing stack allocations on environment variables.

2 years agodocs: fix typos and improve language
Erik Sjölund [Wed, 26 Jan 2022 18:42:49 +0000 (19:42 +0100)] 
docs: fix typos and improve language

Fix typos and improve the language by
adding a few commas and a missing word.

2 years agoman: Fix paths for user units (transient/generator.early)
Rike-Benjamin Schuppner [Wed, 26 Jan 2022 17:21:11 +0000 (18:21 +0100)] 
man: Fix paths for user units (transient/generator.early)

2 years agoMerge pull request #22251 from medhefgo/boot-cleanup
Luca Boccassi [Wed, 26 Jan 2022 22:34:32 +0000 (22:34 +0000)] 
Merge pull request #22251 from medhefgo/boot-cleanup

boot: Small improvements