Commit Graph
59057 Commits
Author SHA1 Message Date
Yu Watanabe 4473cd7f61 dhcp: fix potential buffer overflow
Fixes a bug introduced by 324f818781.

This also renames several macros for DHCP packet size.
2022-08-06 13:06:32 +09:00
Yu Watanabe 073a1daaba dhcp: make dhcp_network_bind_raw_socket() take struct hw_addr_data 2022-08-06 04:57:27 +09:00
Yu Watanabe 8cad358e4a dhcp: make dhcp_identifier_set_duid() take struct hw_addr_data 2022-08-06 04:53:36 +09:00
Yu Watanabe 3b75435db6 dhcp: make dhcp_identifier_set_iaid() take struct hw_addr_data 2022-08-06 04:53:36 +09:00
Yu Watanabe e0ead13088 sd-dhcp6-client: use hw_addr_set() 2022-08-06 04:53:36 +09:00
Yu Watanabe 7e5c25b244 sd-dhcp-client: use struct hw_addr_data to store MAC and broadcast address 2022-08-06 04:53:36 +09:00
Yu Watanabe 069f5df051 ether-addr-util: introduce hw_addr_set() helper function 2022-08-06 04:53:36 +09:00
Yu Watanabe 7fddb9704f dhcp4: stop client before updating MAC address 2022-08-06 04:53:36 +09:00
Yu Watanabe ebf404a4d0 sd-netlink: rename NLType and friends
In sd-netlink, we use 'type' for naming many variables with different type,
and worst of all, function like `type_get_type()` exists. That makes the
code hard to understood.

Let's rename
- NLType -> NLAPolicy
- NLTypeSystem -> NLAPolicySet
- NLTypeSystemUnion -> NLAPolicySetUnion
- type_get_type() -> policy_get_type()
- type_get_type_system() -> policy_get_policy_set(), and so on.

