[pve-devel] [PATCH qemu-server] fix #5284: diallow moving vm disks to storages not meant for images
Daniel Kral
d.kral at proxmox.com
Mon Sep 9 14:23:18 CEST 2024
On 9/6/24 18:44, Thomas Lamprecht wrote:
> Hmm, code wise it looks OK, but not so sure if this is the best place
> to check, I'd rather look into either moving this into the $load_and_check_move
> closure or into the PVE::QemuServer::clone_disk method, avoiding such an issue
> for all other call sites too, albeit one would need to evaluate those call sites
> if it does not break an existing usecase when disallowing this everywhere.
I will take a closer look into this issue, because - as you already
pointed out - there are some other commands that allocate disk images,
but do not check for the storage's content type(s).
In particular it was for moving disks and cloning disks / VMs, but I
will also check the behavior at other disk allocations with respect to
the context of the call sites.
> btw. did you check if containers are also affected by this bug?
I forgot to mention it, but I did. I discovered that `pve-container` has
a check in a "proxy" subroutine (`PVE::LXC::alloc_disk`) that will in
turn call `PVE::Storage::vdisk_alloc` if it's okay to do so.
I had a talk with Fiona about this and we agreed that it would make
sense to have a similar subroutine here as well. I will follow up with
another patch (series) for this in the following days.
More information about the pve-devel
mailing list