]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
12 months agoMerge pull request #27842 from keszybz/man-page-links
Zbigniew Jędrzejewski-Szmek [Tue, 30 May 2023 11:40:45 +0000 (13:40 +0200)] 
Merge pull request #27842 from keszybz/man-page-links

Man page formatting and links and such

12 months agoman: mention that udevadm verify also checks for udev rules style issues
Dmitry V. Levin [Mon, 29 May 2023 08:00:00 +0000 (08:00 +0000)] 
man: mention that udevadm verify also checks for udev rules style issues

Starting with commit acc1954a0394, udevadm verify also checks token
delimiters, which are not necessarily a matter of udev rules syntax,
but rather a question of style and readability.  Mention that in the
documentation to avoid confusion.

Suggested-by: Martin Wilck <mwilck@suse.com>
Complements: acc1954a0394 ("udev-rules: check token delimiters")

12 months agoman/analyze: drop paths from output examples 27842/head
Zbigniew Jędrzejewski-Szmek [Tue, 30 May 2023 08:06:05 +0000 (10:06 +0200)] 
man/analyze: drop paths from output examples

They are not useful for the user but make the examples
wider than necessary.

12 months agoman/analyze: reword description of malloc and fix link
Zbigniew Jędrzejewski-Szmek [Tue, 30 May 2023 08:04:02 +0000 (10:04 +0200)] 
man/analyze: reword description of malloc and fix link

12 months agoSupport no-journal for dm-integrity devices.
Russell Harmon [Mon, 29 May 2023 01:51:36 +0000 (18:51 -0700)] 
Support no-journal for dm-integrity devices.

As documented in integritysetup.8, dm-integrity devices support running
without a journal whatsoever. This change allows the
CRYPT_ACTIVATE_NO_JOURNAL flag (the same as is used with `integritysetup
--integrity-no-journal`) to be passed in during dmsetup by specifying
the `no-journal` option in integritytab.5.

12 months agoMerge pull request #27687 from keszybz/boot-efi-choices
Mike Yuan [Tue, 30 May 2023 07:21:42 +0000 (15:21 +0800)] 
Merge pull request #27687 from keszybz/boot-efi-choices

gpt-auto-generator: rework/simplify logic for picking /efi or /boot

12 months agobpf: test with GCC BPF compiler on opensuse
James Hilliard [Mon, 29 May 2023 21:45:13 +0000 (15:45 -0600)] 
bpf: test with GCC BPF compiler on opensuse

12 months agohome: move the assert back to the intended place
Frantisek Sumsal [Mon, 29 May 2023 18:28:34 +0000 (20:28 +0200)] 
home: move the assert back to the intended place

98d81cf974 moved the assertion at the beginning of home_dispatch_acquire(),
which is however before we even check for any ongoing operation, hence we
might hit it even in legitimate cases.

Let's move it back to after we check for any possibly ongoing operation, to
make it once again a safety check.

Follow-up to 98d81cf974.
Resolves: #22443 and #24036

12 months agobpf: stabilize GCC BPF support
James Hilliard [Mon, 29 May 2023 21:01:34 +0000 (15:01 -0600)] 
bpf: stabilize GCC BPF support

Now that we have a GCC release which should support our bpf programs
lets set the minimum version and stabilize it.

12 months agodissect: implement the same logic as gpt-auto-generator 27687/head
Zbigniew Jędrzejewski-Szmek [Wed, 24 May 2023 14:55:16 +0000 (16:55 +0200)] 
dissect: implement the same logic as gpt-auto-generator

gpt-auto-generator does three checks: 1. whether the directory doesn't have
files, 2. whether it's not in fstab, and 3. whether it is not a mount point.
For dissect logic, 3. is not relevant, and it ignores 2.
But the check whether files exists was done only partially: it was done
for /efi, but not for /boot.

Two changes are made:
- the check whether /boot is empty is now done.
- for ESP, /boot is used in preference to /efi, if not used for XBOOTLDR.

With those changes, the logic in dissect matches what gpt-auto-generator does.
There are the two intentional differences described in the first paragraph,

12 months agogpt-auto-generator: rework/simplify logic for picking /efi or /boot
Zbigniew Jędrzejewski-Szmek [Wed, 5 Apr 2023 15:10:16 +0000 (17:10 +0200)] 
gpt-auto-generator: rework/simplify logic for picking /efi or /boot

I started looking into https://github.com/uapi-group/specifications/issues/35.

BLS says:
> Otherwise [no existing XBOOTLDR partition], if on GPT and an ESP is found and
> it is large enough (let’s say at least 1G) it should be used as $BOOT and
> used as primary location to place boot loader menu resources in.

> It is recommended to mount $BOOT to /boot/, and the ESP to /efi/.

DPS says:
> The ESP used for the current boot is automatically mounted to /efi/ (or
> /boot/ as fallback), unless a different partition is mounted there (possibly
> via /etc/fstab, or because the Extended Boot Loader Partition — see below —
> exists) or the directory is non-empty on the root disk.

I don't think we want to mount the same partition in two places.
If the same partition is not mounted in two places, then the two specs are
contradictory.

The code in gpt-auto-generator implemented the logic from the DPS. It is
modified to implement the logic from BLS.

