lkml.org 
[lkml]   [2012]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC PATCH 2/6] virtio/console: Add a failback for unstealable pipe buffer
    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


    \
     
     \ /
      Last update: 2012-08-09 12:02    [W:5.027 / U:0.104 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site