Re: [RFC PATCH 2/6] virtio/console: Add a failback for unstealablepipe buffer
From: Borislav Petkov
Date: Thu Aug 09 2012 - 05:24:44 EST
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/