Commit graph

65882 commits

Author SHA1 Message Date
Lennart Poettering f4b24db7c3 test: add test case for recent OnSuccess=/OnFailure= state machine changes 2023-07-03 17:31:25 +02:00
Lennart Poettering 09d04ad325 core: introduce a new job mode JOB_RESTART_DEPENDENCIES
This new job mode will enqueue a start job for a unit, and all units
depending on the unit will get a restart job enqueued. This is then used
for automatic sevice restarts: the unit itself is only started, the
depending units restarted. This way the unit will not go down
unnecessarily, triggering OnSuccess= needlessly.

This also introduces a new state SERVICE_AUTO_RESTART_QUEUED that is
entered once the restart jobs are enqueued. Previously we'd stay in
SERVICE_AUTO_RESTART, but that's problematic, since we'd lose
information whether we still need to enqueue the restart job during a
serialization/deserialization cycle or not. By having an explicit state
for this we know exactly whether we still need to enqueue the job or
not. It's also good since when we are in SERVICE_AUTO_RESTART_QUEUED we
want to act on unit_start(), but on SERVICE_AUTO_RESTART we want to wait
for the holdoff time to pass before we act on unit_start().

Fixes: #27722
2023-07-03 17:31:25 +02:00
Lennart Poettering 0c59d2e4ab service: re-linebreak some comments matching current coding style 2023-07-03 17:31:25 +02:00
Luca Boccassi fc613c8450
Merge pull request #28230 from yuwata/network-wait-address-configure
network: delay to configure address untill it is removed on reconfigure
2023-07-03 15:04:32 +01:00
Ronan Pigott 8231286faf ndisc: reject malformed captive portal URI with EBADMSG
This allows the correct, gracious, error handling to follow up in the
ndisc handler. Otherwise, an internal error is assumed and the interface
disabled.

Fixes: 9747955d2d ("ndisc: parse RFC8910 captive portal ipv6ra option")
2023-07-03 03:07:57 -07:00
Lennart Poettering 89ee9e59f7 update TODO 2023-07-03 11:59:45 +02:00
Ronan Pigott 16290f50e9 ndisc: clear ndisc captive portal value on bogus zero-len option
This value was freed but erroneously never cleared, leading to
use-after-free.

Fixes: 9747955d2d ("ndisc: parse RFC8910 captive portal ipv6ra option")
2023-07-03 01:10:41 -07:00
Yu Watanabe e4948bb2cd test-network: add test for static route with preferred source
This adds possible reproducer for issue #28009 (though, the issue is
highly racy, hence this may not trigger the issue reliably).
2023-07-03 16:13:49 +09:00
Yu Watanabe 7e30527806 test-network: check route more strictly 2023-07-03 16:06:17 +09:00
Yu Watanabe 6e8477edd3 network: delay to configure address until it is removed on reconfigure
When we request an address that already exists and is under removing,
we need to wait for the address being removed. Otherwise, configuration
of a route whose preferred source is the address will fail.

Fixes #28009.
Replaces #28088.
2023-07-03 16:06:17 +09:00
Yu Watanabe b088c3d3fc network: constify several functions 2023-07-03 16:06:17 +09:00
Yu Watanabe 86c2a76e09
Merge pull request #28132 from rpigott/dhcp-captive-portal
Implement RFC8910: captive portal dhcp options
2023-07-03 14:51:56 +09:00
Bastien Nocera 56506988f2 hwdb: Add override for headset form-factors
Correct the SOUND_FORM_FACTOR property for Steelseries Arctis headsets.
The USB IDs were all gathered from HeadsetControl[1].

[1]: https://github.com/Sapd/HeadsetControl
2023-07-02 15:55:24 +01:00
Luca Boccassi b9d29a2028
Merge pull request #28226 from mrc0mmand/coverity-fixes
A couple of Coverity-related fixes
2023-07-02 15:54:56 +01:00
Frantisek Sumsal 5000cea8d2 tree-wide: explicitly ignore return value in a couple more places
Resolves:
  - CID#1490777
  - CID#1498366
  - CID#1508639
  - CID#1509084
  - CID#1509086
  - CID#1509087
2023-07-02 12:22:45 +02:00
Frantisek Sumsal 85773a7fd0 unit: drop an unused assignment
Resolves: CID#1509244
2023-07-02 12:22:45 +02:00
Frantisek Sumsal 9cf7f7a82f virt: drop an unused assignment
As `v` gets overwritten by the following detect_vm_cpuid() call.

Resolves: CID#1509247
2023-07-02 12:22:41 +02:00
Zbigniew Jędrzejewski-Szmek da89046643 tree-wide: "<n>bit" → "<n>-bit"
In some places, "<n> bits" is used when more appropriate.
2023-07-02 11:10:12 +01:00
Frantisek Sumsal e3747380fb test: drop an unused assignment
Unused since 788c2d9523.
Resolves: CID#1509248
2023-07-02 11:04:38 +02:00
Ronan Pigott dbe960f07f test-network: add tests for captive portal dhcp options 2023-07-02 01:13:43 -07:00
Ronan Pigott e469d2a2ed networkctl: show captive portal configuration in link status 2023-07-02 01:13:43 -07:00
Ronan Pigott 8628267f31 networkd: include captive portal information in link json description 2023-07-02 01:13:43 -07:00
Ronan Pigott d74c4ce103 network: Introduce UseCaptivePortal IPv6RA option
Accepts a boolean. When enabled retains captive portal configuration
advertised by the router.
2023-07-02 01:13:43 -07:00
Ronan Pigott a75feb554b network: Introduce UseCaptivePortal DHCPv6 option
Acepts a boolean. When enabled requests and retains captive portal
configuration from the DHCPv6 server.
2023-07-02 01:13:43 -07:00
Ronan Pigott edb88a7201 network: Introduce UseCaptivePortal DHCPv4 option
Accepts a boolean. When enabled, UseCaptivePortal will request and
retain the captive portal configuration from the DHCP server.
2023-07-02 01:13:43 -07:00
Ronan Pigott 9747955d2d ndisc: parse RFC8910 captive portal ipv6ra option 2023-07-02 01:13:29 -07:00
Zbigniew Jędrzejewski-Szmek 221332ee13 NEWS: reword/fix/extend the entries for v254 2023-07-01 14:07:25 -06:00
Zbigniew Jędrzejewski-Szmek 33db1b9055 NEWS: drop doubled space after period
Emacs does this, but it doesn't make much sense. It makes even
less sense if done only in some places.
2023-07-01 13:54:14 -06:00
dependabot[bot] 1cdaba52a5 build(deps): bump github/codeql-action from 2.3.5 to 2.20.1
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.3.5 to 2.20.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](0225834cc5...f6e388ebf0)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-01 14:05:22 +00:00
dependabot[bot] 6cc0fd0044 build(deps): bump actions/labeler from 4.0.4 to 4.2.0
Bumps [actions/labeler](https://github.com/actions/labeler) from 4.0.4 to 4.2.0.
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](0776a67936...0967ca812e)

---
updated-dependencies:
- dependency-name: actions/labeler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-01 10:37:11 +00:00
dependabot[bot] a2c9096790 build(deps): bump actions/checkout from 3.5.2 to 3.5.3
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.2 to 3.5.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](8e5e7e5ab8...c85c95e3d7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-01 10:36:23 +00:00
dependabot[bot] 479f9f3004 build(deps): bump ossf/scorecard-action from 2.1.3 to 2.2.0
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.1.3 to 2.2.0.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](80e868c13c...08b4669551)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-01 10:35:10 +00:00
Luca Boccassi cc5afe481e
Merge pull request #28187 from bluca/sbat
ukify: merge .sbat sections from stub and kernel
2023-06-30 21:55:58 +01:00
Lennart Poettering 6a58026df7
Merge pull request #28211 from poettering/unit-abstract
remove some explicit unit type checks from generic code, and make them abstract
2023-06-30 22:51:15 +02:00
Lennart Poettering 472619672a mount: make unit_start() mount ratelimiting check generic
Let's move this into a vtable callout, so that unit.c doesn't check for
explicit unit types anymore.

(This is preparation for a future where we do a similar check for the
automount logic, or the swap logic.)
2023-06-30 22:01:02 +02:00
Lennart Poettering 56d83b74d4 oom: don't encode whether unit types can do oomd hookup a second time
We already encode this in UnitVTable, hence use it. Even if it means
we'll do some minor extra iterations.
2023-06-30 22:01:02 +02:00
Lennart Poettering b2bfd121b7 pid1: also encode whether to send plymouth notifications in UnitVTable 2023-06-30 22:01:02 +02:00
Lennart Poettering d52b8493c2 unit: don't encode literally which unit types to generate audit events for
Let's abstract this a bit, and keep this info purely in UnitVTable.
2023-06-30 22:01:02 +02:00
Daan De Meyer 1dbccd6d34 dbus-cgroup: Make sure we overwrite cpuset properties in drop-in
The DBUS property setter overwrites the value of the property but
writes a drop-in that extends the value. Let's make sure the drop-in
overwrites the property value as well by assigning the empty string
first.
2023-06-30 21:59:32 +02:00
Lennart Poettering 95dafd30da battery-check: rework unit
Let's rename the unit to systemd-battery-check.service. We usually want
to name our own unit files like our tools they wrap, in particular if
they are entirely defined by us (i.e. not just wrappers of foreign
concepts)

