From: Juergen Gross Subject: [PATCH] Strict parameter checking for cpupool operations Date: Tue, 08 Feb 2011 07:58:04 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5760760669357529453==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --===============5760760669357529453== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Some cpupool actions didn't check the cpupool_id exactly. For some actions this doesn't make any sense, so refuse those actions if the specified cpupool doesn't exist. Signed-off-by: juergen.gross@ts.fujitsu.com 1 file changed, 2 insertions(+), 2 deletions(-) xen/common/cpupool.c | 4 ++-- --===============5760760669357529453== Content-Type: text/x-patch; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=xen-work2.patch # HG changeset patch # User Juergen Gross # Date 1297148261 -3600 # Node ID e5e8d2c42e759a8eabddcca0fab548a9fc9f6b8a # Parent 9e463cb156586bfd50b8123664f1c290ca9f1f98 Strict parameter checking for cpupool operations Some cpupool actions didn't check the cpupool_id exactly. For some actions this doesn't make any sense, so refuse those actions if the specified cpupool doesn't exist. Signed-off-by: juergen.gross@ts.fujitsu.com diff -r 9e463cb15658 -r e5e8d2c42e75 xen/common/cpupool.c --- a/xen/common/cpupool.c Mon Feb 07 17:02:46 2011 +0000 +++ b/xen/common/cpupool.c Tue Feb 08 07:57:41 2011 +0100 @@ -485,7 +485,7 @@ int cpupool_do_sysctl(struct xen_sysctl_ ret = -EBUSY; if ( !cpu_isset(cpu, cpupool_free_cpus) ) goto addcpu_out; - c = cpupool_find_by_id(op->cpupool_id, 0); + c = cpupool_find_by_id(op->cpupool_id, 1); ret = -ENOENT; if ( c == NULL ) goto addcpu_out; @@ -501,7 +501,7 @@ int cpupool_do_sysctl(struct xen_sysctl_ { unsigned cpu; - c = __cpupool_get_by_id(op->cpupool_id, 0); + c = __cpupool_get_by_id(op->cpupool_id, 1); ret = -ENOENT; if ( c == NULL ) break; --===============5760760669357529453== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============5760760669357529453==--