Effectively:
- if both /boot and /efi are available:
  - if both XBOOTLDR and ESP exist:
    ESP on /efi, XBOOTLDR on /boot
  - if only ESP exists:
    ESP on /boot
  - if only XBOOTLDR exists:
    XBOOTLDR on /boot
- if only /boot is available:
  - if XBOOTLDR exists:
    XBOOTLDR on /boot
  - if only ESP exists:
    ESP on /boot
- if only /efi is available:
  - if ESP exists:
    ESP on /efi

"Available" means that it the mount point is not mounted over and does not
contain files. If the directory doesn't exist, it is also "available" and will
be created later when the mount or automount unit is started.

Thus, the generator attempts to match the partitions and mount points to the
extent possible. In all cases, /boot is the primary place to install kernels.
ESP can be found on /boot or /efi, depending on the situation.

If this patch is merged, I'll submit fixes for BLS and DPS to describe the
same logic.

12 months agoman/tmpfiles: add more man page citerefs
Zbigniew Jędrzejewski-Szmek [Wed, 17 May 2023 16:31:25 +0000 (18:31 +0200)] 
man/tmpfiles: add more man page citerefs

This was supposed to be part of 8fb350049bb7a7305589f201df9d37482e544f24, but
I forgot to save the file.

12 months agoresolvectl: drop extra colon
David Tardon [Sun, 28 May 2023 20:30:48 +0000 (22:30 +0200)] 
resolvectl: drop extra colon

12 months agobasic/syscall: update syscall list
Yu Watanabe [Sun, 28 May 2023 15:05:38 +0000 (00:05 +0900)] 
basic/syscall: update syscall list

Only notable change is that memfd_secret is now defined on s390(x).

12 months agogpt/DPS: add more aliases for python's machine
Luca Boccassi [Fri, 26 May 2023 19:45:29 +0000 (20:45 +0100)] 
gpt/DPS: add more aliases for python's machine

In mkosi we set the default architecture to platform.machine() which
is again slightly incompatible for a few architectures, so add more
aliases, so that repart works by default with these names.

12 months agopo: add a false positive to POTFILES.skip
Piotr Drąg [Sat, 27 May 2023 16:11:35 +0000 (18:11 +0200)] 
po: add a false positive to POTFILES.skip

Scripts used to detect files that should be in POTFILES.in, like
intltool-update -m used on https://l10n.gnome.org/module/systemd/,
falsely detect this file as containing translations. Avoid this
behavior by putting the file in POTFILES.skip.

12 months agotree-wide: Downgrade a few more noisy log messages to trace
Daan De Meyer [Sat, 27 May 2023 08:36:30 +0000 (10:36 +0200)] 
tree-wide: Downgrade a few more noisy log messages to trace

12 months agoboot/measure: replace TPM PolicyPCR session with calculation
Dan Streetman [Fri, 5 May 2023 23:48:14 +0000 (19:48 -0400)] 
boot/measure: replace TPM PolicyPCR session with calculation

Instead of using a trial policy with a TPM to calculate the measurement hash,
this uses a function to calculate the hash with no TPM needed.

12 months agoMerge pull request #27721 from yuwata/journalctl-cleanup
Yu Watanabe [Fri, 26 May 2023 22:59:22 +0000 (07:59 +0900)] 
Merge pull request #27721 from yuwata/journalctl-cleanup

journalctl: split get_boots() into three

12 months agoAdd DHCPServer information to JSON output.
Rene Hollander [Sun, 30 Apr 2023 11:31:28 +0000 (13:31 +0200)] 
Add DHCPServer information to JSON output.

Adds a new JSON object called DHCPServer for each interface that has a
DHCPServer configured. It has the following attributes:
- PoolSize and PoolOffset from the configuration
- List of offered leases
- List of static leases from the configuration

12 months agoRevert "test: add test case for systemd-update-utmp vs daemon-reexec"
Frantisek Sumsal [Fri, 26 May 2023 19:41:43 +0000 (21:41 +0200)] 
Revert "test: add test case for systemd-update-utmp vs daemon-reexec"

Temporarily revert the test case for #27167, as the additional
daemon-reexecs exacerbate #27287, making CIs fail quite often.
As the #27167 is also covered by TEST-01-BASIC itself, since we do
daemon-reexec there anyway, we shouldn't lose any coverage, but it
should make CIs more stable until #27287 is figured out.

Resolves (or more like works around): #27807

This reverts commit d689f70a2c18666bbf6500df7a53962a8f3e91a4.

12 months agoMerge pull request #27517 from ddstreet/tpm2_calculate_policy
Daan De Meyer [Fri, 26 May 2023 21:08:15 +0000 (23:08 +0200)] 
Merge pull request #27517 from ddstreet/tpm2_calculate_policy

Tpm2 calculate policy

12 months agojournalctl: split get_boots() into three 27721/head
Yu Watanabe [Fri, 26 May 2023 18:57:39 +0000 (03:57 +0900)] 
journalctl: split get_boots() into three

Previously, get_boots() used for three ways; finding boot entry by
boot ID, finding boot entry by offset, listing up all boot IDs.

Let's split it into three for each usecase.

No functional change, just refactoring.

12 months agologs-show: introduce add_match_boot_id() helper function
Yu Watanabe [Sun, 21 May 2023 14:06:28 +0000 (23:06 +0900)] 
logs-show: introduce add_match_boot_id() helper function

12 months agoMerge pull request #27787 from keszybz/firstboot-synchronous-restart
Mike Yuan [Fri, 26 May 2023 18:30:45 +0000 (02:30 +0800)] 
Merge pull request #27787 from keszybz/firstboot-synchronous-restart

firstboot: make restart of vconsole-setup synchronuous

12 months agoMerge pull request #27786 from YHNdnzj/format-timestamp-monotonic
Yu Watanabe [Fri, 26 May 2023 18:05:34 +0000 (03:05 +0900)] 
Merge pull request #27786 from YHNdnzj/format-timestamp-monotonic

time-util,format-table: add relative_monotonic variant for timestamp

12 months agoMerge pull request #27803 from mrc0mmand/even-more-nalloc-shenanigans
Yu Watanabe [Fri, 26 May 2023 17:58:32 +0000 (02:58 +0900)] 
Merge pull request #27803 from mrc0mmand/even-more-nalloc-shenanigans

A couple more fixes for potential OOM-related issues

12 months agogpt/DPS: alias amd64 to x86-64 and aarch64 to arm64
Luca Boccassi [Fri, 26 May 2023 14:44:42 +0000 (15:44 +0100)] 
gpt/DPS: alias amd64 to x86-64 and aarch64 to arm64

The DSP and our implementation mixes Debian terminology with CPU
terminology. It uses arm64 which is a Debian thing instead of
aarch64, but x86-64 which is a CPU thing instead of amd64.
Add some convenience and transparent aliasing, so that we don't
need to maintain architecture-specific and tool-specific translation
layers in mkosi among other places, while at the same time the DDIs
still look the same (ie: the partlabel does not change depending on
which alias is used, the canonical label is used on disk).

12 months agotest-gpt: verify that alias entries are identical to the primary ones
Lennart Poettering [Fri, 26 May 2023 14:55:29 +0000 (16:55 +0200)] 
test-gpt: verify that alias entries are identical to the primary ones

Given we allow aliases we better check for consistency of alias entries
and the primary one.

12 months agotpm2: add tpm2_calculate_sealing_policy() 27517/head
Dan Streetman [Thu, 15 Dec 2022 17:56:35 +0000 (12:56 -0500)] 
tpm2: add tpm2_calculate_sealing_policy()

This adds a function to fully calculate the authPolicy needed to seal a secret,
and updates tpm2_seal() to use the new function instead of a trial policy.

12 months agotpm2: use tpm2_policy_authorize()
Dan Streetman [Thu, 9 Feb 2023 15:04:58 +0000 (10:04 -0500)] 
tpm2: use tpm2_policy_authorize()

This updates the function to build the sealing policy to use the dedicated
function to perform PolicyAuthorize.

This is separate from the previous commit to make each commit easier to read.

12 months agotpm2: add tpm2_policy_authorize()
Dan Streetman [Fri, 9 Dec 2022 19:49:52 +0000 (14:49 -0500)] 
tpm2: add tpm2_policy_authorize()

This adds functions to get the digest for a PolicyAuthorize operation. For
building a policy hash, this provides a function to calculate the hash; and for
building a policy hash to satisfy the authPolicy for an existing object, this
provides a function to perform PolicyAuthorize with an existing session.

12 months agotpm2: add tpm2_policy_auth_value()
Dan Streetman [Fri, 9 Dec 2022 19:59:05 +0000 (14:59 -0500)] 
tpm2: add tpm2_policy_auth_value()

This adds functions to get the digest for a PolicyAuthValue operation. For
building a policy hash, this provides a function to calculate the hash; and for
building a policy hash to satisfy the authPolicy for an existing object, this
provides a function to perform PolicyAuthValue with an existing session.

12 months agotpm2: add tpm2_policy_pcr()
Dan Streetman [Thu, 8 Dec 2022 22:56:11 +0000 (17:56 -0500)] 
tpm2: add tpm2_policy_pcr()

This adds functions to get the digest for a PolicyPCR operation. For building
a policy hash, this provides a function to calculate the hash; and for building
a policy hash to satisfy the authPolicy for an existing object, this provides a
function to perform PolicyPCR with an existing session.

12 months agotpm2: rename pcr_values_size vars to n_pcr_values
Dan Streetman [Thu, 11 May 2023 19:33:31 +0000 (15:33 -0400)] 
tpm2: rename pcr_values_size vars to n_pcr_values

Using the n_ prefix is more appropriate/conventional than the _size suffix.

No functional change, this is cosmetic only.

12 months agotpm2: add tpm2_get_name()
Dan Streetman [Wed, 14 Dec 2022 15:46:13 +0000 (10:46 -0500)] 
tpm2: add tpm2_get_name()

This adds functions to get the "name" of a key. The key "name", as defined
by the TPM2 spec, includes its entire public area (with attribute fields),
not only its key fingerprint.

A function is added to calculate the name of a provided key public area,
as well as a function to get the name of a key which is present in the TPM.

12 months agotpm2: add tpm2_set_auth()
Dan Streetman [Tue, 6 Dec 2022 18:16:43 +0000 (13:16 -0500)] 
tpm2: add tpm2_set_auth()

This provides a function to perform the SetAuth TPM function, which provides
the authValue for a key.

12 months agotpm2: replace hash_pin() with tpm2_digest_*() functions
Dan Streetman [Wed, 14 Dec 2022 15:46:13 +0000 (10:46 -0500)] 
tpm2: replace hash_pin() with tpm2_digest_*() functions

The hash_pin() function is just a specific use case of the digest functions.

12 months agotpm2: add tpm2_digest_*() functions
Dan Streetman [Wed, 14 Dec 2022 15:46:13 +0000 (10:46 -0500)] 
tpm2: add tpm2_digest_*() functions

These functions allow extending (or initializing) a TPM2B_DIGEST with additional
data, using a specified hash operation. This is needed to perform hash
calculations instead of relying on the TPM to perform the calculations in
trial sessions.

12 months agoman: fix UKI filename suffix in 'tries' description
Vitaly Kuznetsov [Fri, 26 May 2023 14:57:37 +0000 (16:57 +0200)] 
man: fix UKI filename suffix in 'tries' description

Boot Loader Type #2 entries (UKIs in $BOOT/EFI/Linux/) have '.efi' suffix,
not '.conf'.

12 months agomount-util: Downgrade another noisy debug log to trace level
Daan De Meyer [Fri, 26 May 2023 14:14:46 +0000 (16:14 +0200)] 
mount-util: Downgrade another noisy debug log to trace level

12 months agonspawn: restore cross-architecture booting
Luca Boccassi [Fri, 26 May 2023 11:42:42 +0000 (12:42 +0100)] 
nspawn: restore cross-architecture booting

The check added by 4c27749b8c6b24ef7481ba183ae1fca3749afbf7 breaks
booting an arm64 image on x86 using qemu-bin-fmt, so remove it.
Without it, the image built with mkosi --architecture=aarch64
boots fine in nspawn.

12 months agoudev: introduce .PART_SUFFIX internal property
Yu Watanabe [Wed, 24 May 2023 04:05:56 +0000 (13:05 +0900)] 
udev: introduce .PART_SUFFIX internal property

To make unify rules for disk and partition.

12 months agoMerge pull request #27746 from yuwata/unit-bidirectional-dep
Zbigniew Jędrzejewski-Szmek [Fri, 26 May 2023 14:20:48 +0000 (16:20 +0200)] 
Merge pull request #27746 from yuwata/unit-bidirectional-dep

core/unit: make unit dependency always bidirectional

12 months agosd-network: avoid leaking DHCPLease 27803/head
Frantisek Sumsal [Fri, 26 May 2023 09:38:58 +0000 (11:38 +0200)] 
sd-network: avoid leaking DHCPLease

If we fail any allocation prior adding the lease to the server lease
hashmap.

==2103==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 128 byte(s) in 2 object(s) allocated from:
    #0 0x4a203e in __interceptor_calloc /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:77:3
    #1 0x4f6341 in calloc (/build/fuzz-dhcp-server+0x4f6341)
    #2 0x4ec818 in add_lease /work/build/../../src/systemd/src/libsystemd-network/fuzz-dhcp-server.c:26:9
    #3 0x4ec2bf in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/libsystemd-network/fuzz-dhcp-server.c:75:9
    #4 0x4f68a8 in NaloFuzzerTestOneInput (/build/fuzz-dhcp-server+0x4f68a8)
    #5 0x5158b3 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
    #6 0x51509a 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
    #7 0x516769 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:757:19
    #8 0x517435 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
    #9 0x50679f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6
    #10 0x507068 in LLVMFuzzerRunDriver /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:925:10
    #11 0x4f6b25 in main (/build/fuzz-dhcp-server+0x4f6b25)
    #12 0x7f16084e3082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)

DEDUP_TOKEN: __interceptor_calloc--calloc--add_lease
SUMMARY: AddressSanitizer: 128 byte(s) leaked in 2 allocation(s).

Found by Nallocufzz.

12 months agosd-journal: log about errors from ordered_hashmap_*()
Frantisek Sumsal [Thu, 25 May 2023 09:58:32 +0000 (11:58 +0200)] 
sd-journal: log about errors from ordered_hashmap_*()

Follow-up to 08a8fd6e8d.

12 months agojournal-remote: bump the refcount right after creating the writer object
Frantisek Sumsal [Thu, 25 May 2023 20:47:13 +0000 (22:47 +0200)] 
journal-remote: bump the refcount right after creating the writer object

Otherwise we might hit an assertion during cleanup if the
following mmap_cache_new() call fails:

Assertion 'p->n_ref > 0' failed at src/journal-remote/journal-remote-write.c:80, function writer_unref(). Aborting.

