Commit a31b531c authored by Anish Ghulati's avatar Anish Ghulati Committed by Sean Christopherson
Browse files

KVM: SVM: Account scratch allocations used to decrypt SEV guest memory



Account the temp/scratch allocation used to decrypt unaligned debug
accesses to SEV guest memory, the allocation is very much tied to the
target VM.

Reported-by: default avatarMingwei Zhang <mizhang@google.com>
Signed-off-by: default avatarAnish Ghulati <aghulati@google.com>
Link: https://lore.kernel.org/r/20230113220923.2834699-1-aghulati@google.com


Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent 36b02567
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -813,7 +813,7 @@ static int __sev_dbg_decrypt_user(struct kvm *kvm, unsigned long paddr,
	if (!IS_ALIGNED(dst_paddr, 16) ||
	    !IS_ALIGNED(paddr,     16) ||
	    !IS_ALIGNED(size,      16)) {
		tpage = (void *)alloc_page(GFP_KERNEL | __GFP_ZERO);
		tpage = (void *)alloc_page(GFP_KERNEL_ACCOUNT | __GFP_ZERO);
		if (!tpage)
			return -ENOMEM;