1. 31 Mar, 2017 9 commits
  2. 30 Mar, 2017 8 commits
  3. 29 Mar, 2017 17 commits
  4. 28 Mar, 2017 6 commits
    • Linus Torvalds's avatar
      Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost · fe82203b
      Linus Torvalds authored
      Pull virtio fixes from Michael Tsirkin:
       "Fixes to multiple issues in virtio.
      
        Most notably a regression fix for crashes reported by Fedora users.
        Hibernate is still reportedly broken, working on it"
      
      * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
        virtio_balloon: prevent uninitialized variable use
        virtio-balloon: use actual number of stats for stats queue buffers
        virtio_balloon: init 1st buffer in stats vq
        virtio_pci: fix out of bound access for msix_names
      fe82203b
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 050fc52d
      Linus Torvalds authored
      Pull KVM fixes from Paolo Bonzini:
       "All x86-specific, apart from some arch-independent syzkaller fixes"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        KVM: x86: cleanup the page tracking SRCU instance
        KVM: nVMX: fix nested EPT detection
        KVM: pci-assign: do not map smm memory slot pages in vt-d page tables
        KVM: kvm_io_bus_unregister_dev() should never fail
        KVM: VMX: Fix enable VPID conditions
        KVM: nVMX: Fix nested VPID vmx exec control
        KVM: x86: correct async page present tracepoint
        kvm: vmx: Flush TLB when the APIC-access address changes
        KVM: x86: use pic/ioapic destructor when destroy vm
        KVM: x86: check existance before destroy
        KVM: x86: clear bus pointer when destroyed
        KVM: Documentation: document MCE ioctls
        KVM: nVMX: don't reset kvm mmu twice
        PTP: fix ptr_ret.cocci warnings
        kvm: fix usage of uninit spinlock in avic_vm_destroy()
        KVM: VMX: downgrade warning on unexpected exit code
      050fc52d
    • Arnd Bergmann's avatar
      virtio_balloon: prevent uninitialized variable use · f0bb2d50
      Arnd Bergmann authored
      The latest gcc-7.0.1 snapshot reports a new warning:
      
      virtio/virtio_balloon.c: In function 'update_balloon_stats':
      virtio/virtio_balloon.c:258:26: error: 'events[2]' is used uninitialized in this function [-Werror=uninitialized]
      virtio/virtio_balloon.c:260:26: error: 'events[3]' is used uninitialized in this function [-Werror=uninitialized]
      virtio/virtio_balloon.c:261:56: error: 'events[18]' is used uninitialized in this function [-Werror=uninitialized]
      virtio/virtio_balloon.c:262:56: error: 'events[17]' is used uninitialized in this function [-Werror=uninitialized]
      
      This seems absolutely right, so we should add an extra check to
      prevent copying uninitialized stack data into the statistics.
      >From all I can tell, this has been broken since the statistics code
      was originally added in 2.6.34.
      
      Fixes: 9564e138 ("virtio: Add memory statistics reporting to the balloon driver (V4)")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLadi Prosek <lprosek@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      f0bb2d50
    • Ladi Prosek's avatar
      virtio-balloon: use actual number of stats for stats queue buffers · 9646b26e
      Ladi Prosek authored
      The virtio balloon driver contained a not-so-obvious invariant that
      update_balloon_stats has to update exactly VIRTIO_BALLOON_S_NR counters
      in order to send valid stats to the host. This commit fixes it by having
      update_balloon_stats return the actual number of counters, and its
      callers use it when pushing buffers to the stats virtqueue.
      
      Note that it is still out of spec to change the number of counters
      at run-time. "Driver MUST supply the same subset of statistics in all
      buffers submitted to the statsq."
      Suggested-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLadi Prosek <lprosek@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      9646b26e
    • Ladi Prosek's avatar
      virtio_balloon: init 1st buffer in stats vq · fc865322
      Ladi Prosek authored
      When init_vqs runs, virtio_balloon.stats is either uninitialized or
      contains stale values. The host updates its state with garbage data
      because it has no way of knowing that this is just a marker buffer
      used for signaling.
      
      This patch updates the stats before pushing the initial buffer.
      
      Alternative fixes:
      * Push an empty buffer in init_vqs. Not easily done with the current
        virtio implementation and violates the spec "Driver MUST supply the
        same subset of statistics in all buffers submitted to the statsq".
      * Push a buffer with invalid tags in init_vqs. Violates the same
        spec clause, plus "invalid tag" is not really defined.
      
      Note: the spec says:
      	When using the legacy interface, the device SHOULD ignore all values in
      	the first buffer in the statsq supplied by the driver after device
      	initialization. Note: Historically, drivers supplied an uninitialized
      	buffer in the first buffer.
      
      Unfortunately QEMU does not seem to implement the recommendation
      even for the legacy interface.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarLadi Prosek <lprosek@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      fc865322
    • Jason Wang's avatar
      virtio_pci: fix out of bound access for msix_names · de85ec8b
      Jason Wang authored
      Fedora has received multiple reports of crashes when running
      4.11 as a guest
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1430297
      https://bugzilla.redhat.com/show_bug.cgi?id=1434462
      https://bugzilla.kernel.org/show_bug.cgi?id=194911
      https://bugzilla.redhat.com/show_bug.cgi?id=1433899
      
      The crashes are not always consistent but they are generally
      some flavor of oops or GPF in virtio related code. Multiple people
      have done bisections (Thank you Thorsten Leemhuis and
      Richard W.M. Jones) and found this commit to be at fault
      
      07ec5148 is the first bad commit
      commit 07ec5148
      Author: Christoph Hellwig <hch@lst.de>
      Date:   Sun Feb 5 18:15:19 2017 +0100
      
          virtio_pci: use shared interrupts for virtqueues
      
      The issue seems to be an out of bounds access to the msix_names
      array corrupting kernel memory.
      
      Fixes: 07ec5148 ("virtio_pci: use shared interrupts for virtqueues")
      Reported-by: default avatarLaura Abbott <labbott@redhat.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Tested-by: default avatarRichard W.M. Jones <rjones@redhat.com>
      Tested-by: default avatarThorsten Leemhuis <linux@leemhuis.info>
      de85ec8b