lkml.org 
[lkml]   [2015]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.14 15/52] dm crypt: use memzero_explicit for on-stack buffer
    Date
    3.14-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Milan Broz <gmazyland@gmail.com>

    commit 1a71d6ffe18c0d0f03fc8531949cc8ed41d702ee upstream.

    Use memzero_explicit to cleanup sensitive data allocated on stack
    to prevent the compiler from optimizing and removing memset() calls.

    Signed-off-by: Milan Broz <gmazyland@gmail.com>
    Signed-off-by: Mike Snitzer <snitzer@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/md/dm-crypt.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/drivers/md/dm-crypt.c
    +++ b/drivers/md/dm-crypt.c
    @@ -709,7 +709,7 @@ static int crypt_iv_tcw_whitening(struct
    for (i = 0; i < ((1 << SECTOR_SHIFT) / 8); i++)
    crypto_xor(data + i * 8, buf, 8);
    out:
    - memset(buf, 0, sizeof(buf));
    + memzero_explicit(buf, sizeof(buf));
    return r;
    }




    \
     
     \ /
      Last update: 2015-01-07 04:01    [W:4.127 / U:0.344 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site