lkml.org 
[lkml]   [2016]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH] keys/encrypted: Fix two crypto-on-the-stack bugs
    On Mon, Dec 12, 2016 at 2:28 PM, David Howells <dhowells@redhat.com> wrote:
    > Andy Lutomirski <luto@kernel.org> wrote:
    >
    >> +static const char zero_pad[16] = {0};
    >
    > Isn't there a global page of zeros or something that we can share? Also, you
    > shouldn't explicitly initialise it so that it stays in .bss.

    This is a double-edged sword. It seems that omitting the
    initialization causes it to go in .bss, which isn't read only. I have
    no idea why initializing make a difference at all -- the IMO sensible
    behavior would be to put it in .rodata as NOBITS either way.

    But I'll use empty_zero_page.

    >
    >> - sg_set_buf(&sg_out[1], pad, sizeof pad);
    >> + sg_set_buf(&sg_out[1], zero_pad, sizeof zero_pad);
    >
    > Can you put brackets on the sizeof?

    Will do for v2.

    \
     
     \ /
      Last update: 2016-12-13 01:33    [W:4.164 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site