Bug 1990134

Summary: Fix data corruption in nbdkit-cow-filter and nbdkit-cache-filter
Product: Red Hat Enterprise Linux 9 Reporter: Richard W.M. Jones <rjones>
Component: nbdkitAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED CURRENTRELEASE QA Contact: mxie <mxie>
Severity: high Docs Contact:
Priority: high    
Version: 9.0CC: eblake, juzhou, kkiwi, mxie, rjones, tyan, tzheng, virt-maint, vwu, xiaodwan
Target Milestone: betaKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nbdkit-1.26.3-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1990135 (view as bug list) Environment:
Last Closed: 2021-12-07 21:35:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1990135, 2040775    

Description Richard W.M. Jones 2021-08-04 19:56:37 UTC
Description of problem:

A data corrupter bug has been identified in the following
nbdkit filters:

https://libguestfs.org/nbdkit-cow-filter.1.html
https://libguestfs.org/nbdkit-cache-filter.1.html

It's quite subtle, but it affects modular virt-v2v and was
picked up by Ming Xie during testing.

The full bug is described in this link, as well as a simple way
to reproduce it, and the fix:

https://listman.redhat.com/archives/libguestfs/2021-August/msg00044.html

Version-Release number of selected component (if applicable):

All versions of nbdkit since 1.14 up to 1.27.4

How reproducible:

100%

Steps to Reproduce:
1. See link above.

Comment 3 mxie@redhat.com 2021-08-06 05:44:56 UTC
Reproduce the bug with nbdkit-1.26.2-2.el9.x86_64 

Steps to reproduce:

1. # nbdkit --filter=cow data "33 * 100000" --run 'nbdsh -u $uri -c "h.trim(100000, 0)" ; nbdcopy $uri - | hexdump -C'
00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00010000  21 21 21 21 21 21 21 21  21 21 21 21 21 21 21 21  |!!!!!!!!!!!!!!!!|
*
000186a0


Verify the bug with nbdkit-1.26.3-1.el9.x86_64

Steps:
1.# nbdkit --filter=cow data "33 * 100000" --run 'nbdsh -u $uri -c "h.trim(100000, 0)" ; nbdcopy $uri - | hexdump -C'
00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000186a0


Result:
   The bug has been fixed, so move the bug from ON_QA to VERIFIED