aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-08-14 09:56:46 +0100
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-08-14 09:56:46 +0100
commit10ef7a91b5a8cb8c58903c60e2dd16ed490b3bcf (patch)
treeb45f083ea04f84fe3c389fabefc2f6c959e2aaf4
parent807d8048a2e07509b79ebc20826f6ba115f6de2c (diff)
downloadxen-10ef7a91b5a8cb8c58903c60e2dd16ed490b3bcf.tar.gz
xen-10ef7a91b5a8cb8c58903c60e2dd16ed490b3bcf.tar.bz2
xen-10ef7a91b5a8cb8c58903c60e2dd16ed490b3bcf.zip
xen: Do not accept DOMID_SELF as input to DOMCTL_getdomaininfo.
This was screwing up callers that loop on getdomaininfo(), if there was a domain with domid DOMID_FIRST_RESERVED-1 (== DOMID_SELF-1). They would see DOMID_SELF-1, then look up DOMID_SELF, which has domid 0 of course, and then start their domain-finding loop all over again! Found by Kouya Shimura <kouya@jp.fujitsu.com>. Thanks! Signed-off-by: Keir Fraser <keir@xensource.com>
-rw-r--r--xen/common/domctl.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 09a1e84d98..5d29667b7c 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -463,19 +463,13 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
case XEN_DOMCTL_getdomaininfo:
{
struct domain *d;
- domid_t dom;
-
- dom = op->domain;
- if ( dom == DOMID_SELF )
- dom = current->domain->domain_id;
+ domid_t dom = op->domain;
rcu_read_lock(&domlist_read_lock);
for_each_domain ( d )
- {
if ( d->domain_id >= dom )
break;
- }
if ( d == NULL )
{