Skip to content

Synchronise 2023.1 with upstream#174

Merged
priteau merged 2 commits intostackhpc/2023.1from
upstream/2023.1-2026-02-23
Feb 23, 2026
Merged

Synchronise 2023.1 with upstream#174
priteau merged 2 commits intostackhpc/2023.1from
upstream/2023.1-2026-02-23

Conversation

@github-actions
Copy link
Copy Markdown

This PR contains a snapshot of 2023.1 from upstream unmaintained/2023.1.

kk7ds and others added 2 commits February 18, 2026 13:04
This fixes an instance of us passing a disk image to qemu-img for
resize where we don't constrain the format. As has previously been
identified, it is never safe to do that when the image itself is not
trusted. In this case, an instance with a previously-raw disk image
being used by imagebackend.Flat is susceptible to the user writing a
qcow2 (or other) header to their disk causing the unconstrained
qemu-img resize operation to interpret it as a qcow2 file.

Since Flat maintains the intended disk format in the disk.info file,
and since we would have safety-checked images we got from glance,
we should be able to trust the image.format specifier, which comes
from driver_format in imagebackend, which is read from disk.info.
Since only raw or qcow2 files should be resized anyway, we can further
constrain it to those.

Notes:
 1. qemu-img refuses to resize some types of VMDK files, but it may
    be able to resize others (there are many subformats). Technically,
    Flat will allow running an instance directly from a VMDK file,
    and so this change _could_ be limiting existing "unintentionally
    works" behavior.
 2. This assumes that disk.info is correct, present, etc. The code to
    handle disk.info will regenerate the file if it's missing or
    unreadable by probing the image without a safety check, which
    would be unsafe. However, that is a much more sophisticated attack,
    requiring either access to the system to delete the file or an
    errant operator action in the first place.

Change-Id: I07cbe90b7a7a0a416ef13fbc3a1b7e2272c90951
Closes-Bug: #2137507
(cherry picked from commit 3eba22f)
(cherry picked from commit f448173)
(cherry picked from commit 992646e)
Signed-off-by: Dan Smith <dansmith@redhat.com>
(cherry picked from commit 92d5d74)
(cherry picked from commit 06d1077)
@github-actions github-actions bot added automated Automated action performed by GitHub Actions synchronisation labels Feb 23, 2026
@github-actions github-actions bot requested a review from a team as a code owner February 23, 2026 06:39
@priteau priteau closed this Feb 23, 2026
@priteau priteau reopened this Feb 23, 2026
@priteau priteau merged commit 00c3466 into stackhpc/2023.1 Feb 23, 2026
4 checks passed
@priteau priteau deleted the upstream/2023.1-2026-02-23 branch February 23, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated Automated action performed by GitHub Actions synchronisation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants