]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: create images with a private umask during qemu-img create/convert master v12.6.0-rc2
authorHE WEI(ギカク) <skyexpoc@gmail.com>
Tue, 28 Jul 2026 16:30:57 +0000 (17:30 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 30 Jul 2026 10:21:28 +0000 (11:21 +0100)
commit69335a484768d550854da1133d5490074695e825
treee625bfec4958bad953bd6f7021eed846367dc3d2
parent801160fd414ca2cc402bc01ead09b7ed4c3b8f5b
storage: create images with a private umask during qemu-img create/convert

On the local (non-NETFS) path virStorageBackendCreateExecCommand() ran
qemu-img with umask 0, so the destination image was created
world-readable (0644) and the full source disk was written into it
before libvirt tightened the mode with a later chmod(). This is the same
class as CVE-2025-13193; apply the same fix by setting a 0077 umask so
qemu-img creates the file private from the start.

Fixes: CVE-2026-63623
Reported-by: HE WEI(ギカク) <skyexpoc@gmail.com>
Signed-off-by: HE WEI(ギカク) <skyexpoc@gmail.com>
[DB: merged the two virCommandSetUmask to one]
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/storage/storage_util.c