summaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* sd-event: reenable epoll_pwait2()Lennart Poettering2022-11-234-113/+9
| | | | | | | | | | | | | | | | This reenables epoll_pwait2() use, i.e. undoes the effect of 39f756d3ae4765b8bf017567a12b8a4b358eaaf5. Instead of just reverting that, this PR will change things so that we strictly rely on glibc's new epoll_pwait2() wrapper (which was added earlier this year), and drop our own manual fallback syscall wrapper. That should nicely side-step any issues with correct syscall wrapping definitions (which on some arch seem not to be easy, given the sigset_t size final argument), by making this a glibc problem, not ours. Given that the only benefit this delivers are time-outs more granular than msec, it shouldn't really matter that we'll miss out on support for this on systems with older glibcs.
* Merge pull request #25485 from DaanDeMeyer/gpt-fixDaan De Meyer2022-11-223-9/+6
|\ | | | | gpt: Specify designator array sizes explicitly
| * gpt: Drop PARTITION_LINUX_GENERIC and PARTITION_USER_HOMEDaan De Meyer2022-11-223-7/+4
| | | | | | | | | | | | | | | | These don't have an inherent purpose, and aren't used throughout the codebase, so let's simplify things and remove these. See https://github.com/systemd/systemd/pull/24803#discussion_r1028190421 for more information.
| * gpt: Specify designator array sizes explicitlyDaan De Meyer2022-11-221-2/+2
| | | | | | | | | | Avoid users accidentally accessing uninitialized memory by always making sure the array size covers all possible enum values.
* | Merge pull request #25477 from yuwata/network-wifi-reconfigure-on-connectLuca Boccassi2022-11-223-2/+14
|\ \ | |/ |/| network: wifi: try to reconfigure when connected
| * network: wifi: try to reconfigure when connectedYu Watanabe2022-11-223-1/+14
| | | | | | | | | | | | | | | | | | | | 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 96f5f9ef9a1ba5146d3357c1548fb675d3bd5b68. Fixes #25384.
| * network: drop unnecessary prototypeYu Watanabe2022-11-221-1/+0
| | | | | | | | Follow-up for a39a9ac8065c29330207838b70fe388bde2bc254.
* | resolved: Fix OpenSSL error messagesBenjamin Fogle2022-11-221-39/+26
| |
* | Merge pull request #25470 from keszybz/strv-extendf-formatYu Watanabe2022-11-222-5/+5
|\ \ | |/ |/| Improve check for strv_extendf() format string
| * basic/strv: check printf arguments to strv_extendf()Zbigniew Jędrzejewski-Szmek2022-11-211-1/+1
| | | | | | | | | | | | | | 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.
| * manager: fix format strings for trigger metadataZbigniew Jędrzejewski-Szmek2022-11-211-4/+4
| | | | | | | | Fixup for c8bc7519c888a99134f88f8c82353246d3c0cc5d.
* | systemctl: edit: write override files as text filesнаб2022-11-221-0/+12
| | | | | | | | | | | | | | 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
* | bootctl: use grey-and-slash prefix for source in list tooZbigniew Jędrzejewski-Szmek2022-11-221-3/+10
| | | | | | | | | | | | Follow-up for 7851732262ec94f50598c4a289589a6ddb97ebfd. The source field also shows a path relative to $BOOT, so it should be displayed in the same fashion.
* | udev: make sure auto-root logic also works in UKIs booted from XBOOTLDRLennart Poettering2022-11-221-14/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.)
* | tree-wide: make constant ratelimit compound actually constLennart Poettering2022-11-2210-10/+10
| | | | | | | | | | | | 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.
* | boot: remove random-seed-modeJason A. Donenfeld2022-11-225-50/+5
| | | | | | | | | | | | | | | | 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.
* | Merge pull request #25379 from keszybz/update-doc-linksLuca Boccassi2022-11-222-2/+2
|\ \ | | | | | | Update doc links
| * | tree-wide: BLS and DPS are now on uapi-group websiteZbigniew Jędrzejewski-Szmek2022-11-212-2/+2
| | |
* | | dlfcn-util: add static asserts ensuring our sym_xyz() func ptrs match the ↵Lennart Poettering2022-11-217-12/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | bootctl: install system token on virtualized systemsJason A. Donenfeld2022-11-211-20/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #25461 from DaanDeMeyer/repart-followupsDaan De Meyer2022-11-212-42/+34
|\ \ \ | | | | | | | | repart followups
| * | | repart: Rework PartitionTarget initializationDaan De Meyer2022-11-211-13/+9
| | | |
| * | | repart: Use fd based operations in partition_populate_directory()Daan De Meyer2022-11-211-4/+5
| | | |
| * | | repart: Remove redundant parentheses in partition_populate_directory()Daan De Meyer2022-11-211-1/+1
| | | |
| * | | mkfs-util: Use FORK_CLOSE_ALL_FDSDaan De Meyer2022-11-211-2/+2
| | | |
| * | | mkfs-util: Prefer fd based stat() where possibleDaan De Meyer2022-11-211-1/+1
| | | |
| * | | mkfs-util: Use GID_FMTDaan De Meyer2022-11-211-2/+2
| | | |
| * | | repart: Use ASSERT_PTR() in partition_encrypt()Daan De Meyer2022-11-211-2/+2
| | | |
| * | | repart: Use ftruncate() instead of posix_allocate()Daan De Meyer2022-11-211-1/+1
| | | |
| * | | repart: Fix parse_filter_partitions() log messagesDaan De Meyer2022-11-211-2/+2
| | | |
| * | | repart: Fix FilterPartitionsType enum nameDaan De Meyer2022-11-211-1/+1
| | | |
| * | | repart: Rework unused partition number algorithmDaan De Meyer2022-11-211-10/+7
| | | |
| * | | repart: Use IN_SET() in one more placeDaan De Meyer2022-11-211-3/+1
| | |/ | |/|
* | | boot: Replace firmware security hooks directlyJan Janssen2022-11-191-79/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | boot: Rework security arch overrideJan Janssen2022-11-194-152/+146
| | | | | | | | | | | | | | | This simplifies the caller interface for security arch overrides by only having to pass a validator and an optional context.
* | | boot: Manually convert filepaths if neededJan Janssen2022-11-191-4/+36
| | | | | | | | | | | | | | | The conversion of a filepath device path to text is needed for the stub loader to find credential files.
* | | boot: Do not require a loaded image pathJan Janssen2022-11-191-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | boot: Fix memory leakJan Janssen2022-11-191-1/+1
|/ /
* | Merge pull request #25438 from poettering/localhost-ifindex-tweakYu Watanabe2022-11-192-1/+6
|\ \ | | | | | | resolved: fix ifindex for contacting per-interface DNS server if it is 127.0.0.1
| * | resolved: when configuring 127.0.0.1 as per-interface DNS server, contact it ↵Lennart Poettering2022-11-181-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | via "lo" always ussually if you specify a DNS server on some interface then we'll use that interface to talk to it. Let's override this for localhost addresses, as they only really make sense on "lo". Fixes: #25397
| * | resolved: use right conditionalization when setting unicast ifindex on UDP ↵Lennart Poettering2022-11-181-1/+1
| | | | | | | | | | | | sockets
* | | Merge pull request #25423 from yuwata/network-tc-cake-rtt-and-ack-filterYu Watanabe2022-11-193-1/+145
|\ \ \ | | | | | | | | network: tc-cake: support controlling RTT and ACK filter
| * | | network: tc-cake: add support to specify ACK filterYu Watanabe2022-11-183-0/+78
| | | |
| * | | network: tc-cake: add support to specify RTTYu Watanabe2022-11-173-1/+67
| | | |
* | | | dbus-manager: add comments about booleans in function callsMike Yuan2022-11-191-14/+14
| | | | | | | | | | | | | | | | | | | | Update to match the new coding style See also: https://github.com/systemd/systemd/pull/25437#discussion_r1026934242
* | | | bootctl: rework how we handle referenced but absent EFI boot entriesLennart Poettering2022-11-181-1/+5
| |/ / |/| | | | | | | | | | | | | | | | | | | | Follow-up for #25368. Let's consider ENOENT an expected error, and just debug log about it (though, let's suffix it with `, ignoring.`). All other errors will log loudly, as they are unexpected errors.
* | | nspawn: allow sched_rr_get_interval_time64 through seccomp filterSam James2022-11-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We only allow a selected subset of syscalls from nspawn containers and don't list any time64 variants (needed for 32-bit arches when built using TIME_BITS=64, which is relatively new). We allow sched_rr_get_interval which cpython's test suite makes use of, but we don't allow sched_rr_get_interval_time64. The test failures when run in an arm32 nspawn container on an arm64 host were as follows: ``` ====================================================================== ERROR: test_sched_rr_get_interval (test.test_posix.PosixTester.test_sched_rr_get_interval) ---------------------------------------------------------------------- Traceback (most recent call last): File "/var/tmp/portage/dev-lang/python-3.11.0_p1/work/Python-3.11.0/Lib/test/test_posix.py", line 1180, in test_sched_rr_get_interval interval = posix.sched_rr_get_interval(0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PermissionError: [Errno 1] Operation not permitted ``` Then strace showed: ``` sched_rr_get_interval_time64(0, 0xffbbd4a0) = -1 EPERM (Operation not permitted) ``` This appears to be the only time64 syscall that isn't already included one of the sets listed in nspawn-seccomp.c that has a non-time64 variant. Checked over each of the time64 syscalls known to systemd and verified that none of the others had a non-time64-variant whitelisted in nspawn other than sched_rr_get_interval. Bug: https://bugs.gentoo.org/880131
* | | sysupdate: Support volatile-root for finding the root partitionreuben olinsky2022-11-181-4/+18
| | | | | | | | | | | | | | | | | | | | | The existing logic can't find the root device in scenarios where the root has been replaced with an overlay. We support looking at "/run/systemd/volatile-root" to find the original root, similar to what systemd-repart and gpt-auto-generator do.
* | | Merge pull request #25410 from DaanDeMeyer/mkfs-xfs-fixesLennart Poettering2022-11-187-45/+85
|\ \ \ | | | | | | | | Followups for #25400
| * | | repart: Write temporary LUKS header to /var/tmp instead of /tmpDaan De Meyer2022-11-171-1/+6
| | | | | | | | | | | | | | | | This is a relatively large file so let's not create it in memory.