This also changes the type of attribute taken by e.g.
`sd_netlink_message_append_string()` from `unsigned short` -> `uint16_t`
to make the variable size clearer.
2022-08-06 03:53:51 +09:00
Yu Watanabe 1ab7e2b587 Merge pull request #23340 from yuwata/network-check-sr-iov-pf-state
network: check SR-IOV PF state
2022-08-06 03:18:30 +09:00
Yu Watanabe c75efa3f7e Merge pull request #23508 from yuwata/core-device
core/device: fix devlink handling
2022-08-06 03:18:14 +09:00
Richard Phibel b6d1e2b441 mkosi: Add package libfdisk to Ubuntu dependencies (#24211)
* mkosi: Add package libfdisk to Ubuntu dependencies

The libfdisk package is needed by systemd-repart.
2022-08-05 18:40:17 +01:00
David Rheinsberg 347f48246f bus: use inline trace argument for ANONYMOUS auth
Rather than using a separate DATA round to transmit the trace-string of
the ANONYMOUS authentication scheme, transmit it inline as argument.
This requires a refactor of the client-side SASL parser, as we now have
a different set of replies depending on the mode used.

This fixes an issue where libdbus-1 does not query for trace-strings if
not transmit inline as AUTH-ANONYMOUS argument. It is unclear from the
wording of the spec whether this is a violation by libdbus-1. However,
we can work around it by simply changing our mode of transmittal.
2022-08-05 16:39:55 +01:00
Luca Boccassi ecb991621a Merge pull request #24216 from poettering/ispowerof2
add ISPOWEROF2() macro and use it
2022-08-05 16:38:58 +01:00
Lennart Poettering 7496235134 man,journalctl: introduce man/--help sections
So far the --help text and the man page of journactl were mostly a large
pile of options shown next to each other. Let's add some basic
structure, and group switches by sections such as "Filtering Options",
"Output Options" and so on.

Do this the same way in the --help text and in the man page.

Since this moves everything around anyway, I also opted to rebreak all
paragraphs in the man page. This makes the patch larger than necessary,
but given that this whole patch doesn't really change contents besides
section titles I figured this would be OK.
2022-08-05 16:13:07 +01:00
Yu Watanabe 1f6d268b4b core/device: add comments for boolean arguments 2022-08-05 22:16:58 +09:00
Yu Watanabe 4a1a1caf21 core/device: always accept syspath change
When multiple devices have the same devlink, then
adding/updating/removing one of the device may cause syspath change.

Fixes the following issue in
https://github.com/systemd/systemd/issues/23208#issue-1217909746
> the above shows an inconsistency between udev's and systemd's handling
> of the two different devices having the same alias. While udev replaces
> the by-uuid symlink which now points to sdh1 rather than sdd1, systemd
> keeps the previous mapping to sdd1 and emits a warning. This is not the
> problem cause but worth mentioning.
2022-08-05 22:15:02 +09:00
Yu Watanabe dce2d35ce5 core/device: move several functions
No functional change. A preparation for later commits.
2022-08-05 22:13:47 +09:00
Yu Watanabe 367a2597c3 core/device: store the original path
The unit name may be hashed. Hence, we cannot obtain the original path
from the unit name.

The path will be used in the later commits.
2022-08-05 22:13:47 +09:00
Franck Bui 7870de03c5 core: replace m->honor_device_enumeration with MANAGER_IS_SWITCHING_ROOT() 2022-08-05 22:13:47 +09:00
Franck Bui d35fe8c0af core: introduce MANAGER_IS_SWITCHING_ROOT() helper function
Will be used by the following commit.
2022-08-05 22:13:43 +09:00
Yu Watanabe e33232d405 network: also check SR-IOV PF port and other VF ports before configuring
When a PF port becomes down (this can happens e.g. the PF port is joining
a bond interface), some drivers make its VF ports also become down, and
may cause failures in configuring VF ports.

Similary, when a VF port become down, some drivers make its PF port and
other VF ports down.

Let's configure SR-IOV ports (both PF and VFs) after all link-layer
settings of all ports being applied.

Fixes #23315.
2022-08-05 21:49:27 +09:00
Yu Watanabe b0ff6dea38 network: manage SR-IOV PF and VF ports 2022-08-05 21:49:27 +09:00
Yu Watanabe 00117f8811 network: split out link_is_ready_to_create_stacked_netdev()
Preparation for later commits.
2022-08-05 21:49:27 +09:00
Yu Watanabe 4b482e8bf4 network: check link state with link_is_ready_to_configure() before configuring DHCP client or friends
Otherwise, DHCP client or friends may started before link-layer properties,
e.g. MAC address, being configured or the link being activated.
2022-08-05 21:49:27 +09:00
Yu Watanabe 2fd3908b5c network: drop carrier check for unmanaged interface from link_is_ready_to_configure()
Preparation for later commits. No functional change.
2022-08-05 21:49:27 +09:00
Yu Watanabe d8d4db58ca network: refuse to configure anything on pending or initialized state 2022-08-05 21:49:27 +09:00
Yu Watanabe 53c2e3b9ba network: unset master ifindex only when necessary 2022-08-05 21:49:27 +09:00
Yu Watanabe 4d79af57ca network: wiphy: use ERRNO_IS_DEVICE_ABSENT() 2022-08-05 21:49:27 +09:00
Yu Watanabe 59611eb9b8 udev: ignore empty SR-IOV VF suffix
It should not happen. Just for safety.
2022-08-05 21:49:27 +09:00
Yu Watanabe 68a52f5973 sd-device: introduce sd_device_new_child() 2022-08-05 21:49:23 +09:00
Frantisek Sumsal 578355684d ci: set a timeout for each mkosi stage
Work around #24202 so we don't wait ~6 hours for a stuck QEMU job.
2022-08-05 12:12:13 +00:00
Lennart Poettering 983ce0b517 macro: use ISPOWEROF2() at various places 2022-08-05 13:37:29 +02:00
Lennart Poettering c51e4c796d macro: add macro for checking if integer is power of 2 2022-08-05 13:34:11 +02:00
Yu Watanabe 14e7bc2e77 Merge pull request #23367 from yuwata/core-mount
core/mount: fix dependency issues
2022-08-05 13:48:23 +09:00
Yu Watanabe 49ad287292 test-network: support the case that l2tp module is not supported
Hopefully fixes the issue reported at
https://github.com/systemd/systemd-centos-ci/pull/517#issuecomment-1205399798.
2022-08-04 18:39:04 +00:00
Yu Watanabe 413f20b4ac test: add test case for mount unit dependencies 2022-08-05 01:35:38 +09:00
Yu Watanabe 49267b1b14 core/mount: make device deps from /proc/self/mountinfo and .mount unit file exclusive
Before this commit, when a .mount unit file is loaded, the device
dependencies from the unit file are automatically added. If a device
that is different from which specified in .mount unit file is mounted
on the path, then the device dependencies about the device are also added.
Hence, the unit has device dependencies about two (or more) different
devices. Hence, if one of the devices are unplugged, even if another one
is mounted on the path, then the path is unmounted.

This commit makes device dependencies from two different sources
exclusive, and always regenerate the dependencies when one of the
information is updated.

Fixes #19983 and #23552.
2022-08-05 01:35:38 +09:00
Yu Watanabe 0fe06168b3 core/mount: also remove default deps from /proc/self/mountinfo when it is updated
The dependencies tagged with UNIT_DEPENDENCY_MOUNTINFO_DEFAULT depend
on both /proc/self/mountinfo and corresponding .mount unit file.
Hence, if some information from mountinfo is updated, e.g. device mounted
on the path, we need to update the dependencies.
2022-08-05 01:35:38 +09:00
Yu Watanabe b9e6d23dfc core/mount: set Mount.from_proc_self_mountinfo flag before adding default dependencies
When the function mount_setup_new_unit() is called, the corresponding
.mount unit file is not loaded. Hence, Mount.from_fragment is false.
To add default dependencies to e.g. .device units, it is necessary that
the Mount.from_proc_self_mountinfo flag is set. However, the flag was
not set even the unit has information from /proc/self/mountinfo.

Partially fixes #19983.
2022-08-05 01:35:38 +09:00
Yu Watanabe 03e52e8cc3 core: unit_name_from_path() does not return -ENAMETOOLONG anymore
Follow-ups for a7fb1f2eae and
1d0727e76f.
2022-08-05 01:34:55 +09:00
Yu Watanabe 6688b72d32 core/mount: use set_put_strdup_full() 2022-08-05 01:32:28 +09:00
Lennart Poettering f17061ef95 Merge pull request #24189 from medhefgo/boot-secure
boot: Follow-up fixes for #20255
2022-08-04 17:27:20 +02:00
Ludwig Nussel 5243331fb8 pull: fix PullFlags numbering 2022-08-04 17:27:03 +02:00
Richard Phibel d0d6ac67b5 analyze: Migrate to bus-locator.h
Migrated analyze-security to use new API bus_call_method instead of sd_bus_call_method.
2022-08-04 17:26:49 +02:00
Michal Sekletar 03860190fe scope: allow unprivileged delegation on scopes
Previously it was possible to set delegate property for scope, but you
were not able to allow unprivileged process to manage the scope's cgroup
hierarchy. This is useful when launching manager process that  will run
unprivileged but is supposed to manage its own (scope) sub-hierarchy.

Fixes #21683
2022-08-04 17:01:13 +02:00
Frantisek Sumsal a552061ebb test: skip the relevant test case if systemd-measure is not present
systemd-measure is not built without gnu-efi, which is the case, for
example, on ppc64le. Let's skip the relevant test case in this case
instead of failing.

```
The Meson build system
Version: 0.58.2
...
Host machine cpu family: ppc64
Host machine cpu: ppc64le
...
Message: Skipping systemd-measure.1 because HAVE_GNU_EFI is false
...
[  115.711775] testsuite-70.sh[745]: + cat
[  115.741996] testsuite-70.sh[832]: + /usr/lib/systemd/systemd-measure calculate --linux=/tmp/tpmdata1 --initrd=/tmp/tpmdata2
[  115.754015] testsuite-70.sh[833]: + cmp - /tmp/result
[  115.758004] testsuite-70.sh[832]: /usr/lib/systemd/tests/testdata/units/testsuite-70.sh: line 56: /usr/lib/systemd/systemd-measure: No such file or directory
[  115.773851] testsuite-70.sh[833]: cmp: EOF on - which is empty
[  115.983681] sh[835]: + systemctl poweroff --no-block
```
2022-08-04 13:18:47 +00:00
Luca Boccassi c1178baacd docs: add disabled PR template for code freeze
To be enabled on rc1, and disabled again after the final release.
Gives contributors a clear warning that new features/APIs will be
postponed.
2022-08-04 11:10:28 +02:00
Jan Janssen bafc594528 boot: Skip safety countdown when running in a VM 2022-08-04 10:21:15 +02:00
Jan Janssen adb9485acb man: Add instructions for Microsoft secure boot keys
Adding Microsoft keys by default is recommended because firmware drivers
might be signed by it.

This also changes the file ending from .esl to .auth as that is used by
sign-efi-sig-list manpage and other sources.
2022-08-04 10:03:48 +02:00