From: Ian Campbell Subject: Re: [PATCH] Use new Xen public header for product numbers and names Date: Tue, 2 Oct 2012 10:25:16 +0100 Message-ID: <1349169916.650.15.camel@zakaz.uk.xensource.com> References: <1349084633-13186-1-git-send-email-paul.durrant@citrix.com> <20585.45901.698074.351144@mariner.uk.xensource.com> <291EDFCB1E9E224A99088639C4762022FDDCAB6EB5@LONPMAILBOX01.citrite.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <291EDFCB1E9E224A99088639C4762022FDDCAB6EB5@LONPMAILBOX01.citrite.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Paul Durrant Cc: Ian Jackson , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Mon, 2012-10-01 at 17:08 +0100, Paul Durrant wrote: > > -----Original Message----- > > From: Ian Jackson [mailto:Ian.Jackson@eu.citrix.com] > > Sent: 01 October 2012 16:14 > > To: Paul Durrant > > Cc: xen-devel@lists.xen.org > > Subject: Re: [Xen-devel] [PATCH] Use new Xen public header for product > > numbers and names > > > > Paul Durrant writes ("[Xen-devel] [PATCH] Use new Xen public header for > > product numbers and names"): > > > xen/include/public/hvm/pvdrivers.h has been added as the register of > > > product numbers used by the blacklisting protocol. > > > Use the definitions therein rather then locally coded values. > > ... > > > +#define PRODUCT(_name, _nr) case _nr: product = _name; break; > > > switch (product_nr) { > > > - /* > > > - * In qemu-xen-unstable, this is the master registry of product > > > - * numbers. If you need a new product number allocating, please > > > - * post to xen-devel@lists.xensource.com. You should NOT use > > > - * an existing product number without allocating one. > > > - * > > > - * If you maintain a seaparate versioning and distribution path > > > - * for PV drivers you should have a separate product number so > > > - * that your drivers can be separated from others'. > > > - * > > > - * During development, you may use the product ID 0xffff to > > > - * indicate a driver which is yet to be released. > > > - */ > > > - case 1: product = "xensource-windows"; break; /* Citrix */ > > > - case 2: product = "gplpv-windows"; break; /* James Harper */ > > > - case 0xffff: product = "experimental"; break; > > > + PVDRIVERS_PRODUCT_LIST(PRODUCT) > > > > As a case in point, this generates: > > case 0: product = NULL; break; > > and then passes the NULL to asprintf. > > > > Nothing should be using product number 0, so is this a problem? In some circumstances (I think) the product number may come from the guest, which may be malicious. Ian.