Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v253 batch #408

Merged
merged 41 commits into from
May 28, 2024
Merged

v253 batch #408

merged 41 commits into from
May 28, 2024

Conversation

bluca
Copy link
Member

@bluca bluca commented May 27, 2024

No description provided.

DaanDeMeyer and others added 30 commits May 27, 2024 22:50
This can change between the call to homectl inspect and userdbctl
user so let's ignore it along with the other disk fields.

Fixes #32727

(cherry picked from commit 6c5d4f0)
(cherry picked from commit 868bcfa)
(cherry picked from commit 35a5826)
This fixes build with old toolchains prior to Linux < 4.2 which do not
have a definition for NFPROTO_NETDEV.

(cherry picked from commit 41a94ae)
(cherry picked from commit d8d64ce)
(cherry picked from commit e977850)
(cherry picked from commit e97bb36)
(cherry picked from commit 1f3313d)
(cherry picked from commit 25b4ce2)
Also this makes several checks more strict.

(cherry picked from commit 24e3792)
(cherry picked from commit 6ad7d19)
(cherry picked from commit 5e10896)
This should be useful when the test run as a service, e.g.
running on a mkosi image.

(cherry picked from commit e92d7b7)
(cherry picked from commit ebbc5e5)
(cherry picked from commit 70c1f11)
This adds checks for the kernel bug caused by
torvalds/linux@3ddc223,
it will be fixed by
https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/

(cherry picked from commit d22f2fb)
(cherry picked from commit 90fda85)
Follow-up for 9de324c.

(cherry picked from commit a937fa9)
(cherry picked from commit 29868fb)
(cherry picked from commit 6f2a7f0)
The state might be "freezing-by-parent" as well so let's take that
into account.

Fixes #32746

(cherry picked from commit 034e85c)
(cherry picked from commit 33a8ea6)
(cherry picked from commit 3765072)
… destroy a curl context on exit

If we destroy both an event loop and a curl contect object at the same
time, then we get into this weird situation where curl wants us to
reconfigure a timout event source right before destruction, which
sd-event will refuse however, since it is already being shutdown.

Hence, catch that and simply don't bother adjusting the timeout, since
we cannot get back from there anyway.

(cherry picked from commit c5ecf09)
(cherry picked from commit 73164d4)
(cherry picked from commit e892472)
We want to eanble running tests as part of the build, but
our builds run in VMs with networking disabled.

(cherry picked from commit 19614a0)
(cherry picked from commit 1b75c51)
(cherry picked from commit 07a72ea)
(cherry picked from commit f7a6418)
(cherry picked from commit 8d074b7)
(cherry picked from commit 6d913d0)
(cherry picked from commit d02a41a)
(cherry picked from commit 9612ec0)
(cherry picked from commit 2692acb)
If tests are run during build time, without an already installed
systemd they fail to resolve the sysusersdir and tpmfilesdir pkg-config variables.

(cherry picked from commit 2aee829)
(cherry picked from commit 936576d)
(cherry picked from commit eec41b7)
Otherwise we log a noisy error when we get ECONNRESET.

(cherry picked from commit 2540036)
(cherry picked from commit 51c2887)
(cherry picked from commit c61d11c)
Fixes #32695.

(cherry picked from commit 71f0487)
(cherry picked from commit 8318972)
(cherry picked from commit e62ecc6)
Follow-up for 6c2d47d.

Fixes the following unexpected skip:
```
[    6.163670] TEST-64-UDEV-STORAGE.sh[596]: + modinfo btrfs
[    6.164102] TEST-64-UDEV-STORAGE.sh[726]: /usr/lib/systemd/tests/testdata/units/TEST-64-UDEV-STORAGE.sh: line 726: modinfo: command not found
[    6.164683] TEST-64-UDEV-STORAGE.sh[727]: + echo 'This test requires the btrfs kernel module but it is not installed, skipping the test'
[    6.165069] TEST-64-UDEV-STORAGE.sh[728]: + tee --append /skipped
[    6.166801] TEST-64-UDEV-STORAGE.sh[728]: This test requires the btrfs kernel module but it is not installed, skipping the test
[    6.167177] TEST-64-UDEV-STORAGE.sh[596]: + exit 77
```

