Skip to contentSkip to conversation

dom0 vs non-dom0 differentiation inside Xen hypervisor

DISCUSSION Peter Teoh 3 participants 3 messages Sep 3, 2007

lore
Share & tools
lore

Peter Teoh

author
#0 lore raw

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? Access control should be done from the hypervisor side,
so any existing dom0 checking (CONFIG_XEN_PRIVILEGED_GUEST compilation option - done from the dom0 side) seems like pointless, because another domU can always modify its own kernel binaries to achieve all the features what CONFIG_XEN_PRIVILEGED_GUEST restrict - be it Windows XP or Linux.

Please enlighten us.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 10 lines · Peter Teoh

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.

#2 lore raw
In reply to Peter Teoh

Privileged hypercalls are all protected by IS_PRIV() checks on the current domain.

See common/sysctl.c and common/domctl.c, for example.

-- Keir

Quoted 15 lines · Peter Teoh

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? Access control should be done from the hypervisor side, so
any existing dom0 checking (CONFIG_XEN_PRIVILEGED_GUEST compilation option - done from the dom0 side) seems like pointless, because another domU can always modify its own kernel binaries to achieve all the features what CONFIG_XEN_PRIVILEGED_GUEST restrict - be it Windows XP or Linux.

Quoted 7 lines

Please enlighten us.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel