From: Ian Jackson Subject: Re: [PATCH] [v3] libxc: Replace alloca() with mmap() for array sizes greater than a page in xc_linux_osdep.c Date: Tue, 24 Apr 2012 14:31:44 +0100 Message-ID: <20374.43840.714854.970812@mariner.uk.xensource.com> References: <6ef297a3761f3061d2e8.1335219661@vollum> <1335256933.4347.36.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1335256933.4347.36.camel@zakaz.uk.xensource.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: Ian Campbell Cc: Aravindh Puthiyaparambil , "xen-devel@lists.xensource.com" , Andres Lagar-Cavilla List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("Re: [Xen-devel] [PATCH] [v3] libxc: Replace alloca() with mmap() for array sizes greater than a page in xc_linux_osdep.c"): > On Mon, 2012-04-23 at 23:21 +0100, Aravindh Puthiyaparambil wrote: > > When mapping in large amounts of pages (in the GB range) from a guest in to Dom0 using xc_map_foreign_bulk(), a segfault occurs in the libxc client application. This is because the pfn array in linux_privcmd_map_foreign_bulk() is being allocated using alloca() and the subsequent memcpy causes the stack to blow. This patch replaces the alloca() with mmap() for pfn array sizes greater than a page. > > > > Fix an error print with the correct function name. > > > > Do the same for the map array in linux_gnttab_grant_map() > > > > Signed-off-by: Aravindh Puthiyaparambil > > Acked-by: Andres Lagar-Cavilla > > Acked-by: Ian Campbell Thanks, Committed-by: Ian Jackson