← Back to team overview

kernel-packages team mailing list archive

[Bug 1292234] Re: qcow2 image corruption on non-extent filesystems (ext3)

 

This bug was fixed in the package linux - 3.13.0-70.113

---------------
linux (3.13.0-70.113) trusty; urgency=low

  [ Luis Henriques ]

  * Release Tracking Bug
    - LP: #1516733

  [ Upstream Kernel Changes ]

  * arm64: errata: use KBUILD_CFLAGS_MODULE for erratum #843419
    - LP: #1516682

linux (3.13.0-69.112) trusty; urgency=low

  [ Luis Henriques ]

  * Release Tracking Bug
    - LP: #1514858

  [ Joseph Salisbury ]

  * SAUCE: storvsc: use small sg_tablesize on x86
    - LP: #1495983

  [ Luis Henriques ]

  * [Config] updateconfigs after 3.13.11-ckt28 and 3.13.11-ckt29 stable
    updates

  [ Upstream Kernel Changes ]

  * ext4: fix indirect punch hole corruption
    - LP: #1292234
  * x86/hyperv: Mark the Hyper-V TSC as unstable
    - LP: #1498206
  * namei: permit linking with CAP_FOWNER in userns
    - LP: #1498162
  * iwlwifi: pci: add a few more PCI subvendor IDs for the 7265 series
    - LP: #1510616
  * Drivers: hv: vmbus: Increase the limit on the number of pfns we can
    handle
    - LP: #1495983
  * sctp: fix race on protocol/netns initialization
    - LP: #1514832
  * [media] v4l: omap3isp: Fix sub-device power management code
    - LP: #1514832
  * [media] rc-core: fix remove uevent generation
    - LP: #1514832
  * xtensa: fix threadptr reload on return to userspace
    - LP: #1514832
  * ARM: OMAP2+: DRA7: clockdomain: change l4per2_7xx_clkdm to SW_WKUP
    - LP: #1514832
  * mac80211: enable assoc check for mesh interfaces
    - LP: #1514832
  * PCI: Add dev_flags bit to access VPD through function 0
    - LP: #1514832
  * PCI: Add VPD function 0 quirk for Intel Ethernet devices
    - LP: #1514832
  * usb: dwc3: ep0: Fix mem corruption on OUT transfers of more than 512
    bytes
    - LP: #1514832
  * serial: 8250_pci: Add support for Pericom PI7C9X795[1248]
    - LP: #1514832
  * KVM: MMU: fix validation of mmio page fault
    - LP: #1514832
  * auxdisplay: ks0108: fix refcount
    - LP: #1514832
  * devres: fix devres_get()
    - LP: #1514832
  * iio: adis16400: Fix adis16448 gyroscope scale
    - LP: #1514832
  * iio: Add inverse unit conversion macros
    - LP: #1514832
  * iio: adis16480: Fix scale factors
    - LP: #1514832
  * iio: industrialio-buffer: Fix iio_buffer_poll return value
    - LP: #1514832
  * iio: event: Remove negative error code from iio_event_poll
    - LP: #1514832
  * NFSv4: don't set SETATTR for O_RDONLY|O_EXCL
    - LP: #1514832
  * unshare: Unsharing a thread does not require unsharing a vm
    - LP: #1514832
  * ASoC: adav80x: Remove .read_flag_mask setting from
    adav80x_regmap_config
    - LP: #1514832
  * drivers: usb :fsl: Implement Workaround for USB Erratum A007792
    - LP: #1514832
  * drivers: usb: fsl: Workaround for USB erratum-A005275
    - LP: #1514832
  * serial: 8250: don't bind to SMSC IrCC IR port
    - LP: #1514832
  * staging: comedi: adl_pci7x3x: fix digital output on PCI-7230
    - LP: #1514832
  * blk-mq: fix buffer overflow when reading sysfs file of 'pending'
    - LP: #1514832
  * xtensa: fix kernel register spilling
    - LP: #1514832
  * NFS: nfs_set_pgio_error sometimes misses errors
    - LP: #1514832
  * NFS: Fix a NULL pointer dereference of migration recovery ops for v4.2
    client
    - LP: #1514832
  * usb: host: ehci-sys: delete useless bus_to_hcd conversion
    - LP: #1514832
  * USB: symbolserial: Use usb_get_serial_port_data
    - LP: #1514832
  * USB: ftdi_sio: Added custom PID for CustomWare products
    - LP: #1514832
  * HID: usbhid: Fix the check for HID_RESET_PENDING in hid_io_error
    - LP: #1514832
  * eCryptfs: Invalidate dcache entries when lower i_nlink is zero
    - LP: #1514832
  * libxfs: readahead of dir3 data blocks should use the read verifier
    - LP: #1514832
  * xfs: Fix xfs_attr_leafblock definition
    - LP: #1514832
  * arm64: kconfig: Move LIST_POISON to a safe value
    - LP: #1514832
  * Btrfs: check if previous transaction aborted to avoid fs corruption
    - LP: #1514832
  * DRM - radeon: Don't link train DisplayPort on HPD until we get the dpcd
    - LP: #1514832
  * rtlwifi: rtl8192cu: Add new device ID
    - LP: #1514832
  * rtlwifi: rtl8192cu: Add new device ID
    - LP: #1514832
  * of/address: Don't loop forever in of_find_matching_node_by_address().
    - LP: #1514832
  * drivercore: Fix unregistration path of platform devices
    - LP: #1514832
  * xfs: return errors from partial I/O failures to files
    - LP: #1514832
  * IB/qib: Change lkey table allocation to support more MRs
    - LP: #1514832
  * tg3: Fix temperature reporting
    - LP: #1514832
  * drm/i915: Always mark the object as dirty when used by the GPU
    - LP: #1514832
  * Add radeon suspend/resume quirk for HP Compaq dc5750.
    - LP: #1514832
  * IB/uverbs: reject invalid or unknown opcodes
    - LP: #1514832
  * hpfs: update ctime and mtime on directory modification
    - LP: #1514832
  * Input: evdev - do not report errors form flush()
    - LP: #1514832
  * crypto: ghash-clmulni: specify context size for ghash async algorithm
    - LP: #1514832
  * fs: create and use seq_show_option for escaping
    - LP: #1514832
  * ALSA: hda - Enable headphone jack detect on old Fujitsu laptops
    - LP: #1514832
  * ALSA: hda - Use ALC880_FIXUP_FUJITSU for FSC Amilo M1437
    - LP: #1514832
  * scsi: fix scsi_error_handler vs. scsi_host_dev_release race
    - LP: #1514832
  * parisc: Use double word condition in 64bit CAS operation
    - LP: #1514832
  * vmscan: fix increasing nr_isolated incurred by putback unevictable
    pages
    - LP: #1514832
  * hfs,hfsplus: cache pages correctly between bnode_create and bnode_free
    - LP: #1514832
  * hfs: fix B-tree corruption after insertion at position 0
    - LP: #1514832
  * drm/qxl: validate monitors config modes
    - LP: #1514832
  * PCI: Fix TI816X class code quirk
    - LP: #1514832
  * x86/mm: Initialize pmd_idx in page_table_range_init_count()
    - LP: #1514832
  * powerpc/rtas: Introduce rtas_get_sensor_fast() for IRQ handlers
    - LP: #1514832
  * jbd2: avoid infinite loop when destroying aborted journal
    - LP: #1514832
  * clk: versatile: off by one in clk_sp810_timerclken_of_get()
    - LP: #1514832
  * usb: gadget: m66592-udc: forever loop in set_feature()
    - LP: #1514832
  * windfarm: decrement client count when unregistering
    - LP: #1514832
  * perf hists: Update the column width for the "srcline" sort key
    - LP: #1514832
  * batman-adv: Make DAT capability changes atomic
    - LP: #1514832
  * batman-adv: Make NC capability changes atomic
    - LP: #1514832
  * powerpc/mm: Fix pte_pagesize_index() crash on 4K w/64K hash
    - LP: #1514832
  * perf stat: Get correct cpu id for print_aggr
    - LP: #1514832
  * IB/mlx4: Fix potential deadlock when sending mad to wire
    - LP: #1514832
  * IB/mlx4: Forbid using sysfs to change RoCE pkeys
    - LP: #1514832
  * IB/mlx4: Use correct SL on AH query under RoCE
    - LP: #1514832
  * IB/uverbs: Fix race between ib_uverbs_open and remove_one
    - LP: #1514832
  * mmc: core: fix race condition in mmc_wait_data_done
    - LP: #1514832
  * ipv6: fix exthdrs offload registration in out_rt path
    - LP: #1514832
  * task_work: remove fifo ordering guarantee
    - LP: #1514832
  * scsi_dh: fix randconfig build error
    - LP: #1514832
  * fs: if a coredump already exists, unlink and recreate with O_EXCL
    - LP: #1514832
  * Linux 3.13.11-ckt28
    - LP: #1514832
  * sctp: donot reset the overall_error_count in SHUTDOWN_RECEIVE state
    - LP: #1514853
  * KEYS: Fix race between key destruction and finding a keyring by name
    - LP: #1514853
  * KEYS: Fix crash when attempt to garbage collect an uninstantiated
    keyring
    - LP: #1514853
  * KEYS: Don't permit request_key() to construct a new keyring
    - LP: #1514853
  * net: Fix skb csum races when peeking
    - LP: #1500810
  * [stable-only] net: add length argument to
    skb_copy_and_csum_datagram_iovec
    - LP: #1514853
  * spi: spi-pxa2xx: Check status register to determine if SSSR_TINT is
    disabled
    - LP: #1514853
  * spi: Fix documentation of spi_alloc_master()
    - LP: #1514853
  * ARM: 8429/1: disable GCC SRA optimization
    - LP: #1514853
  * powerpc/MSI: Fix race condition in tearing down MSI interrupts
    - LP: #1514853
  * CIFS: fix type confusion in copy offload ioctl
    - LP: #1514853
  * hwmon: (nct6775) Swap STEP_UP_TIME and STEP_DOWN_TIME registers for
    most chips
    - LP: #1514853
  * USB: option: add ZTE PIDs
    - LP: #1514853
  * x86/apic: Serialize LVTT and TSC_DEADLINE writes
    - LP: #1514853
  * Btrfs: fix read corruption of compressed and shared extents
    - LP: #1514853
  * btrfs: skip waiting on ordered range for special files
    - LP: #1514853
  * arm64: head.S: initialise mdcr_el2 in el2_setup
    - LP: #1514853
  * kvm: fix zero length mmio searching
    - LP: #1514853
  * iser-target: remove command with state ISTATE_REMOVE
    - LP: #1514853
  * ARM: fix Thumb2 signal handling when ARMv6 is enabled
    - LP: #1514853
  * powerpc/mm: Recompute hash value after a failed update
    - LP: #1514853
  * x86/platform: Fix Geode LX timekeeping in the generic x86 build
    - LP: #1514853
  * arm64: compat: fix vfp save/restore across signal handlers in
    big-endian
    - LP: #1514853
  * arm64: errata: add module build workaround for erratum #843419
    - LP: #1514853
  * arm64: KVM: Disable virtual timer even if the guest is not using it
    - LP: #1514853
  * arm: KVM: Disable virtual timer even if the guest is not using it
    - LP: #1514853
  * KVM: x86: trap AMD MSRs for the TSeg base and mask
    - LP: #1514853
  * usb: Use the USB_SS_MULT() macro to get the burst multiplier.
    - LP: #1514853
  * xhci: give command abortion one more chance before killing xhci
    - LP: #1514853
  * usb: xhci: Clear XHCI_STATE_DYING on start
    - LP: #1514853
  * xhci: change xhci 1.0 only restrictions to support xhci 1.1
    - LP: #1514853
  * disabling oplocks/leases via module parm enable_oplocks broken for SMB3
    - LP: #1514853
  * cifs: use server timestamp for ntlmv2 authentication
    - LP: #1514853
  * x86/paravirt: Replace the paravirt nop with a bona fide empty function
    - LP: #1514853
  * x86/nmi/64: Fix a paravirt stack-clobbering bug in the NMI code
    - LP: #1514853
  * ASoC: pxa: pxa2xx-ac97: fix dma requestor lines
    - LP: #1514853
  * drm/qxl: only report first monitor as connected if we have no state
    - LP: #1514853
  * PCI: Fix devfn for VPD access through function 0
    - LP: #1514853
  * PCI: Use function 0 VPD for identical functions, regular VPD for others
    - LP: #1514853
  * perf header: Fixup reading of HEADER_NRCPUS feature
    - LP: #1514853
  * netfilter: nft_compat: skip family comparison in case of NFPROTO_UNSPEC
    - LP: #1514853
  * ASoC: fix broken pxa SoC support
    - LP: #1514853
  * ARM: dts: omap5-uevm.dts: fix i2c5 pinctrl offsets
    - LP: #1514853
  * vxlan: set needed headroom correctly
    - LP: #1514853
  * usbnet: Get EVENT_NO_RUNTIME_PM bit before it is cleared
    - LP: #1514853
  * net/ipv6: Correct PIM6 mrt_lock handling
    - LP: #1514853
  * netlink, mmap: transform mmap skb into full skb on taps
    - LP: #1514853
  * openvswitch: Zero flows on allocation.
    - LP: #1514853
  * fib_rules: fix fib rule dumps across multiple skbs
    - LP: #1514853
  * Btrfs: update fix for read corruption of compressed and shared extents
    - LP: #1514853
  * Linux 3.13.11-ckt29
    - LP: #1514853

 -- Luis Henriques <luis.henriques@xxxxxxxxxxxxx>  Mon, 16 Nov 2015
