Skip to content
Snippets Groups Projects
  1. Aug 12, 2016
  2. Jul 24, 2016
  3. Jul 22, 2016
  4. Jul 18, 2016
  5. Jul 15, 2016
  6. Jul 14, 2016
    • Al Viro's avatar
      KVM: don't use anon_inode_getfd() before possible failures · 506cfba9
      Al Viro authored
      
      Once anon_inode_getfd() has succeeded, it's impossible to undo
      in a clean way and no, sys_close() is not usable in such cases.
      Use anon_inode_getfile() and get_unused_fd_flags() to get struct file
      and descriptor and do *not* install the file into the descriptor table
      until after the last possible failure exit.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      506cfba9
    • Paolo Bonzini's avatar
      Revert "KVM: release anon file in failure path of vm creation" · 7964218c
      Paolo Bonzini authored
      
      This reverts commit 77ecc085fed1af1000ca719522977b960aa6da52.
      
      Al Viro colorfully says: "You should *NEVER* use sys_close() on failure
      exit paths like that.  Moreover, this kvm_put_kvm() becomes a double-put,
      since closing the damn file will drop that reference to kvm.  Please,
      revert.  anon_inode_getfd() should be used only when there's no possible
      failures past its call".
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      7964218c
    • Liu Shuo's avatar
      KVM: release anon file in failure path of vm creation · 2be5b3f6
      Liu Shuo authored
      
      The failure of create debugfs of VM will return directly without release
      the anon file. It will leak memory and file descriptors, even through
      be not serious.
      
      Signed-off-by: default avatarLiu Shuo <shuo.a.liu@intel.com>
      Fixes: 536a6f88
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      2be5b3f6
    • Jim Mattson's avatar
      KVM: nVMX: Fix memory corruption when using VMCS shadowing · 2f1fe811
      Jim Mattson authored
      
      When freeing the nested resources of a vcpu, there is an assumption that
      the vcpu's vmcs01 is the current VMCS on the CPU that executes
      nested_release_vmcs12(). If this assumption is violated, the vcpu's
      vmcs01 may be made active on multiple CPUs at the same time, in
      violation of Intel's specification. Moreover, since the vcpu's vmcs01 is
      not VMCLEARed on every CPU on which it is active, it can linger in a
      CPU's VMCS cache after it has been freed and potentially
      repurposed. Subsequent eviction from the CPU's VMCS cache on a capacity
      miss can result in memory corruption.
      
      It is not sufficient for vmx_free_vcpu() to call vmx_load_vmcs01(). If
      the vcpu in question was last loaded on a different CPU, it must be
      migrated to the current CPU before calling vmx_load_vmcs01().
      
      Signed-off-by: default avatarJim Mattson <jmattson@google.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      2f1fe811
Loading