From: Shiva V Subject: Re: Integrity in untrusted environments Date: Fri, 1 Aug 2014 15:43:19 +0000 (UTC) Message-ID: References: <53DB38B6.1080405@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: kvm@vger.kernel.org Return-path: Received: from plane.gmane.org ([80.91.229.3]:53483 "EHLO plane.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754171AbaHAPne (ORCPT ); Fri, 1 Aug 2014 11:43:34 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XDEzV-0004Bh-A9 for kvm@vger.kernel.org; Fri, 01 Aug 2014 17:43:33 +0200 Received: from 192.12.88.154 ([192.12.88.154]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 01 Aug 2014 17:43:33 +0200 Received: from shivaramakrishnan740 by 192.12.88.154 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 01 Aug 2014 17:43:33 +0200 Sender: kvm-owner@vger.kernel.org List-ID: Paolo Bonzini redhat.com> writes > Hello, I am exploring ideas to implement a service inside a virtual machine on untrusted hypervisors under current cloud infrastructures. Particularly, I am interested how one can verify the integrity of the service in an environment where hypervisor is not trusted. This is my setup. 1. I have two virtual machines. (Normal client VM's). 2. VM-A is executing a service and VM-B wants to verify its integrity. 3. Both are executing on untrusted hypervisor. Though, Intel SGX will solve this, by using the concept of enclaves, its not publicly available yet. One could also use SMM to verify the integrity. But since this is time based approach, one could easily exploit between the time window. I was drilling down this idea, We know Write xor Execute Memory Protection Scheme. Using this idea,If we could lock down the VM-A memory pages where the service is running and also corresponding page-table entries, then have a handler code that temporarily unlocks them for legitimate updates, then one could verify the integrity of the service running. > You can make a malicious hypervisor that makes all executable pages also writable, but hides the fact to the running process. But really, if you control the hypervisor you can just write to guest memory as you wish. SMM will be emulated by the hypervisor. If the hypervisor is untrusted, you cannot solve _everything_. For the third time, what attacks are you trying to protect from? Paolo Thanks Paolo, I was considering all critical attacks possible that a client virtual machine could have under the untrusted hypervisor scenarios. For example,Memory based,Hypervisor based and few major side channel attacks. I am ignoring the network based attacks for the time being. And one more question to your reply. I did'nt understand as to what you were trying to describe here "You can make a malicious hypervisor that makes all executable pages also writable, but hides the fact to the running process. But really, if you control the hypervisor you can just write to guest memory as you wish" This is my understanding, Correct me if I am wrong here. If we lock down the code pages of genuine hypervisor as I discussed before, Isn't it sufficent? Because essentially hypervisor is the one that handles the traps from the virtual machines for execution.So, even if the hypervisor wishes to write to the client virtual machine, it will be captured since the memory pages of the hypervisor is locked down and is essentially non bypassable.