17:47:36 +0000

** Changed in: linux (Ubuntu Trusty)
       Status: Fix Committed => Fix Released

** Changed in: linux (Ubuntu Trusty)
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1292234

Title:
  qcow2 image corruption on non-extent filesystems (ext3)

Status in linux package in Ubuntu:
  Fix Released
Status in linux-lts-utopic package in Ubuntu:
  Invalid
Status in linux source package in Trusty:
  Fix Released
Status in linux-lts-utopic source package in Trusty:
  Fix Released
Status in linux source package in Vivid:
  Fix Released

Bug description:
  [Impact]
  Users of non-extent ext4 filesystems (ext4 ^extents, or ext3 w/ CONFIG_EXT4_USE_FOR_EXT23=y) can encounter data corruption when using fallocate with FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE flags.

  [Test Case]
  1) Setup ext4 ^extents, or ext3 filesystem with CONFIG_EXT4_USE_FOR_EXT23=y
  2) Create and install a VM using a qcow2 image and store the file on the filesystem
  3) Snapshot the image with qemu-img
  4) Boot the image and do some disk operations (fio,etc)
  5) Shutdown image and delete snapshot
  6) Repeat 3-5 until VM no longer boots due to image corruption, generally this takes a few iterations depending on disk operations.

  [Fix]
  commit 6f30b7e37a8239f9d27db626a1d3427bc7951908 upstream

  This has been discussed upstream here:
  http://marc.info/?l=linux-fsdevel&m=142264422605440&w=2

  A temporary fix would be to disable punch_hole for non-extent
  filesystem. This is how the normal ext3 module handles this and it is
  up to userspace to handle the failure. I've run this with the test
  case and was able to run for 600 iterations over 3 days where most
  failures occur within the first 2-20 iterations.

  diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
  index 5653fa4..e14cdfe 100644
  --- a/fs/ext4/inode.c
  +++ b/fs/ext4/inode.c
  @@ -3367,6 +3367,10 @@ int ext4_punch_hole(struct inode *inode, loff_t
  offset, loff_t length)
    unsigned int credits;
    int ret = 0;

  +	/* EXTENTS required */
  +	if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
  +		return -EOPNOTSUPP;
  +
    if (!S_ISREG(inode->i_mode))
     return -EOPNOTSUPP;

  --

  The security team uses a tool (http://bazaar.launchpad.net/~ubuntu-
  bugcontrol/ubuntu-qa-tools/master/view/head:/vm-tools/uvt) that uses
  libvirt snapshots quite a bit. I noticed after upgrading to trusty
  some time ago that qemu 1.7 (and the qemu 2.0 in the candidate ppa)
  has had stability problems such that the disk/partition table seems to
  be corrupted after removing a libvirt snapshot and then creating
  another with the same name. I don't have a very simple reproducer, but
  had enough that hallyn suggested I file a bug. First off:

  qemu-kvm 2.0~git-20140307.4c288ac-0ubuntu2

  $ cat /proc/version_signature
  Ubuntu 3.13.0-16.36-generic 3.13.5

  $ qemu-img info ./forhallyn-trusty-amd64.img
  image: ./forhallyn-trusty-amd64.img
  file format: qcow2
  virtual size: 8.0G (8589934592 bytes)
  disk size: 4.0G
  cluster_size: 65536
  Format specific information:
      compat: 0.10

  Steps to reproduce:
  1. create a virtual machine. For a simplified reproducer, I used virt-manager with:
    OS type: Linux
    Version: Ubuntu 14.04
    Memory: 768
    CPUs: 1

    Select managed or existing (Browse, new volume)
      Create a new storage volume:
        qcow2
        Max capacity: 8192
        Allocation: 0

    Advanced:
      NAT
      kvm
      x86_64
      firmware: default

  2. install a VM. I used trusty-desktop-amd64.iso from Jan 23 since it
  seems like I can hit the bug more reliably if I have lots of updates
  in a dist-upgrade. I have seen this with lucid-trusty guests that are
  i386 and amd64. After the install, reboot and then cleanly shutdown

  3. Backup the image file somewhere since steps 1 and 2 take a while :)

  4. Execute the following commands which are based on what our uvt tool
  does:

  $ virsh snapshot-create-as forhallyn-trusty-amd64 pristine "uvt snapshot"
  $ virsh snapshot-current --name forhallyn-trusty-amd64
  pristine
  $ virsh start forhallyn-trusty-amd64
  $ virsh snapshot-list forhallyn-trusty-amd64 # this is showing as shutoff after start, this might be different with qemu 1.5

  in guest:
  sudo apt-get update
  sudo apt-get dist-upgrade
  780 upgraded...
  shutdown -h now

  $ virsh snapshot-delete forhallyn-trusty-amd64 pristine --children
  $ virsh snapshot-create-as forhallyn-trusty-amd64 pristine "uvt snapshot"

  $ virsh start forhallyn-trusty-amd64 # this command works, but there
  is often disk corruption

  The idea behind the above is to create a new VM with a pristine
  snapshot that we could revert later if we wanted. Instead, we boot the
  VM, run apt-get dist-upgrade, cleanly shutdown and then remove the old
  'pristine' snapshot and create a new 'pristine' snapshot. The
  intention is to update the VM and the pristine snapshot so that when
  we boot the next time, we boot from the updated VM and can revert back
  to the updated VM.

  After running 'virsh start' after doing snapshot-delete/snapshot-
  create-as, the disk may be corrupted. This can be seen with grub
  failing to find .mod files, the kernel not booting, init failing, etc.

  This does not seem to be related to the machine type used. Ie, pc-
  i440fx-1.5, pc-i440fx-1.7 and pc-i440fx-2.0 all fail with qemu 2.0,
  pc-i440fx-1.5 and pc-i440fx-1.7 fail with qemu 1.7 and pc-i440fx-1.5
  works fine with qemu 1.5.

  Only workaround I know if is to downgrade qemu to 1.5.0+dfsg-
  3ubuntu5.4 from Ubuntu 13.10.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1292234/+subscriptions