WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Currently, it is possible to set the mem-max value to va

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Currently, it is possible to set the mem-max value to value lower than
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 15 Apr 2006 13:58:08 +0000
Delivery-date: Sat, 15 Apr 2006 06:59:01 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 5102cd121a360fd38e9792356a62f187599ef9ba
# Parent  1fe63743a147f0305415e4bb8629f1e78ed3e754
Currently, it is possible to set the mem-max value to value lower than
what has been currently allocated to the domain causing the kernel to
crash. This patch validates the value passed in and prevents setting the
value below the current allocation level.

Signed-off-by: ksrinivasan@xxxxxxxxxx

diff -r 1fe63743a147 -r 5102cd121a36 xen/common/dom0_ops.c
--- a/xen/common/dom0_ops.c     Fri Apr 14 20:22:09 2006
+++ b/xen/common/dom0_ops.c     Sat Apr 15 08:47:55 2006
@@ -585,9 +585,16 @@
         d = find_domain_by_id(op->u.setdomainmaxmem.domain);
         if ( d != NULL )
         {
-            d->max_pages = op->u.setdomainmaxmem.max_memkb >> (PAGE_SHIFT-10);
-            put_domain(d);
-            ret = 0;
+            unsigned long new_max;
+            new_max = op->u.setdomainmaxmem.max_memkb >> (PAGE_SHIFT-10);
+            if (new_max < d->tot_pages) 
+                ret = -EINVAL;
+            else 
+            {  
+                d->max_pages = new_max;
+                ret = 0;
+            }
+            put_domain(d);
         }
     }
     break;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>