Commit Graph

64748 Commits

Author SHA1 Message Date
Daan De Meyer
139b6fb16f mkosi: Make sure persistent journal storage is enabled
We ship with empty /var, so /var/log/journal does not exist, which
means journald does not do persistent logging. Let's fix that by
setting the config to explicitly enable persistent logging.
2023-05-22 22:19:41 +02:00
Daan De Meyer
ab45e83fb6 repart: Default to vfat for ESP/XBOOTLDR partitions
vfat makes a lot more sense than ext4 for these partitions.
2023-05-22 22:16:32 +02:00
Yu Watanabe
4539bb3b4b
Merge pull request #27733 from mrc0mmand/more-test-followups
test: a couple of follow-ups
2023-05-23 05:02:36 +09:00
Luca Boccassi
fa63798a2e man: use setlogmask in LogControl1 example
Useful to show programs using syslog() how to easily set a mask.
2023-05-22 18:05:29 +01:00
Frantisek Sumsal
7234a2131b test: use run_testcases() in a few more places 2023-05-22 16:02:49 +02:00
Frantisek Sumsal
587ae50d55 test: add a missing session activation
Otherwise test_list_user_sessions() would fail unless ordered after
test_session(), which activates the session.
2023-05-22 16:02:49 +02:00
Frantisek Sumsal
030a516314 test: prefix "internal" stuff with an underscore
Since bash has no namespaces, let's do the second best thing and prefix
all "internal" stuff with an underscore, to minimize the chance of a name
conflict in the future.
2023-05-22 16:02:49 +02:00
Frantisek Sumsal
b60d910d12 test: abstract the test case logic into a shared function 2023-05-22 16:02:49 +02:00
Zbigniew Jędrzejewski-Szmek
cb1cc1acd4
Merge pull request #27703 from keszybz/systemd-vconsole-ordering
Order systemd-vconsole-setup before getty units
2023-05-22 13:27:33 +02:00
Ronan Pigott
110789987d zsh: amend completion for networkctl edit 2023-05-22 12:14:04 +01:00
Frantisek Sumsal
7942811255 test: fix a typo in the cleanup stuff 2023-05-22 12:39:47 +02:00
Frantisek Sumsal
9a1ebef378 test: avoid memleak when allocation fails
==8==ERROR: LeakSanitizer: detected memory leaks

Indirect leak of 168 byte(s) in 3 object(s) allocated from:
    #0 0x4a0e6e in __interceptor_calloc /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:77:3
    #1 0x4dec61 in calloc (/build/fuzz-bus-match+0x4dec61)
    #2 0x7f7c25e2b92d in bus_match_add_leaf /work/build/../../src/systemd/src/libsystemd/sd-bus/bus-match.c:548:13
    #3 0x7f7c25e2b92d in bus_match_add /work/build/../../src/systemd/src/libsystemd/sd-bus/bus-match.c:886:16
    #4 0x4de864 in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/libsystemd/sd-bus/fuzz-bus-match.c:83:21
    #5 0x4defc8 in NaloFuzzerTestOneInput (/build/fuzz-bus-match+0x4defc8)
    #6 0x4fdf53 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
    #7 0x4fd73a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3
    #8 0x4fee09 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:757:19
    #9 0x4ffad5 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:895:5
    #10 0x4eee3f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6
    #11 0x4ef708 in LLVMFuzzerRunDriver /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:925:10
    #12 0x4df225 in main (/build/fuzz-bus-match+0x4df225)
    #13 0x7f7c252e3082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)

DEDUP_TOKEN: __interceptor_calloc--calloc--bus_match_add_leaf
SUMMARY: AddressSanitizer: 168 byte(s) leaked in 3 allocation(s).

Found by Nallocfuzz.
2023-05-22 12:39:47 +02:00
Frantisek Sumsal
3575c37169 shared: correctly propagate possible allocation errors
instead of just asserting in case the memstream couldn't be resized.

Found by Nallocufuzz.
2023-05-22 12:39:47 +02:00
Yu Watanabe
6554f56361 wait-online: downgrade log level of failure that interface is removed or unmanaged during processing it
Closing #27145.
2023-05-22 19:06:06 +09:00
Jan Janssen
f70f992273 boot: Read files in small chunks on broken firmware
Fixes: #25911
2023-05-22 10:52:17 +01:00
Yu Watanabe
e7432ed7ca
Merge pull request #27726 from yuwata/network-wireguard-doc
network: update doc
2023-05-22 16:46:38 +09:00
Daan De Meyer
137f5f9169
Merge pull request #26577 from ChenQi1989/revert-revert-journal
Revert "Revert "journal: Make sd_journal_previous/next() return 0 at …
2023-05-22 07:51:01 +02:00
Yu Watanabe
f8c5301e44 man: AllowedIPs= can be specified multiple times
Closes #27507.
2023-05-22 14:18:46 +09:00
Yu Watanabe
54189b2ec3 network/wireguard: make AllowedIPs= cleared by specifying an empty string 2023-05-22 14:15:49 +09:00
Yu Watanabe
23ff8a776c test: install test specific modules in test_append_files() 2023-05-22 12:40:05 +09:00
Chen Qi
7a4ee86161 Revert "Revert "journal: Make sd_journal_previous/next() return 0 at HEAD/TAIL""
This reverts commit 1db6dbb1dc.

The original patch was reverted because of issue #25369. The issue was created
because it wrongly assumed that sd_journal_seek_tail() seeks to 'current' tail.
But in fact, only when a subsequent sd_journal_previous() is called that it's
pointing to the tail at that time. The concept of 'tail' in sd_journal_seek_tail()
only has a logical meaning, and a sd_journal_previous is needed. In fact, if we
look at the codes in journalctl, we can see sd_journal_seek_tail() is followed by
sd_journal_previous(). By contrary, a sd_journal_next() after a 'logical' tail does
not make much sense. So the original patch is correct, and projects that are
using 'sd_journal_next()' right after 'sd_journal_seek_tail()' should do fixes
as in https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2823#note_1637715.
2023-05-22 02:54:40 +09:00
Yu Watanabe
a94149601a sd-journal: save correct location specifier 2023-05-22 02:54:40 +09:00
Yu Watanabe
43e460a584 test-journal-interleaving: extend tests to clarify the issue in sd_journal_next() or friends
This illustrates bug in sd_journal_next() or friends;
calling sd_jounral_next() followed by sd_journal_seek_tail() makes the
location saved in sd-journal something corrupted, and subsequent
sd_journal_previous() or friends may fail or provides unexpected result.
2023-05-22 02:49:25 +09:00
Dmitry V. Levin
9e36da1541 udevadm-verify: introduce --no-summary option
When udevadm verify is invoked by an analyzer tool like rpminspect
to verify individual udev rules files, the summary just clutters the
output, so provide an option to turn the summary off.
2023-05-21 23:20:30 +09:00
Yu Watanabe
ddf0d5cc0d
Merge pull request #27157 from YHNdnzj/networkctl-edit
networkctl: add verb edit and cat to operate on network configs
2023-05-21 21:36:56 +09:00
Mike Yuan
a3d975b240
test: add tests for networkctl edit/cat 2023-05-21 15:55:42 +08:00
Mike Yuan
96bab8fd63
networkctl: add verb edit and cat to operate on network configs
This adds two verbs, edit and cat, to networkctl for
operating on network configs (namely .network, .netdev
and .link files). Specially, if the config name is
prefixed by @, it will be treated as network interface
name, and operations will be performed on config files
associated with the link.

