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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <0ef9ccdc-3eae-f0b9-5304-8552cb94d166@de.ibm.com>
Date:   Mon, 3 Sep 2018 18:03:49 +0200
From:   Christian Borntraeger <borntraeger@...ibm.com>
To:     Nikita Leshenko <nikita.leshchenko@...cle.com>,
        fengguang.wu@...el.com
Cc:     akpm@...ux-foundation.org, linux-mm@...ck.org,
        dongx.peng@...el.com, jingqi.liu@...el.com, eddie.dong@...el.com,
        dave.hansen@...el.com, ying.huang@...el.com, bgregg@...flix.com,
        kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH 1/5] [PATCH 1/5] kvm: register in task_struct



On 09/03/2018 04:10 PM, Nikita Leshenko wrote:
> On September 2, 2018 5:21:15 AM, fengguang.wu@...el.com wrote:
>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>> index 8b47507faab5..0c483720de8d 100644
>> --- a/virt/kvm/kvm_main.c
>> +++ b/virt/kvm/kvm_main.c
>> @@ -3892,6 +3892,7 @@ static void kvm_uevent_notify_change(unsigned int type, struct kvm *kvm)
>>  	if (type == KVM_EVENT_CREATE_VM) {
>>  		add_uevent_var(env, "EVENT=create");
>>  		kvm->userspace_pid = task_pid_nr(current);
>> +		current->kvm = kvm;
> 
> Is it OK to store `kvm` on the task_struct? What if the thread that
> originally created the VM exits? From the documentation it seems
> like a VM is associated with an address space and not a specific
> thread, so maybe it should be stored on mm_struct?

Yes, ioctls accessing the kvm can happen from all threads.
> 
> From Documentation/virtual/kvm/api.txt:
>    Only run VM ioctls from the same process (address space) that was used
>    to create the VM.
> 
> -Nikita
>>  	} else if (type == KVM_EVENT_DESTROY_VM) {
>>  		add_uevent_var(env, "EVENT=destroy");
>>  	}
>> -- 
>> 2.15.0
>>
>>
>>
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