==2069==ERROR: AddressSanitizer: ABRT on unknown address 0x000000000815 (pc 0x7f39dcd0200b bp 0x7ffe2fe24db0 sp 0x7ffe2fe24b60 T0)
SCARINESS: 10 (signal)
    #0 0x7f39dcd0200b in raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
    #1 0x7f39dcce1858 in abort (/lib/x86_64-linux-gnu/libc.so.6+0x22858) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
    #2 0x7f39dd747e49 in log_assert_failed /work/build/../../src/systemd/src/basic/log.c:940:9
    #3 0x4e4431 in writer_unref /work/build/../../src/systemd/src/journal-remote/journal-remote-write.c:80:1
    #4 0x4e3fd5 in writer_unrefp /work/build/../../src/systemd/src/journal-remote/journal-remote-write.h:27:1
    #5 0x4e3fd5 in writer_new /work/build/../../src/systemd/src/journal-remote/journal-remote-write.c:56:1
    #6 0x4e04bc in journal_remote_get_writer /work/build/../../src/systemd/src/journal-remote/journal-remote.c:125:21
    #7 0x4e0e0b in get_source_for_fd /work/build/../../src/systemd/src/journal-remote/journal-remote.c:181:13
    #8 0x4e0e0b in journal_remote_add_source /work/build/../../src/systemd/src/journal-remote/journal-remote.c:233:13
    #9 0x4df99f in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/journal-remote/fuzz-journal-remote.c:54:9
    #10 0x4e8f48 in NaloFuzzerTestOneInput (/build/fuzz-journal-remote+0x4e8f48)
    #11 0x507f53 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
    #12 0x50773a 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
    #13 0x508e09 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:757:19
    #14 0x509ad5 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
    #15 0x4f8e3f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6
    #16 0x4f9708 in LLVMFuzzerRunDriver /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:925:10
    #17 0x4e91c5 in main (/build/fuzz-journal-remote+0x4e91c5)
    #18 0x7f39dcce3082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
    #19 0x420bcd in _start (/build/fuzz-journal-remote+0x420bcd)

DEDUP_TOKEN: raise--abort--log_assert_failed
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: ABRT (/lib/x86_64-linux-gnu/libc.so.6+0x4300b) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee) in raise

Found by Nallocufzz.

12 months agoMerge pull request #27554 from ElvishJerricco/tmpfiles-c-escapes
Zbigniew Jędrzejewski-Szmek [Fri, 26 May 2023 13:42:48 +0000 (15:42 +0200)] 
Merge pull request #27554 from ElvishJerricco/tmpfiles-c-escapes

tmpfiles: Allow C escapes

12 months agovarious: fix error message for bus_wait_for_jobs_new() 27787/head
Zbigniew Jędrzejewski-Szmek [Fri, 26 May 2023 13:09:03 +0000 (15:09 +0200)] 
various: fix error message for bus_wait_for_jobs_new()

As pointed out by Mike Yuan in review of grandparent commit,
bus_wait_for_jobs_new() can also fail for non-oom reasons.

12 months agounits: order systemd-firstboot after systemd-tmpfiles-setup
Zbigniew Jędrzejewski-Szmek [Thu, 25 May 2023 11:36:17 +0000 (13:36 +0200)] 
units: order systemd-firstboot after systemd-tmpfiles-setup

We may copy files from factory to /etc. The default mkosi config has
factory/etc/vconsole.conf. systemd-firstboot would race with tmpfiles-setup,
and sometimes ask for the keymap, and sometimes not.

I guess that if there are files in factory, we shouldn't ask the user for
the same configuration.

12 months agofirstboot: synchronously wait for systemd-vconsole-setup.service/restart job
Zbigniew Jędrzejewski-Szmek [Thu, 25 May 2023 10:26:37 +0000 (12:26 +0200)] 
firstboot: synchronously wait for systemd-vconsole-setup.service/restart job

Requested in https://github.com/systemd/systemd/pull/27755#pullrequestreview-1443489520.

I dropped the info message about the job being requested, because we get
fairly verbose logs from starting the unit, and the additional message isn't
useful.

In the unit, the ordering before systemd-vconsole-setup.service is dropped,
because now it needs to happen in parallel, while systemd-firstboot.service
is running. This means that we may potentially execute vconsole-setup twice,
but it's fairly quick, so this doesn't matter much.

12 months agofstab-generator: use correct swap name var
Frantisek Sumsal [Fri, 26 May 2023 12:05:40 +0000 (14:05 +0200)] 
fstab-generator: use correct swap name var

Follow-up to 9445623363.

12 months agoMerge pull request #27563 from yuwata/fstab-generator
Lennart Poettering [Fri, 26 May 2023 09:52:19 +0000 (02:52 -0700)] 
Merge pull request #27563 from yuwata/fstab-generator

fstab-generator: support defining mount units through kernel command line

12 months agocore: change 'basename' to 'path_extract_filename'
Jordan Rome [Thu, 25 May 2023 21:40:58 +0000 (14:40 -0700)] 
core: change 'basename' to 'path_extract_filename'

This is part of a cleanup effort in the TODO doc.

Tested locally: `meson compile -C build && meson test -C build`

12 months agocore/unit: update bidirectional dependency simultaneously 27746/head
Yu Watanabe [Tue, 23 May 2023 08:49:16 +0000 (17:49 +0900)] 
core/unit: update bidirectional dependency simultaneously

Previously, if unit_add_dependency_hashmap() failed, then a
one-directional unit dependency reference might be created, and
triggeres use-after-free. See issue #27742 for more details.

