Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755550Ab2HIJYw (ORCPT ); Thu, 9 Aug 2012 05:24:52 -0400 Received: from mail.x86-64.org ([217.9.48.20]:45712 "EHLO mail.x86-64.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752873Ab2HIJYv (ORCPT ); Thu, 9 Aug 2012 05:24:51 -0400 Date: Thu, 9 Aug 2012 11:24:46 +0200 From: Borislav Petkov To: Amit Shah Cc: Yoshihiro YUNOMAE , linux-kernel@vger.kernel.org, Anthony Liguori , Arnd Bergmann , Borislav Petkov , "Franch Ch. Eigler" , Frederic Weisbecker , Greg Kroah-Hartman , Herbert Xu , Ingo Molnar , Mathieu Desnoyers , Steven Rostedt , virtualization@lists.linux-foundation.org, qemu-devel@nongnu.org, yrl.pp-manager.tt@hitachi.com, Masami Hiramatsu Subject: Re: [RFC PATCH 2/6] virtio/console: Add a failback for unstealable pipe buffer Message-ID: <20120809092446.GB27761@aftab.osrc.amd.com> References: <20120724023657.6600.52706.stgit@ltc189.sdl.hitachi.co.jp> <20120724023718.6600.68836.stgit@ltc189.sdl.hitachi.co.jp> <20120809090312.GH3280@amit.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120809090312.GH3280@amit.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1002 Lines: 30 On Thu, Aug 09, 2012 at 02:33:12PM +0530, Amit Shah wrote: > > @@ -807,9 +807,31 @@ static int pipe_to_sg(struct pipe_inode_info *pipe, struct pipe_buffer *buf, > > > > len = min(buf->len, sd->len); > > sg_set_page(&(sgl->sg[sgl->n]), buf->page, len, buf->offset); > > - sgl->n++; > > - sgl->len += len; > > + } else { > > + /* Failback to copying a page */ > > + struct page *page = alloc_page(GFP_KERNEL); > > I prefer zeroing out the page. If there's not enough data to be > filled in the page, the remaining data can be leaked to the host. get_zeroed_page()? -- Regards/Gruss, Boris. Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach GM: Alberto Bozzo Reg: Dornach, Landkreis Muenchen HRB Nr. 43632 WEEE Registernr: 129 19551 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/