While we are at it, also hook this in from initrd.target, and order it
against initrd-root-device.target so that it runs before the root device
is possibly written to (i.e. mounted or fsck'ed).

This is heavily inspired by @aafeijoo-suse's PR #28208, but quite
different ;-)
2023-07-01 03:19:16 +08:00
Frantisek Sumsal a5e478b24c test: fix test_vxlan with the latest iproute2
Some options were renamed and some options with default values are not
shown unless -d(etails) is repeated.

See: https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=1215e9d3862387353d8672296cb4c6c16e8cbb72
2023-06-30 17:33:40 +00:00
Lennart Poettering dbf7509775 README: strenghten wording regarding static libs
static versions of libsystems.so are not really supportable, and
encourages mix&match which we cannot really support. Make the wording
about this stronger in the README, since people apparently don'd read to
the last paragraph.
2023-06-30 18:22:42 +02:00
Luca Boccassi d5f91cf793 boot: measure .sbat section
We are now merging .sbat sections from sd-stub and kernel image, so
measure it in PCR11.
2023-06-30 17:17:56 +01:00
Luca Boccassi c3f7501c4d ukify: merge .sbat sections from stub and kernel
If the kernel contains a .sbat section (they should start soon) then merge
it with the stub's so that revocations can apply to either component.

Fixes https://github.com/systemd/systemd/issues/27866
2023-06-30 17:17:56 +01:00
Daan De Meyer 506c1bb594 stat-util: Make sure we trigger automounts when looking for ESP/XBOOTLDR
Fixes #25417
2023-06-30 12:25:07 +01:00
Ronan Pigott fde788601b dhcp6-client: parse RFC8910 captive portal dhcp6 option 2023-06-29 16:42:25 -07:00
Ronan Pigott 7040fd381a dhcp-client: parse RFC8910 captive portal dhcp option 2023-06-29 16:42:16 -07:00
Frantisek Sumsal 06afda6b38 core: reorder systemd arguments on reexec
When reexecuting system let's put our arguments carrying deserialization
info first followed by any existing arguments to make sure they get
parsed in case we get weird stuff from the kernel cmdline (like --).

See: https://github.com/systemd/systemd/issues/28184
2023-06-29 22:20:41 +01:00
Ivan Vecera 88d2bda812 udev-builtin-net_id: align VF representor names with VF names
Certain cards support to set their eswitch to switchdev mode. In this
mode for each created VF there is also created so called VF representor.
This representor is helper network interface used for configuration of
mentioned eswitch and belongs to an appropriate PF.

VF representors are identified by the specific value of phys_port_name
attribute and the value has format "pfMvfN" where M is PF function
number and N is VF number inside this PF.

As the VF representor interfaces belong to PF PCI device the naming
scheme used for them is the same like for other PCI devices. In this
case name of PF interface is used and phys_port_name suffix is appended.

E.g.
 PF=enp65s0f0np0 # phys_port_name for PF interface is 'p0'
 VF=enp65s0f0np0v0 # v0 is appended for VF0 in case of NAMING_SR_IOV_V
REP=enp65s0f0np0pf0vf0 # phys_port_name for VF0 representor is 'pf0vf0'

First as the phys_port_name for representors is long (6+ chars) then the
generated name does not fit into IFNAMSIZ so this name is used only as
alternate interface name and for the primary one is used generic one
like eth<N>. Second 'f0' and 'pf0' in REP name is redundant.

This patch fixes this issue by introducing another naming scheme for VF
representors and appending 'rN' suffix to PF interface name for them.
N is VF number so the name used for representor interface is similar to
VF interface and differs only by the suffix.

For the example above we get:
 PF=enp65s0f0np0
 VF=enp65s0f0np0v0
REP=enp65s0f0np0r0

This eases for userspace to determine which representor interface
represents particular VF.

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
2023-06-29 22:18:05 +01:00
Luca Boccassi 1d2b93ff89
Merge pull request #28138 from pkern/oci-dhcpv6
sd-dhcp6-lease: Ignore invalid bytes at the end of the packet
2023-06-29 22:17:02 +01:00