Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jan 2015 19:11:15 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r276850 - head/sys/kern
Message-ID:  <201501081911.t08JBF28045910@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu Jan  8 19:11:14 2015
New Revision: 276850
URL: https://svnweb.freebsd.org/changeset/base/276850

Log:
  Reject attempts to read the cpuset mask of a negative domain ID.

Modified:
  head/sys/kern/kern_cpuset.c

Modified: head/sys/kern/kern_cpuset.c
==============================================================================
--- head/sys/kern/kern_cpuset.c	Thu Jan  8 18:53:11 2015	(r276849)
+++ head/sys/kern/kern_cpuset.c	Thu Jan  8 19:11:14 2015	(r276850)
@@ -1118,7 +1118,7 @@ sys_cpuset_getaffinity(struct thread *td
 			error = intr_getaffinity(uap->id, mask);
 			break;
 		case CPU_WHICH_DOMAIN:
-			if (uap->id >= vm_ndomains)
+			if (uap->id < 0 || uap->id >= vm_ndomains)
 				error = ESRCH;
 			else
 				CPU_COPY(&cpuset_domain[uap->id], mask);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501081911.t08JBF28045910>