From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH] KVM: Allow userspace to specify memory to be used for private regions. Date: Wed, 17 Apr 2013 19:07:00 +0200 Message-ID: <516ED6B4.3020607@redhat.com> References: <516E8AC1.3050205@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm To: Andrew Honig Return-path: Received: from mx1.redhat.com ([209.132.183.28]:14971 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755790Ab3DQRHK (ORCPT ); Wed, 17 Apr 2013 13:07:10 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Il 17/04/2013 17:19, Andrew Honig ha scritto: > Freeing the memory in kvm_arch_free_memslot is as good as anywhere > else in KVM. The problem is that this memory is in the user space > process mm. This codepath could be called after the mm is destroyed > in the case of an process exit without closing the fd, which will > result in a panic on vm_munmap when it tries to access the mm. I think that's not a problem, the KVM file descriptor keeps the mm alive. > There's also the possibility that another process closes the fd and > messing with that processes memory map seems like it's asking for > trouble. You can check that current->mm == kvm->mm and leak the memory if they don't match. Paolo