[Libguestfs] luks filter breaks zeroing

Eric Blake eblake at redhat.com
Fri Jun 10 11:47:44 UTC 2022


On Fri, Jun 10, 2022 at 09:40:48AM +0100, Richard W.M. Jones wrote:
> 
> (More of a note to self to investigate)
> 
> $ qemu-img create -f luks --object secret,data=LETMEPASS,id=sec0 -o key-secret=sec0 encrypted.img 100M
> Formatting 'encrypted.img', fmt=luks size=104857600 key-secret=sec0
> $ rm -f data.img
> $ truncate -s 100M data.img
> $ nbdkit file encrypted.img --filter=luks passphrase=LETMEPASS --run 'nbdcopy data.img $nbd'
> nbdkit: backend.c:718: backend_zero: Assertion `c->can_zero > NBDKIT_ZERO_NONE' failed.
> write at offset 0 failed: Transport endpoint is not connected
> nbdkit: nbdkit command was killed by signal 6

It's a bug in server/backend.c:backend_zero() for not checking and
handling ZERO_EMULATE by calling into pwrite instead.  I'll fix it
shortly.  (I seem to recall that I had ZERO_EMULATE working when I
first introduced it; I'll have to check git history and see if a
refactoring accidentally lost it...)

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


More information about the Libguestfs mailing list