(cherry picked from commit 2569e79)
(cherry picked from commit 0868f29)
(cherry picked from commit 911a593)
… to user operation

(cherry picked from commit ade0789)
(cherry picked from commit 920dbc7)
(cherry picked from commit 3b01bd3)
The rationale is similar to 40e1f4e.

Currently, we only pass TTYPath=/dev/pts/... to
the transient service spawned by systemd-run.
This is a bit problematic though, when ExecStartPre=
or ExecStopPost= is used. Since when these control
processes get to run, the main process is not yet
started/has already exited, hence the slave suffers
from the same vhangup problem as the mentioned commit.

By passing the slave fd in, the service manager will
hold the fd open as long as the service is alive.

Fixes #32916

(cherry picked from commit 28459ba)
(cherry picked from commit 182b80b)
(cherry picked from commit 369d7d4)
Otherwise, ReadOnly DBus property in org.freedesktop.machine1.Image or
org.freedesktop.portable1.Image will not be updated by MarkReadOnly DBus
method.

(cherry picked from commit 608c321)
(cherry picked from commit c16f4aa)
(cherry picked from commit e268f14)
Same as the previous commit, but for SetLimit DBus method vs Limit
property and friends.

(cherry picked from commit 96ac6d3)
(cherry picked from commit a2349e8)
(cherry picked from commit 77ec269)
Preparation for the next commit. No functional change.

(cherry picked from commit 6d917da)
(cherry picked from commit aa6822f)
(cherry picked from commit cde3c5a)
…he main interface is called

Previously, Image objects were only cached when reading properties or
methods in the org.freedesktop.machine1.Image interface are called.

This makes that, when a method in the main interface (org.freedesktop.machine1)
for an image is called, also acquire the Image object from the cache,
and if not cached, create Image object and put into the cache, like we
do for org.freedesktop.machine1.Image.

Otherwise, if some properties of an image are updated by methods in the main
interface, e.g. MarkImageReadOnly(), the changes do not applied to the cached
Image object, and subsequent read of proerties through the interface for the
image, e.g. ReadOnly property, may provide outdated values.

Follow-up for 1ddb263.

Fixes #32888.

(cherry picked from commit c6aeb9b)
(cherry picked from commit bf270a3)
(cherry picked from commit a898cb9)
Fixes a bug introduced by 1ddb263.

Note, this requires the previous two commits, and cannot backport without them.

Note, before the previous commit, the use-after-free could be triggered
only by Rename() DBus method, and could not by RenameImage(), as we did not
cache Image object when RenameImage() method is called. And machinectl
always uses RenameImage(). Hence, the issue could be triggered only when
Rename() DBus method is explicitly called by e.g. busctl.

With the previous commit, the Image object passed to the function is
always cached. Hence, the issue could be triggered even with machinectl
command, and this fix is important.

(cherry picked from commit 3b1b2d4)
(cherry picked from commit c937169)
(cherry picked from commit 3102599)
(cherry picked from commit 12e0d6e)
(cherry picked from commit c047c7e)
(cherry picked from commit 5a62dc0)
Due to the bug in kernel 6.9 caused by
torvalds/linux@8debcf5,
the net_id udev builtin does not work for netdevsim interface.
So, eni99np1 cannot be used with kernel 6.9 anymore.

Workaround for #32910.

(cherry picked from commit f1f1be7)
(cherry picked from commit 221b278)
(cherry picked from commit 64719b5)
Makes it easier to switch for debuggin

(cherry picked from commit 5002b57)
(cherry picked from commit c64e960)
(cherry picked from commit 72e6c4b)
Fixes systemd/systemd#32932 (comment).

(cherry picked from commit f8ef1df)
(cherry picked from commit d6f9c7b)
(cherry picked from commit 87054dc)
(cherry picked from commit d735753)
(cherry picked from commit 867b5a7)
(cherry picked from commit 7f1f029)
Follow-up for ade0789

The change in behavior was partly intentional, as I think
if both --wait and --pty are used, manually disconnecting
from PTY forwarder should not result in systemd-run exiting
with "Finished with ..." log. But we should check for
--wait here.

Closes #32953

(cherry picked from commit 2b4a691)
(cherry picked from commit 4656130)
(cherry picked from commit 4e89a41)
…pipe, and --wait