Closes #26906
2023-05-21 15:48:57 +08:00
Mike Yuan
35c0e3444d
conf-parser: move config_get_dropin_files to conf-files 2023-05-21 15:46:25 +08:00
Mike Yuan
d260875f78
networkctl: mark some verbs as online only 2023-05-21 15:46:25 +08:00
Mike Yuan
8dfc3bf597
networkctl: fix a typo in log message 2023-05-21 15:46:25 +08:00
Mike Yuan
43449ca327
networkctl: add missing asserts 2023-05-21 15:46:25 +08:00
Mike Yuan
6c6930077c
networkctl: check netns only if networkd is running 2023-05-21 15:46:22 +08:00
Mike Yuan
2b30967f6b
Merge pull request #27719 from mrc0mmand/fuzz-tweaks
fuzz: a couple of fixes for issues found by Nallocfuzz
2023-05-21 15:41:15 +08:00
Frantisek Sumsal
a19b6bd554 sd-event: check the allocation before calling expand_to_usable()
As it might hide a possible allocation error since it uses
the returns_nonnull attribute:

AddressSanitizer:DEADLYSIGNAL
=================================================================
==8==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000004 (pc 0x7f317897db8d bp 0x7ffd436fe9a0 sp 0x7ffd436fe970 T0)
==8==The signal is caused by a WRITE memory access.
==8==Hint: address points to the zero page.
SCARINESS: 10 (null-deref)
    #0 0x7f317897db8d in source_new /work/build/../../src/systemd/src/libsystemd/sd-event/sd-event.c:1214:18
    #1 0x7f317897e68c in sd_event_add_time /work/build/../../src/systemd/src/libsystemd/sd-event/sd-event.c:1417:13
    #2 0x7f317897a0f6 in event_reset_time /work/build/../../src/systemd/src/libsystemd/sd-event/event-util.c:68:21
    #3 0x4e2c8e in client_initialize_time_events /work/build/../../src/systemd/src/libsystemd-network/sd-dhcp-client.c:1366:13
    #4 0x4eb0fd in client_initialize_events /work/build/../../src/systemd/src/libsystemd-network/sd-dhcp-client.c:1380:9
    #5 0x4eb0fd in client_start_delayed /work/build/../../src/systemd/src/libsystemd-network/sd-dhcp-client.c:1410:16
    #6 0x4e30aa in client_start /work/build/../../src/systemd/src/libsystemd-network/sd-dhcp-client.c:1415:16
    #7 0x4e30aa in sd_dhcp_client_start /work/build/../../src/systemd/src/libsystemd-network/sd-dhcp-client.c:2045:13
    #8 0x4e700e in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/libsystemd-network/fuzz-dhcp-client.c:73:15
    #9 0x5062f8 in NaloFuzzerTestOneInput (/build/fuzz-dhcp-client+0x5062f8)
    #10 0x525283 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
    #11 0x524a6a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3
    #12 0x526139 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:757:19
    #13 0x526e05 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:895:5
    #14 0x51616f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6
    #15 0x516a38 in LLVMFuzzerRunDriver /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:925:10
    #16 0x506555 in main (/build/fuzz-dhcp-client+0x506555)
    #17 0x7f3177ce3082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
    #18 0x420c4d in _start (/build/fuzz-dhcp-client+0x420c4d)

Found by Nallocfuzz.
2023-05-20 23:08:51 +02:00
Frantisek Sumsal
5b6f7b104c fuzz: avoid a couple of NULL pointer dereferences
In case one of the allocations fails.

For example:

AddressSanitizer:DEADLYSIGNAL
=================================================================
==17==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fb352a476e5 bp 0x7ffe45154850 sp 0x7ffe45154008 T0)
==17==The signal is caused by a READ memory access.
==17==Hint: address points to the zero page.
SCARINESS: 10 (null-deref)
    #0 0x7fb352a476e5  (/lib/x86_64-linux-gnu/libc.so.6+0x1886e5) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
    #1 0x435878 in __interceptor_strlen /src/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc
    #2 0x4de1e4 in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/fuzz/fuzz-calendarspec.c:20:21
    #3 0x4deea8 in NaloFuzzerTestOneInput (/build/fuzz-calendarspec+0x4deea8)
    #4 0x4fde33 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
    #5 0x4fd61a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3
    #6 0x4fece9 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:757:19
    #7 0x4ff9b5 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:895:5
    #8 0x4eed1f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6
    #9 0x4ef5e8 in LLVMFuzzerRunDriver /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:925:10
    #10 0x4df105 in main (/build/fuzz-calendarspec+0x4df105)
    #11 0x7fb3528e3082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
    #12 0x41f80d in _start (/build/fuzz-calendarspec+0x41f80d)

Found by Nallocfuzz.
2023-05-20 23:08:51 +02:00
Frantisek Sumsal
02af58acad README: drop the CentOS CI SELinux job
It has been failing for more than a year and I don't think that anyone
cares about the stuff it keeps finding.
2023-05-20 17:12:01 +02:00
Mike Yuan
93773df467
Merge pull request #27714 from yuwata/cryptenroll-password
cryptenroll-password: tiny cleanups
2023-05-20 16:33:16 +08:00
Yu Watanabe
70b53893f1 cryptenroll: update log messages 2023-05-20 14:21:10 +09:00
Yu Watanabe
cefa4a02ab cryptenroll: drop unmet condition 2023-05-20 14:21:10 +09:00
Yu Watanabe
b3bd6ccd1e
Merge pull request #27707 from mrc0mmand/tests
test: provide coverage for a couple of recent-ish issues
2023-05-20 08:40:01 +09:00
Yu Watanabe
294c20198b test: replace Makefile for several tests with symlink to the one for TEST-01-BASIC 2023-05-20 05:42:24 +09:00
Yu Watanabe
396f6900ae
Merge pull request #27676 from ldv-alt/udevadm-verify
udevadm-verify: add support for directory arguments
2023-05-20 05:41:05 +09:00
Yu Watanabe
24d724087f
Merge pull request #27701 from poettering/switch-root-same-file
switch-root: use same_files() logic when checking whether new and old root dir are actually the same
2023-05-20 05:39:28 +09:00
Luca Boccassi
382e18fd95
Merge pull request #27438 from bluca/dump_ratelimit
manager: restrict Dump*() to privileged callers or ratelimit
2023-05-19 21:29:58 +01:00
Frantisek Sumsal
a9ec30ab7e test: check if we correctly handle locales with leading spaces
Provides coverage for #27179.
2023-05-19 21:35:47 +02:00
Frantisek Sumsal
305aa43815 tests: run all functions with testcase_ prefix automagically 2023-05-19 20:03:34 +02:00
Frantisek Sumsal
b74df879fc test: check if we correctly handle invalid UTF-8 in mount stuff
Provides coverage for #27611.
2023-05-19 20:03:34 +02:00
Frantisek Sumsal
928733cd86 test: assorted TEST-13-NSPAWN tweaks 2023-05-19 20:03:34 +02:00
Frantisek Sumsal
c11c50a53f test: check if we can use --merge with --follow
Provides coverage for #24565.
2023-05-19 20:03:34 +02:00
Zbigniew Jędrzejewski-Szmek
a6f3a7eb8a units: order sysinit.target, debug-shell.service after systemd-vconsole-setup
Previous patch to add an implicit dependency effectively orders various getty
services after systemd-vconsole-setup.service. But I think it's cleaner to also
order the service before sysinit.target, like it was before
8125e8d38e. There might be units which don't do
use TTYVHangup= but would like to have the console fully initialized.

Also, add a manual ordering to debug-shell.service, because it has
ImplicitDependencies=no. This might delay debug-shell.service a bit, but
systemd-vconsole-setup.service has no dependencies and should be very quick, so
this should not be noticable in practice. Without the ordering, the terminal
might not have a key map loaded, making debug-shell.service hard to use.
2023-05-19 17:47:14 +02:00