Commit Graph
61112 Commits
Author SHA1 Message Date
Jan Janssen 927ebebe58 stub: Fix cmdline handling
This fixes some bugs that could lead to garbage getting appended to the
command line passed to the kernel:
 1. The .cmdline section is not guaranteed to be NUL-terminated, but it
    was used as if it was.
 2. The conversion of the command line to ASCII that was passed to the
    stub ate the NUL at the end.
 3. LoadOptions is not guaranteed to be a NUL-terminated EFI string (it
    really should be and generally always is, though).

This also fixes the inconsistent mangling of the command line. If the
.cmdline section was used ASCII controls chars (new lines in particular)
would not be converted to spaces.

As part of this commit, we optimize conversion for the generic code
instead of the (deprecated) EFI handover protocol. Previously we would
convert to ASCII/UTF-8 and then back to EFI string for the (now) default
generic code path. Instead we now convert to EFI string and mangle that
back to ASCII in the EFI handover protocol path.
2022-11-22 17:42:38 +01:00
Jan Janssen 7444e10611 boot: Use xstr8_to_16 for path conversion 2022-11-22 16:50:42 +01:00
Jan Janssen aee515bbb5 boot: Use xstr8_to_16 2022-11-22 16:03:03 +01:00
Jan Janssen 8ad7deffa9 boot: Add xstrn8_to_16 2022-11-22 15:56:48 +01:00
Luca Boccassi d4b3ae65f3 Merge pull request #25477 from yuwata/network-wifi-reconfigure-on-connect
network: wifi: try to reconfigure when connected
2022-11-22 13:37:15 +01:00
Zbigniew Jędrzejewski-Szmek 70b9ea26b6 man/journalctl: mention systemd-cat, make the description more direct
We said "query the journal". This is true but also very generic. Let's say
"print log entries from the journal" instead, so that users who are looking for
"logging" are more likely to figure out that the journalctl is the tool for
them.

Also, mention systemd-journal-remote.service which can write the journal too.
And give some hints how to figure out how to write *to* the journal.
2022-11-22 13:31:04 +01:00
Anita Zhang 6ee27eb3ca man: update docs for MemoryZSwapMax= 2022-11-22 11:01:50 +01:00
Benjamin Fogle f4a49d1c58 resolved: Fix OpenSSL error messages 2022-11-22 16:04:45 +09:00
Yu Watanabe 8a4ad01a72 network: wifi: try to reconfigure when connected
Sometimes, RTM_NEWLINK message with carrier is received earlier than
NL80211_CMD_CONNECT. To make SSID= or other WiFi related settings in
[Match] section work, let's try to reconfigure the interface.

Fixes a bug introduced by 96f5f9ef9a.

Fixes #25384.
2022-11-22 14:44:26 +09:00
Yu Watanabe 4642371d07 network: drop unnecessary prototype
Follow-up for a39a9ac806.
2022-11-22 14:32:19 +09:00
Yu Watanabe 6ad17c31fb Merge pull request #25470 from keszybz/strv-extendf-format
Improve check for strv_extendf() format string
2022-11-22 12:27:37 +09:00
наб 848517ddd4 systemctl: edit: write override files as text files
Instead of stripping the newline off the final would-be line;
continue to reduce an empty-line-only file to an empty file, though

Closes #25303
2022-11-22 01:45:50 +01:00
Zbigniew Jędrzejewski-Szmek 5a65d2e535 bootctl: use grey-and-slash prefix for source in list too
Follow-up for 7851732262. The source
field also shows a path relative to $BOOT, so it should be displayed
in the same fashion.
2022-11-22 01:40:20 +01:00
Lennart Poettering e4cb147a2e udev: make sure auto-root logic also works in UKIs booted from XBOOTLDR
If no root= switch is specified on the kernel command line we'll use the
root disk on which the partition the LoaderDevicePartUUID efi var is
located – as long as that partition is an ESP. Let's slightly liberalize
that and also allow it if that partition is an XBOOTLDR partition. This
ensures that UKIs spawned directly from XBOOTLDR work the same as those
from the ESP.