(cherry picked from commit d73a47d)
(cherry picked from commit ce25cf6)
(cherry picked from commit d1e36e6)
yuwata and others added 11 commits May 27, 2024 23:10
Fixes systemd/systemd#32680 (comment).
===
May 21 02:45:08 TEST-74-AUX-UTILS.sh[2475]: + mountpoint /tmp/tmp.eaRV7lSbX2/mnt
May 21 02:45:08 TEST-74-AUX-UTILS.sh[2476]: /tmp/tmp.eaRV7lSbX2/mnt is not a mountpoint
May 21 02:45:08 TEST-74-AUX-UTILS.sh[2449]: + systemd-mount /dev/loop0 /tmp/tmp.eaRV7lSbX2/mnt
May 21 02:45:08 systemd-mount[2477]: Failed to start transient mount unit: Unit tmp-tmp.eaRV7lSbX2-mnt.mount was already loaded or has a fragment file.
===

(cherry picked from commit 4a8ca3c)
(cherry picked from commit 1a6a2d8)
(cherry picked from commit 861affe)
Hopefully fixes issue like
systemd/systemd#32680 (comment)
systemd/systemd#32680 (comment)

(cherry picked from commit e504f5a)
(cherry picked from commit 53a26a6)
(cherry picked from commit d080d3d)
On running cryptsetup, udevd detects two inotify events for the
underlying device. Running the test on enough fast host, the expected
symlinks based on UUID and disk label are created by the second event.

During processing a uevent for a device, udevd disables the inotify
watch for the device. If the test runs on slow system, the second
inotify event may comes during a udev worker processing the synthesized
uevent triggered by the first inotify event. Hence, no synthesized
uevent for the second inotify event will be generated, and the expected
symlinks will be never created.

To prevent the issue, we need to lock the device during cryptsetup
command is running.

Fixes #32913.

(cherry picked from commit be43c9b)
(cherry picked from commit 640dbad)
(cherry picked from commit b88915b)
When running in LXC with AppArmor we'll most likely get an error when creating
a network namespace due to a kernel regression in < v6.2 affecting AppArmor,
resulting in denials. Like other tests, avoid failing in case of permission
issues and handle it gracefully.

(cherry picked from commit 6ab21f2)
(cherry picked from commit ff35460)
(cherry picked from commit c3aa100)
Before:
/etc/kernel/install.conf:6: Unknown key name 'asdf' in section '(null)', ignoring.
After:
/etc/kernel/install.conf:6: Unknown key 'asdf', ignoring.

Also make the message a bit better.

(cherry picked from commit 600a740)
(cherry picked from commit a2f32b9)
(cherry picked from commit 1d83c17)
So, we need to try to read timezone several times.
Also, on failure, show journal of timedated instead of hostnamed,
as the timezone is handled by timedated.

Hopefully fixes #33007.

(cherry picked from commit 1ef586a)
(cherry picked from commit 91d31ca)
(cherry picked from commit 8b86ada)
See also: https://lore.kernel.org/r/[email protected]

(cherry picked from commit 100bed7)
(cherry picked from commit 41fb19e)
(cherry picked from commit 6426323)
With torvalds/linux@430cc5d,
the value of GENHD_FL_NO_PART, previously named as GENHD_FL_NO_PART_SCAN,
is changed from 0x0200 to 0x0004. So, we need to check both flags.

(cherry picked from commit f0c2668)
(cherry picked from commit 49b0f0e)
(cherry picked from commit 7f19a34)
With torvalds/linux@b9684a7 (v5.19),
we cannot check partition scanning is enabled for a loopback block device
without checking the attribute.

(cherry picked from commit bab8c85)
(cherry picked from commit ae7a07b)
(cherry picked from commit e2fe7d8)
Follow-up for 677430b

(cherry picked from commit d8f5a31)
(cherry picked from commit 632b493)
(cherry picked from commit 10e36db)
… namespace

Denials from AppArmor are raised as EACCES, so EPERM is not enough. Do
the same check as PrivateNetwork above.

Fixes systemd/systemd#31037

Related to 06384eb

(cherry picked from commit cafe40e)
(cherry picked from commit e481710)
(cherry picked from commit da9a6a5)
@bluca bluca merged commit 524610a into systemd:v253-stable May 28, 2024
35 of 41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

8 participants