Skip to content

Comments

Synchronise 2024.1 with upstream#173

Merged
priteau merged 2 commits intostackhpc/2024.1from
upstream/2024.1-2026-02-19
Feb 19, 2026
Merged

Synchronise 2024.1 with upstream#173
priteau merged 2 commits intostackhpc/2024.1from
upstream/2024.1-2026-02-19

Conversation

@github-actions
Copy link

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

kk7ds and others added 2 commits February 18, 2026 13:02
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)
@github-actions github-actions bot added automated Automated action performed by GitHub Actions synchronisation labels Feb 19, 2026
@priteau priteau closed this Feb 19, 2026
@priteau priteau reopened this Feb 19, 2026
@priteau priteau requested a review from a team as a code owner February 19, 2026 22:20
@priteau priteau enabled auto-merge February 19, 2026 22:20
@priteau priteau merged commit 2f258b8 into stackhpc/2024.1 Feb 19, 2026
4 checks passed
@priteau priteau deleted the upstream/2024.1-2026-02-19 branch February 19, 2026 22:32
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