1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 14:55:37 +03:00
Commit Graph

60449 Commits

Author SHA1 Message Date
Luca Boccassi
043ba6a1ee NEWS: more news 2022-10-04 15:00:55 +02:00
Luca Boccassi
3af9dc7730 NEWS: typos 2022-10-04 13:51:39 +01:00
Lennart Poettering
598f1d5377
Merge pull request #24913 from keszybz/hwdb-252-2
hwdb update
2022-10-04 13:43:48 +02:00
Yu Watanabe
e6766c538a udev-builtin-net_id: reading phys_port_name may be refused with EOPNOTSUPP
If reading the sysattr failed with such error, the whole operation in
net_id builtin command will fail, and the interface will not be renamed.

Fixes a bug introduced by 5bbcfbaa11.
2022-10-04 20:29:41 +09:00
Luca Boccassi
f77c0840d5 Update NEWS 2022-10-04 11:33:50 +01:00
Lennart Poettering
feffee70d9 update TODO 2022-10-04 11:55:33 +02:00
Zbigniew Jędrzejewski-Szmek
4239a9ec3d hwdb: run "update-hwdb-autosuspend" 2022-10-04 10:43:47 +02:00
Zbigniew Jędrzejewski-Szmek
2b7eccd95e hwdb: run "update-hwdb"
As usual, it seems to be mostly additions and corrections.
2022-10-04 10:43:12 +02:00
drosdeck
9cc48b8175 Fix key toggle touchpad and programmable buttom for Positivo Motion CW14Q01P #24909 2022-10-03 23:06:16 +01:00
Topi Miettinen
a8ec0abe5a tmpfiles: fix assert
Oct 03 17:33:20 systemd-tmpfiles[872]: Assertion 'IN_SET(i->type, CREATE_BLOCK_DEVICE|CREATE_CHAR_DEVICE)' failed at src/tmpfiles/tmpfiles.c:1837, function create_device(). Aborting.

I think this is caused by the line:
b! /dev/private/smartmontools-dev/sda 0660 root disk - 8:0
2022-10-03 22:13:29 +01:00
Yu Watanabe
8aba7b839b network: ndisc: do not accept too many DNS servers or domains
If there exists multiple routers, then the previous logic may introduce
too many DNS servers or domains.
2022-10-04 02:52:49 +09:00
Yu Watanabe
af2aea8bb6 network: ndisc: drop addresses and friends when RA with zero lifetime is received
Routers may send options with zero lifetime if previously announced
information is outdated. Hence, if we receive such messages, then we
need to drop relevant addresses or friends.

See e.g. https://www.rfc-editor.org/rfc/rfc4861#section-12.

Follow-up for 2ccada8dc4.
2022-10-04 02:52:46 +09:00
Yu Watanabe
0cf1fe8888 network: make sec_to_usec() map 0sec -> 0usec
Zero lifetime in RA is special, and we should not assign possibly very
short lifetime addresses or friends.

This should not change anything at least now, preparation for later
commits. Note, DHCPv4 and v6 code also uses it, but sd-dhcp-client and
sd-dhcp6-client already filtered messages with zero lifetime. Hence,
the change should not affect DHCP code.
2022-10-04 00:25:14 +09:00
Yu Watanabe
773024685b network: ndisc: also introduce timer event source to drop outdated settings
Otherwise, settings based on previously received RA messages will never
removed without receiving a new RA message.
2022-10-04 00:25:14 +09:00
Yu Watanabe
94e6d37c2b network: ndisc: drop outdated settings before processing RA message
Otherwise, e.g. if a router is replaced, then the previously received
settings may never dropped.

Follow-up for 2ccada8dc4.
2022-10-04 00:25:14 +09:00
Yu Watanabe
8d1babc51d network: ndisc: address_get() returns 0 on success
After the commit 3b6a3bdebf, address_get()
does not return 1.
2022-10-04 00:25:14 +09:00
Yu Watanabe
d4b7631468 network: introduce {address,route}_remove_and_drop()
Preparation for later commits.
2022-10-04 00:25:14 +09:00
Yu Watanabe
a115c60e0d network: ndisc: ignore prefix option with link-local prefix
See https://www.rfc-editor.org/rfc/rfc4861#section-4.6.2.
2022-10-04 00:25:14 +09:00
Yu Watanabe
167c7ae511 network: ndisc: read prefix earlier
No functional changes.
2022-10-04 00:25:14 +09:00
Luca Boccassi
a9b0d0a2d0 TODO: tmpfiles.d m/M 2022-10-03 15:28:11 +01:00
Daan De Meyer
898db9f3cf repart: Use chase_symlinks() instead of path_join()
Let's properly resolve symlinks and check if the source actually
exists.
2022-10-03 14:16:13 +01:00
Luca Boccassi
8bd1dcc6e8
Merge pull request #23213 from bluca/jammy
Fixes for Jammy CI
2022-10-03 13:58:09 +01:00
Richard Phibel
05d9465675 coredumpctl: Add support for the --image option 2022-10-03 12:19:34 +02:00
Richard Phibel
71bdc96ab7 coredumpctl: Add support for the --root option
With this option, coredumpctl looks for journal files under the
specified root directory
2022-10-03 12:19:28 +02:00
Luca Boccassi
8e3b2ec5a5 test-70: check if LUKS2 plugins are actually installed, not just supported
We don't build them in Debian/Ubuntu yet, even though cryptsetup supports them
2022-10-03 10:26:31 +01:00
Luca Boccassi
419f2742e7 repart: workaround spurious maybe-uninitialized warning
Build fails on Ubuntu Jammy
2022-10-03 10:26:31 +01:00
Yu Watanabe
0a8720c7f0 network: fix use-after-free
If the lifetime of the route is already expired, do not try to
configure it.

Fixes a use-after-free, as the Request object is already freed, thus, we
cannot use Route or Link stored in Request object.
2022-10-03 09:15:10 +02:00
Yu Watanabe
2ff7862bf2 resolve: drop remaining references for Monitor=
Follow-up for b25d819aee.
2022-10-03 08:26:05 +02:00
Thomas Hebb
2ccada8dc4 network: don't forget old RAs when a new one arrives
IPv6 Neighbor Discovery lets us autoconfigure a link's IPv6 addresses,
routes, DNS servers, and DNS search domains by listening for Router
Advertisement (RA) packets broadcast by one or more routers on the link.
Each RA can contain zero or more "options," each describing one piece of
configuration (e.g. a single route).

Currently, when we receive an RA from a router, we delete any addresses,
routes, etc. that originated from that router's previous RAs unless
they're also present as options in the new RA.

That behavior is a violation of RFC 4861[1]. In Section 9, the RFC
states that

    Senders MAY send a subset of options in different packets. ... Thus,
    a receiver MUST NOT associate any action with the absence of an
    option in a particular packet. This protocol specifies that
    receivers should only act on the expiration of timers and on the
    information that is received in the packets.

Several other passages in the RFC reiterate this. Section 6.2.3:

    A router MAY choose not to include some or all options when sending
    unsolicited Router Advertisements.

Section 6.3.4:

    Hosts accept the union of all received information; the receipt of a
    Router Advertisement MUST NOT invalidate all information received in
    a previous advertisement or from another source.

At least one consumer router in production today, the Google Nest Wifi,
often sends RAs that omit its global IPv6 prefix. When current versions
of systemd-networkd receive those RAs, they immediately delete the
interface's global IPv6 address, which breaks IPv6 connectivity.

Fix the issue by removing the invalidation logic entirely. It's not
needed at all, since we already invalidate addresses, routes, and DNS
configuration when the interface goes down or their lifetimes expire.

This fix does have the side effect of preventing changes to the .network
file (e.g. denylisted prefixes, whether to add routes from RAs) from
taking effect as soon as a new RA arrives. Instead, a full interface
reconfiguration is needed. But triggering those changes on RA receipt
was already rather arbitrary and out of the administrator's control, so
I think this change is fine.

commit 69203fba70 ("network: ndisc: remove old addresses and routes
after at least one SLAAC address becomes ready") introduced this
behavior. commit 50550722e3 fixed it partially, by preventing one
router's RAs from invalidating another router's configuration.

[1] https://www.rfc-editor.org/rfc/rfc4861

Fixes: 69203fba70 ("network: ndisc: remove old addresses and routes after at least one SLAAC address becomes ready")
2022-10-03 09:59:37 +09:00
Yu Watanabe
f01f70a9a3 test: add more tests for StateDirectory= with DynamicUser=
This also moves the check for writable paths from test-execute to TEST-34.

Closes #10337.
2022-10-03 09:25:00 +09:00
Yu Watanabe
a2ab603cc4 core: do not create symlink to private directory if parent already exists
The very basic functinality of StateDirectory= or friends is creating
specified directories. That should work if one entry is a subdirectory
of another. However, it does not when combined with DynamicUser=yes.

To support such case, this adds ExecDirectoryItem.only_create flag, and
if it is set PID1 only create private directory, and not create the symlink
to the private directory.

Fixes #24783.
2022-10-03 09:25:00 +09:00
Yu Watanabe
564e5c9878 core: make exec_directory_add() extends existing symlinks
Follow-up for 211a3d87fb.

Previously, although ExecDirectoryItem.symlinks is strv, it always
contains at most one symlink.
2022-10-03 09:25:00 +09:00
Yu Watanabe
64ebc0da03 resolve: fix typo 2022-10-03 09:23:37 +09:00
Daan De Meyer
f0e6cb196e repart: Take --root into account in read only filesystems shortcut 2022-10-03 08:00:07 +09:00
Yu Watanabe
59fde24c60
Merge pull request #24897 from mrc0mmand/TEST-64-sanitiers-open-scsi
test: pre-load ASan's DSO for iscsi-init.service
2022-10-03 07:51:50 +09:00
Frantisek Sumsal
326425fb4d test: pre-load ASan's DSO for iscsi-init.service
The iscsi-init.service calls `sh` which might, in certain circumstances,
pull in instrumented systemd NSS modules causing `sh` to fail. Let's mitigate
this by pulling in an env file crafted by `create_asan_wrapper()` that
(among others) pre-loads ASan's DSO.
2022-10-02 22:53:26 +02:00
Frantisek Sumsal
25213e16f7 test: introduce a simple environment file for test service 2022-10-02 22:44:32 +02:00
Yu Watanabe
9d2d346aae sd-dhcp6-client: allow to build large packet
Previously, the maximum packet size was hardcoded with 512 + size of
the DHCP header. This makes the packet size increased when necessary.
See option_append_hdr().

Previously, all functions which append DHCP options took the head of the
unused area of the packet, and the size of the free area.
However, with this change, the buffer for the whole packet may be
reallocated, hence now they take the head of the packet and the offset
to the free area.

Fixes #24851.
2022-10-02 23:05:05 +09:00
Yu Watanabe
0454223840 sd-dhcp6-client: rename buf -> p
No functional changes, just preparation for the next commit.
2022-10-02 23:05:05 +09:00
Yu Watanabe
cb9c303d70 sd-dhcp6-client: use GREEDY_REALLOC() in dhcp6_option_append_vendor_class() 2022-10-02 23:05:05 +09:00
Yu Watanabe
60cbf2ea82 sd-dhcp6-client: use GREEDY_REALLOC()
And merge 'total' and 'offset' -> 'n'
2022-10-02 23:05:05 +09:00
Yu Watanabe
451daa394e sd-dhcp6-client: slightly shorten dhcp6_option_append_fqdn() 2022-10-02 23:05:05 +09:00
Yu Watanabe
6f8c3de6b7 sd-dhcp6-client: simplify dhcp6_option_append_ia() 2022-10-02 23:05:05 +09:00
Yu Watanabe
4ec5b5c778 sd-dhcp6-client: make dhcp6_option_append_fqdn() or friends handle zero length value gracefully 2022-10-02 23:05:05 +09:00
Yu Watanabe
93ed1c0eb9 sd-dhcp6-client: use assert() in non-public functions 2022-10-02 23:05:05 +09:00
Yu Watanabe
4124b03b8c sd-dhcp6-client: do not use implicit cast from integer to boolean 2022-10-02 23:05:05 +09:00
Daan De Meyer
8e52ed024d repart: Don't fail on missing verity sig partition
Also, provide a proper error message when we fail to find a verity
sibling partition.
2022-10-02 14:08:34 +01:00
Frantisek Sumsal
9caab7b559 test: expand the expression in cleanup_initdir()
Otherwise we might unexpectedly return 1 if the `get_bool` call fails.

If the `get_bool` part in `get_bool "$TEST_SETUP_CLEANUP_ROOTDIR" &&  _umount_dir "${initdir:?}"`
fails, the whole expression will short-circuit evaluate to 1, and since it's
the last expression in the function it's also it's return value, which doesn't
reflect the original intent of the expression:

```
# BUILD_DIR=$PWD/build make -C test/TEST-64-UDEV-STORAGE/ setup run TESTCASES=testcase_always_skip
make: Entering directory '/home/fsumsal/repos/@systemd/systemd/test/TEST-64-UDEV-STORAGE'
TEST-64-UDEV-STORAGE SETUP: systemd-udev storage tests
Reusing existing image /var/tmp/systemd-test.uPbJZ9/default.img → /var/tmp/systemd-test.uPbJZ9/default.img
TEST-64-UDEV-STORAGE RUN: systemd-udev storage tests
------ testcase_always_skip: BEGIN ------
Skipping...
------ testcase_always_skip: END (SKIP) ------
Passed tests: 0
    *
Skipped tests: 1
    * testcase_always_skip
Failed tests: 0
    *
TEST-64-UDEV-STORAGE RUN: systemd-udev storage tests [OK]
make: Leaving directory '/home/fsumsal/repos/@systemd/systemd/test/TEST-64-UDEV-STORAGE'

# BUILD_DIR=$PWD/build make -C test/TEST-64-UDEV-STORAGE/ setup run TESTCASES=testcase_always_skip
make: Entering directory '/home/fsumsal/repos/@systemd/systemd/test/TEST-64-UDEV-STORAGE'
TEST-64-UDEV-STORAGE SETUP: systemd-udev storage tests
Reusing existing image /var/tmp/systemd-test.uPbJZ9/default.img → /var/tmp/systemd-test.uPbJZ9/default.img
make: *** [Makefile:4: setup] Error 1
make: Leaving directory '/home/fsumsal/repos/@systemd/systemd/test/TEST-64-UDEV-STORAGE'
```
2022-10-02 00:27:13 +01:00
Frantisek Sumsal
3d0c1256b4 test: drop the explicit bus assignment for the pci-bridge
as it doesn't work with the Q35 chipset due to a different topology.
Auto-assignment seems to work with both Q35 and i440FX chipsets.
2022-10-02 00:09:54 +02:00
Luca Boccassi
3cd1b8f403
Merge pull request #24878 from keszybz/condition-first-boot
Tweak condition first boot to use the same logic in pid1 and units
2022-10-01 19:30:21 +01:00