This makes unit dependency always bidirectional, and cleanly revert
partial update on failure.

Fixes #27742.

12 months agocore/unit: search shared namespace in transitive relation of JoinsNamespaceOf=
Yu Watanabe [Thu, 25 May 2023 09:08:37 +0000 (18:08 +0900)] 
core/unit: search shared namespace in transitive relation of JoinsNamespaceOf=

Previously, dependency chain of JoinsNamespaceOf= did not work, e.g.
- a.service has JoinsNamespaceOf=b.service
- b.service has JoinsNamespaceOf=c.service
if, first c.service, next a.service, finally b.service is started,
then a.service is not joined to the namespace of c.service. And, as
mentioned in the document, the namespace used by b.service is not
deterministic.

This makes when searching exsiting namespace to be joined, all units in
the transitive dependency of JoinsNamespaceOf= are checked.

12 months agologinctl: use FORMAT_TIMESTAMP_RELATIVE_MONOTONIC 27786/head
Mike Yuan [Thu, 25 May 2023 10:35:08 +0000 (18:35 +0800)] 
loginctl: use FORMAT_TIMESTAMP_RELATIVE_MONOTONIC

Follow-up for #27769

Addresses https://github.com/systemd/systemd/pull/27769#discussion_r1205215743

12 months agologinctl: realign bus_properties_map
Mike Yuan [Thu, 25 May 2023 10:25:15 +0000 (18:25 +0800)] 
loginctl: realign bus_properties_map

12 months agosystemctl: list-units: use TABLE_TIMESTAMP_RELATIVE_MONOTONIC
Mike Yuan [Thu, 25 May 2023 10:23:17 +0000 (18:23 +0800)] 
systemctl: list-units: use TABLE_TIMESTAMP_RELATIVE_MONOTONIC

12 months agotime-util,format-table: add relative_monotonic variant for timestamp
Mike Yuan [Thu, 25 May 2023 09:47:57 +0000 (17:47 +0800)] 
time-util,format-table: add relative_monotonic variant for timestamp

12 months agotmpfiles: Allow C escapes 27554/head
Will Fancher [Sat, 6 May 2023 20:11:58 +0000 (16:11 -0400)] 
tmpfiles: Allow C escapes

Fixes #26955

12 months agotmpfiles: Test C-style escape sequences
Will Fancher [Fri, 26 May 2023 04:02:35 +0000 (00:02 -0400)] 
tmpfiles: Test C-style escape sequences

12 months agotest: split the ASan wrapper into smaller blocks and tidy it up a bit
Frantisek Sumsal [Thu, 25 May 2023 13:31:48 +0000 (15:31 +0200)] 
test: split the ASan wrapper into smaller blocks and tidy it up a bit

No functional change (hopefully), just making it easier on the eyes.

12 months agocore/unit: make JoinsNamespaceOf= implies the inverse dependency
Yu Watanabe [Mon, 22 May 2023 21:36:44 +0000 (06:36 +0900)] 
core/unit: make JoinsNamespaceOf= implies the inverse dependency

Previously, even if a.service has JoinsNamespaceOf=b.service, the
inverse direction of reference was not introduced.
Hence, a.service is started earlier than b.service, the namespace will
not shared with b.service.
Also, even if a.service had the reference to b.service, b.service did not.
If b.service is freed earlier, then unit_clear_dependencies() does not clear
the reference from a to b, and will cause use-after-free on unit_free() for
a.service.

Let's make JoinsNamespaceOf=b.service in a.service implies the inverse
dependency, i.e. JoinsNamespaceOf=a.service for b.service. Then, we can safely
free b.service.

12 months agocore/unit: drop doubled empty line
Yu Watanabe [Mon, 22 May 2023 21:03:52 +0000 (06:03 +0900)] 
core/unit: drop doubled empty line

12 months agotest: add tests for JoinsNamespaceOf=
Yu Watanabe [Wed, 24 May 2023 21:48:16 +0000 (06:48 +0900)] 
test: add tests for JoinsNamespaceOf=

To illustrate the current behavior of the dependency.

12 months agounits: Shut down networkd and resolved on switch-root
Daan De Meyer [Thu, 25 May 2023 16:13:02 +0000 (18:13 +0200)] 
units: Shut down networkd and resolved on switch-root

Let's explicitly order these against initrd-switch-root.target, so
that they are properly shut down before we switch root. Otherwise,
there's a race condition where networkd might only shut down after
switching root and after we've already we've loaded the unit graph,
meaning it won't be restarted in the rootfs.

Fixes #27718

12 months agorules: add rule for accel devices
Stanislaw Gruszka [Thu, 25 May 2023 09:44:00 +0000 (11:44 +0200)] 
rules: add rule for accel devices

Accel (Compute Acceleration) are new devices for AI/ML computation:
https://docs.kernel.org/accel/introduction.html

They are part of DRM subsystem. Add them to 'render' group since
no other appropriate group in standard linux systems exist. This
can be changed when proper common user-space components will emerge,
and new group for acceleration devices access will be established.

Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
12 months agogpt-auto-generator: also honor systemd.swap=no
David Tardon [Thu, 25 May 2023 07:03:10 +0000 (09:03 +0200)] 
gpt-auto-generator: also honor systemd.swap=no

