From: Ian Campbell Subject: Re: dom0 vs non-dom0 differentiation inside Xen hypervisor Date: Mon, 03 Sep 2007 07:15:01 +0100 Message-ID: <1188800101.22173.10.camel@localhost.localdomain> References: <804dabb00709021745uad08fe2m7fb8e7acaab9de45@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <804dabb00709021745uad08fe2m7fb8e7acaab9de45@mail.gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Peter Teoh Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Mon, 2007-09-03 at 08:45 +0800, Peter Teoh wrote: > In some parts of IA64 I can see that domain==dom0 checking is done, > but in all of x86 - I have yet to find a proper checking that the > hypercalls comes from a dom0 domain instead of any other domain. > > Theoretically, this means that any domain (PV or HVM) can always > modify its own kernel binary and then make a direct hypercall (via int > 0x82 or SYSENTER) into the hypervisor, executing domain controller > commands like create domain etc. > > Is this possible? No. The checks you are talking about are done using IS_PRIV() rather than comparing directly domain==dom0. e.g. from do_domctl and do_sysctl: if ( !IS_PRIV(current->domain) ) return -EPERM; In practise only dom0 passes this test. Cheers, Ian.