From: Keir Fraser Subject: Re: trouble with the new mmap-batch interface Date: Thu, 21 Jan 2010 08:57:06 +0000 Message-ID: References: <4B5820A4020000780002B30A@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4B5820A4020000780002B30A@vpn.id2.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich , Brendan Cully Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 21/01/2010 08:38, "Jan Beulich" wrote: >> Jan: Is it in fact a bug, because IOCTL_PRIVCMD_MMAPBATCH is similarly >> structured (but legitimately, in that case)? > > Generally I intended the caller to zero the array. If that's not a good > idea, I can certainly put together patches (linux and libxc) that remove > that assumption. Well I think it's a bad idea. I can't imagine the saved copy_to_user() is significantly expensive, and it makes the interface a bit confusing but in a way that sometimes still works and then sometimes fails. So please make some patches. > If you'd like to leave the assumption in, then c/s 20822 > (fixing domain save) will also need another adjustment (using realloc() > inside the loop doesn't seem very nice anyway - allocating the array > where the other two arrays get allocated would be more consistent). You can make this consistent in a separate patch, if you like. -- Keir