12 months agoman: add trailing =
David Tardon [Thu, 25 May 2023 06:44:21 +0000 (08:44 +0200)] 
man: add trailing =

12 months agomeson: Create credstore directories
Daan De Meyer [Wed, 24 May 2023 13:32:17 +0000 (15:32 +0200)] 
meson: Create credstore directories

Let's make the creds directories a bit more discoverable and make it
easier for users to use them. This also allows us to fix the
mode to 0700 for /etc instead of the usual 0755 which is what probably
would happen if users had to create this directory themselves.

12 months agoresolved-dns-rr: use automatic cleanup
David Tardon [Thu, 25 May 2023 08:30:06 +0000 (10:30 +0200)] 
resolved-dns-rr: use automatic cleanup

Follow-up for #27770.

12 months agoupdate TODO
Lennart Poettering [Thu, 25 May 2023 12:33:45 +0000 (14:33 +0200)] 
update TODO

12 months agoMerge pull request #27358 from bluca/pe_mule
Lennart Poettering [Thu, 25 May 2023 10:56:06 +0000 (03:56 -0700)] 
Merge pull request #27358 from bluca/pe_mule

stub: allow loading and verifying kernel command line addons

12 months agomount-util: Downgrade log message to trace
Daan De Meyer [Thu, 25 May 2023 07:48:24 +0000 (09:48 +0200)] 
mount-util: Downgrade log message to trace

This debug log message is extremely noisy so let's downgrade it to
trace.

12 months agomkosi: Bump default timeout to 180s
Daan De Meyer [Thu, 25 May 2023 08:00:59 +0000 (10:00 +0200)] 
mkosi: Bump default timeout to 180s

Hopefully fixes #27778 where waiting for the root device to appear
times out before systemd-repart has a chance to run and create it.

12 months agoMerge pull request #26959 from poettering/creds-mount-dep-fix
Lennart Poettering [Thu, 25 May 2023 09:06:47 +0000 (02:06 -0700)] 
Merge pull request #26959 from poettering/creds-mount-dep-fix

credential ramfs mount order fixes

12 months agoMerge pull request #27483 from yuwata/udev-id-path-usb-revision
Zbigniew Jędrzejewski-Szmek [Thu, 25 May 2023 08:24:45 +0000 (10:24 +0200)] 
Merge pull request #27483 from yuwata/udev-id-path-usb-revision

udev: include USB revision in ID_PATH

12 months agoMerge pull request #27770 from mrc0mmand/more-nallocfuzz-shenanigans
Yu Watanabe [Thu, 25 May 2023 08:15:37 +0000 (17:15 +0900)] 
Merge pull request #27770 from mrc0mmand/more-nallocfuzz-shenanigans

A couple of fixes for potential issues during OOM situations

12 months agoMerge pull request #27769 from YHNdnzj/loginctl-followup
Yu Watanabe [Wed, 24 May 2023 20:52:06 +0000 (05:52 +0900)] 
Merge pull request #27769 from YHNdnzj/loginctl-followup

loginctl: some follow-ups

12 months agoMerge pull request #27723 from YHNdnzj/service-restart-cleanup
Yu Watanabe [Wed, 24 May 2023 20:14:52 +0000 (05:14 +0900)] 
Merge pull request #27723 from YHNdnzj/service-restart-cleanup

core: get rid of unused Service.will_auto_restart logic

12 months agotree-wide: check memstream buffer after closing the handle 27770/head
Frantisek Sumsal [Wed, 24 May 2023 11:29:52 +0000 (13:29 +0200)] 
tree-wide: check memstream buffer after closing the handle

When closing the FILE handle attached to a memstream, it may attempt to
do a realloc() that may fail during OOM situations, in which case we are
left with the buffer pointer pointing to NULL and buffer size > 0. For
example:

```
    #include <errno.h>
    #include <stdio.h>
    #include <stdlib.h>

    void *realloc(void *ptr, size_t size) {
        return NULL;
    }

    int main(int argc, char *argv[])
    {
        FILE *f;
        char *buf;
        size_t sz = 0;

        f = open_memstream(&buf, &sz);
        if (!f)
            return -ENOMEM;

        fputs("Hello", f);

        fflush(f);
        printf("buf: 0x%lx, sz: %lu, errno: %d\n",
                    (unsigned long) buf, sz, errno);
        fclose(f);
        printf("buf: 0x%lx, sz: %lu, errno: %d\n",
                    (unsigned long) buf, sz, errno);

        return 0;
    }
```

```
$ gcc -o main main.c
$ ./main
buf: 0x74d4a0, sz: 5, errno: 0
buf: 0x0, sz: 5, errno: 0
```

This might do unexpected things if the underlying code expects a valid
pointer to the memstream buffer after closing the handle.

Found by Nallocfuzz.

12 months agosystem-update-generator: drop pointless goto
David Tardon [Tue, 16 May 2023 05:39:32 +0000 (07:39 +0200)] 
system-update-generator: drop pointless goto

12 months agoMerge pull request #27173 from yuwata/update-utmp
Yu Watanabe [Wed, 24 May 2023 19:00:58 +0000 (04:00 +0900)] 
Merge pull request #27173 from yuwata/update-utmp

update-utmp: do not fail when PID1 is reexecuting

12 months agoMerge pull request #27773 from dtardon/timestamp-cleanup
Yu Watanabe [Wed, 24 May 2023 18:27:15 +0000 (03:27 +0900)] 
Merge pull request #27773 from dtardon/timestamp-cleanup

Use *timestamp_is_set() at more places

12 months agoMerge pull request #27774 from dtardon/free-cleanup
Yu Watanabe [Wed, 24 May 2023 18:06:51 +0000 (03:06 +0900)] 
Merge pull request #27774 from dtardon/free-cleanup

Use free_and_*() more

12 months agologinctl: also show idle hint in session-status 27769/head
Mike Yuan [Tue, 23 May 2023 10:54:30 +0000 (18:54 +0800)] 
loginctl: also show idle hint in session-status

12 months agologinctl: list-users: use bus_map_all_properties
Mike Yuan [Tue, 23 May 2023 10:27:05 +0000 (18:27 +0800)] 
loginctl: list-users: use bus_map_all_properties

12 months agologinctl: list-sessions: fix timestamp for idle hint
Mike Yuan [Wed, 24 May 2023 17:20:45 +0000 (01:20 +0800)] 
loginctl: list-sessions: fix timestamp for idle hint

Follow-up for 556723e738b96a5c2b2d45a96b87b7b80e0c5664

TABLE_TIMESTAMP_RELATIVE takes a realtime timestamp.

12 months agologinctl: some modernizations
Mike Yuan [Wed, 24 May 2023 11:42:03 +0000 (19:42 +0800)] 
loginctl: some modernizations

12 months agoukify: fix handling signed kernel as file
Malte Poll [Wed, 24 May 2023 09:01:25 +0000 (11:01 +0200)] 
ukify: fix handling signed kernel as file

The .linux section would contain the path to the signed kernel (instead of the signed kernel itself), since the python type of the variable is used to determine how it is handled when adding the pe sections.

Co-authored-by: Otto Bittner <cobittner@posteo.net>
12 months agosd-journal: propagate errors from ordered_hashmap_*()
Frantisek Sumsal [Wed, 24 May 2023 12:17:25 +0000 (14:17 +0200)] 
sd-journal: propagate errors from ordered_hashmap_*()

Instead of masking them with -ENOMEM.

12 months agotimer: use dual_timestamp_is_set() at one more place 27773/head
David Tardon [Wed, 24 May 2023 13:29:30 +0000 (15:29 +0200)] 
timer: use dual_timestamp_is_set() at one more place

12 months agotree-wide: use timestamp_is_set() at more places
David Tardon [Wed, 24 May 2023 13:26:32 +0000 (15:26 +0200)] 
tree-wide: use timestamp_is_set() at more places

12 months agoTODO: remove fixed item 27358/head
Luca Boccassi [Wed, 24 May 2023 10:18:18 +0000 (11:18 +0100)] 
TODO: remove fixed item

12 months agostub: allow loading and verifying cmdline addons
Luca Boccassi [Thu, 11 May 2023 23:55:58 +0000 (00:55 +0100)] 
stub: allow loading and verifying cmdline addons

Files placed in /EFI/Linux/UKI.efi.extra.d/ and /loader/addons/ are
opened and verified using the LoadImage protocol, and will thus get
verified via shim/firmware.
If they are valid signed PE files, the .cmdline section will be
extracted and appended. If there are multiple addons in each directory,
they will be parsed in alphanumerical order.

Optionally the .uname sections are also matched if present, so
that they can be used to filter out addons as well if needed, and only
addons that correspond exactly to the UKI being loaded are used.
It is recommended to also always add a .sbat section to addons, so
that they can be mass-revoked with just a policy update.

The files must have a .addon.efi suffix.

Files in the per-UKI directory are parsed, sorted, measured and
appended first. Then, files in the generic directory are processed.

12 months agocore: drop UnitNotifyFlags 27723/head
Mike Yuan [Mon, 22 May 2023 00:35:53 +0000 (08:35 +0800)] 
core: drop UnitNotifyFlags

This essentially reverts 2ad2e41a72ec19159c0746a78e15ff880fe32a63.

No longer needed after dropping UNIT_NOTIFY_WILL_AUTO_RESTART.

12 months agocore: get rid of unused Service.will_auto_restart logic
Mike Yuan [Mon, 22 May 2023 00:30:30 +0000 (08:30 +0800)] 
core: get rid of unused Service.will_auto_restart logic

The announced new behavior for OnFailure= never worked properly,
and we've fixed the document instead in #27675.
Therefore, let's get rid of the unused logic completely. More at #27594.

The to-be-added RestartMode= option should cover the use case hopefully.

Closes #27594

12 months agojournal-upload: use mfree() 27774/head
David Tardon [Wed, 24 May 2023 12:27:27 +0000 (14:27 +0200)] 
journal-upload: use mfree()

12 months agotree-wide: use free_and_str*dup() more
David Tardon [Wed, 24 May 2023 12:47:36 +0000 (14:47 +0200)] 
tree-wide: use free_and_str*dup() more