lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210331023025.2485960-1-seanjc@google.com>
Date:   Tue, 30 Mar 2021 19:30:23 -0700
From:   Sean Christopherson <seanjc@...gle.com>
To:     Paolo Bonzini <pbonzini@...hat.com>
Cc:     Sean Christopherson <seanjc@...gle.com>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Jim Mattson <jmattson@...gle.com>,
        Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH 0/2] KVM: Fix missing GFP_KERNEL_ACCOUNT usage

Fix (almost) all cases in KVM x86 where allocations that are tied to a           
task/VM are not correctly accounted.                                            
                                                                                
There are a handful of allocations in SEV code that I intentionally didn't
fix in this series.  I'm 95% certain those allocations can be eliminated
completely, changing them in this series only to delete them seemed
pointless.

The allocations in questions are for structs that are used to communicate
 with the PSP; they are temporary (freed in the same function that does
the allocation) and small (some are _tiny_, e.g. 4 bytes).   AFAICT, the
sole reason they are dynamically allocated is because the CCP driver uses
__pa() to retrieve the physical address that is passed to the PSP, and
__pa() does not work for vmalloc'd memory, which is in play when running
with CONFIG_VMAP_STACKS=y.  

I have functional code that uses a scratch buffer as a bounce buffer to
cleanly handle vmalloc'd memory in the CCP driver.  I'll hopefully get
that posted tomorrow.

Sean Christopherson (2):
  KVM: Account memory allocations for 'struct kvm_vcpu'
  KVM: x86: Account a variety of miscellaneous allocations

 arch/x86/kvm/svm/nested.c | 4 ++--
 arch/x86/kvm/svm/sev.c    | 6 +++---
 arch/x86/kvm/vmx/vmx.c    | 2 +-
 virt/kvm/kvm_main.c       | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

-- 
2.31.0.291.g576ba9dcdaf-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