Re: [PATCH] qcow2: Don't crash qemu-img info with missing crypto header

2025-03-18 Thread Daniel P . Berrangé
On Tue, Mar 18, 2025 at 09:11:43PM +0100, Kevin Wolf wrote: > qcow2_refresh_limits() assumes that s->crypto is non-NULL whenever > bs->encrypted is true. This is actually not the case: qcow2_do_open() > allows to open an image with a missing crypto header for BDRV_O_NO_IO, > and then bs->encrypted

[PATCH] qcow2: Don't crash qemu-img info with missing crypto header

2025-03-18 Thread Kevin Wolf
qcow2_refresh_limits() assumes that s->crypto is non-NULL whenever bs->encrypted is true. This is actually not the case: qcow2_do_open() allows to open an image with a missing crypto header for BDRV_O_NO_IO, and then bs->encrypted is true, but s->crypto is still NULL. It doesn't make sense to open