From: Ian Campbell Subject: Re: [PATCH 5/5] xenstat: Fix buffer over-run with new_domains being negative (again). Date: Tue, 26 Nov 2013 08:40:19 +0000 Message-ID: <1385455219.23632.13.camel@dagon.hellion.org.uk> References: <1385398842-8247-1-git-send-email-konrad.wilk@oracle.com> <1385398842-8247-6-git-send-email-konrad.wilk@oracle.com> <1385399207.22002.100.camel@kazak.uk.xensource.com> <52938A9D.8060706@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VlEC0-0001AF-8O for xen-devel@lists.xenproject.org; Tue, 26 Nov 2013 08:40:24 +0000 In-Reply-To: <52938A9D.8060706@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Mon, 2013-11-25 at 17:36 +0000, Andrew Cooper wrote: > xc_domain_getinfolist() is just as crazy as its partner in crime, > xc_domain_getinfo(), and takes an unsigned int "max_doms" and returns a > signed number of domains gotten, or -1 for certain failed hypercalls. Perhaps we should be changing those two to take a signed int max? The domid_t typedef might be a suitable type. For evtchns we have evtchn_port_or_error_t to cover the -1..2^16 space, we could do something similar here for the return type, or just leave it as is.