(Note that this makes no difference if sd-boot is in the mix, as in that
case LoaderDevicePartUUID is always set to the ESP, as that's where
sd-boot is located, and sd-boot will set the var first, sd-stub will
only set it later if it#s not set yet.)
2022-11-22 01:32:51 +01:00
Lennart Poettering 7d1e61cab6 tree-wide: make constant ratelimit compound actually const
The compiler should recognize that these are constant expressions, but
let's better make this explicit, so that the linker can safely share the
initializations all over the place.
2022-11-22 01:30:55 +01:00
Jason A. Donenfeld 47b3e96647 boot: remove random-seed-mode
Now that the random seed is used on virtualized systems, there's no
point in having a random-seed-mode toggle switch. Let's just always
require it now, with the existing logic already being there to allow not
having it if EFI itself has an RNG. In other words, the logic for this
can now be automatic.
2022-11-22 01:30:03 +01:00
Luca Boccassi a0c544ee09 Merge pull request #25379 from keszybz/update-doc-links
Update doc links
2022-11-22 01:07:13 +01:00
Zbigniew Jędrzejewski-Szmek 400102ec91 basic/strv: check printf arguments to strv_extendf()
The second argument to _printf_() specifies where the arguments start. We need to
use 0 in two cases: when the args in a va_list and can't be checked, and with journald
logging functions which accept multiple format strings with multiple argument sets,
which the _printf_ checker does not understand. But strv_extendf() can be checked.
2022-11-21 20:08:50 +01:00
Zbigniew Jędrzejewski-Szmek 6457ce15be manager: fix format strings for trigger metadata
Fixup for c8bc7519c8.
2022-11-21 20:08:50 +01:00
Yu Watanabe 69b31b29a0 Merge pull request #25395 from poettering/tpm2-dlsym-assert
dlfcn-util: add static asserts ensuring our sym_xyz() func ptrs match …
2022-11-22 03:36:03 +09:00
Lennart Poettering 0d9e6d76be mkosi: pull in libbpf1 instead of legacy libbpf0 on debian 2022-11-21 16:13:29 +01:00
Lennart Poettering 7736a71fd2 dlfcn-util: add static asserts ensuring our sym_xyz() func ptrs match the types from the official headers
Make sure that the sym_xyz function pointers have the types that the
functions we'll assign them have.

And of course, this found a number of incompatibilities right-away, in
particular in the bpf hookup.

(Doing this will trigger deprecation warnings from libbpf. I simply
turned them off locally now, since we are well aware of what we are
doing in that regard.)

There's one return type fix (bool → int), that actually matters I think,
as it might have created an incompatibility on some archs.
2022-11-21 16:13:17 +01:00
Lennart Poettering 28795f2c13 update TODO 2022-11-21 15:14:22 +01:00
Jason A. Donenfeld a4eea6038c bootctl: install system token on virtualized systems
Removing the virtualization check might not be the worst thing in the
world, and would potentially get many, many more systems properly seeded
rather than not seeded. There are a few reasons to consider this:

- In most QEMU setups and most guides on how to setup QEMU, a separate
  pflash file is used for nvram variables, and this generally isn't
  copied around.

- We're now hashing in a timestamp, which should provide some level of
  differentiation, given that EFI_TIME has a nanoseconds field.

- The kernel itself will additionally hash in: a high resolution time
  stamp, a cycle counter, RDRAND output, the VMGENID uniquely
  identifying the virtual machine, any other seeds from the hypervisor
  (like from FDT or setup_data).

- During early boot, the RNG is reseeded quite frequently to account for
  the importance of early differentiation.

So maybe the mitigating factors make the actual feared problem
significantly less likely and therefore the pros of having file-based
seeding might outweigh the cons of weird misconfigured setups having a
hypothetical problem on first boot.
2022-11-21 15:13:26 +01:00
Daan De Meyer 261b14be76 Merge pull request #25461 from DaanDeMeyer/repart-followups
repart followups
2022-11-21 14:02:25 +01:00
Zbigniew Jędrzejewski-Szmek 2bd051a06d docs/BOOT_LOADER_INTERFACE: reword sentence to apply to both entry types 2022-11-21 12:26:35 +01:00
Zbigniew Jędrzejewski-Szmek db81144428 tree-wide: BLS and DPS are now on uapi-group website 2022-11-21 12:26:35 +01:00
Daan De Meyer 6b1ea55e0b repart: Rework PartitionTarget initialization 2022-11-21 11:47:13 +01:00
Daan De Meyer 488bb758c0 repart: Use fd based operations in partition_populate_directory() 2022-11-21 11:47:13 +01:00
BerndAdameit 082ac7bb12 man/sd_bus_default: Refer to man-pages project (man7.org) for ssh(1) 2022-11-21 11:35:33 +01:00
Lennart Poettering b22afd2844 Merge pull request #25409 from medhefgo/boot-fixes
boot: Several fixes
2022-11-21 11:34:50 +01:00
Daan De Meyer 48b1e18aae repart: Remove redundant parentheses in partition_populate_directory() 2022-11-21 10:53:23 +01:00
Daan De Meyer a9abef7f67 mkfs-util: Use FORK_CLOSE_ALL_FDS 2022-11-21 10:51:15 +01:00
Daan De Meyer 92b11378ff mkfs-util: Prefer fd based stat() where possible 2022-11-21 10:49:37 +01:00
Daan De Meyer 29ec4bce0e mkfs-util: Use GID_FMT 2022-11-21 10:46:59 +01:00
Daan De Meyer 922576e452 repart: Use ASSERT_PTR() in partition_encrypt() 2022-11-21 10:45:26 +01:00
Daan De Meyer 983154f518 repart: Use ftruncate() instead of posix_allocate() 2022-11-21 10:44:38 +01:00
Daan De Meyer 766f52f25c repart: Fix parse_filter_partitions() log messages 2022-11-21 10:36:37 +01:00
Daan De Meyer 53538e33e9 repart: Fix FilterPartitionsType enum name 2022-11-21 10:35:18 +01:00
Daan De Meyer 5f59807d2d repart: Rework unused partition number algorithm 2022-11-21 10:34:28 +01:00
Daan De Meyer c1979cd881 repart: Use IN_SET() in one more place 2022-11-21 10:28:36 +01:00
Richard E. van der Luit 214ba5cadf po: Translated using Weblate (Dutch)
Currently translated at 100.0% (193 of 193 strings)

Co-authored-by: Richard E. van der Luit <fedoraproject@veneax.nl>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/nl/
Translation: systemd/main
2022-11-21 00:43:55 +09:00
Jan Janssen 967a868563 boot: Replace firmware security hooks directly
For some firmware, replacing their own security arch instance with our
override using ReinstallProtocolInterface() is not enough as they will
not use it. This commit goes back to how this was done before by
directly modifying the security protocols.

Fixes: #25336
2022-11-19 16:39:04 +01:00
Jan Janssen 5489c13bae boot: Rework security arch override
This simplifies the caller interface for security arch overrides by only
having to pass a validator and an optional context.
2022-11-19 16:37:27 +01:00
Jan Janssen 679007044f boot: Manually convert filepaths if needed
The conversion of a filepath device path to text is needed for the stub
loader to find credential files.
2022-11-19 16:36:02 +01:00
Jan Janssen af7ef648cd boot: Do not require a loaded image path
If the device path to text protocol is not available (looking angrily at
Apple) we would fail to boot because we cannot get the loaded image
path. As this is only used for cosmetic purposes, we can just silently
continue.

Fixes: #25363
2022-11-19 16:36:02 +01:00
Jan Janssen b7b327f856 boot: Fix memory leak 2022-11-19 16:36:02 +01:00
lichao eb263aabb0 remove obsolete translate in zh_CN.po 2022-11-19 23:51:39 +09:00
Yu Watanabe da2e6df00a Merge pull request #25438 from poettering/localhost-ifindex-tweak
resolved: fix ifindex for contacting per-interface DNS server if it is 127.0.0.1
2022-11-19 15:36:12 +09:00
Yu Watanabe 26627c088b Merge pull request #25423 from yuwata/network-tc-cake-rtt-and-ack-filter
network: tc-cake: support controlling RTT and ACK filter
2022-11-19 15:35:49 +09:00