Thread (4 messages) 4 messages, 3 authors, 2021-01-27

Re: [PATCH] Fix unsynchronized access to sev members through svm_register_enc_region

From: Sean Christopherson <seanjc@google.com>
Date: 2021-01-27 08:44:10
Also in: kvm, lkml

On Tue, Jan 26, 2021, Tom Lendacky wrote:
On 1/26/21 12:54 PM, Peter Gonda wrote:
quoted
sev_pin_memory assumes that callers hold the kvm->lock. This was true for
all callers except svm_register_enc_region since it does not originate
from svm_mem_enc_op. Also added lockdep annotation to help prevent
future regressions.
I'm not exactly sure what the problem is that your fixing? What is the
symptom that you're seeing?
svm_register_enc_region() calls sev_pin_memory() without holding kvm->lock.  If
userspace does multiple KVM_MEMORY_ENCRYPT_REG_REGION in parallel, it could
circumvent the rlimit(RLIMIT_MEMLOCK) check.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help