public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Jorge Almeida <jjalmeida@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] memset_s
Date: Sun, 12 Nov 2017 23:17:24 -0800	[thread overview]
Message-ID: <CAKpSnpK_f2DCkZj9ca8LPzNE7hcJBcpaAO-c1L891Rc5v-cucQ@mail.gmail.com> (raw)
In-Reply-To: <1510542223.24203.0.camel@gentoo.org>

On Sun, Nov 12, 2017 at 7:03 PM, Mart Raudsepp <leio@gentoo.org> wrote:
> On L, 2017-11-11 at 00:10 +0000, Jorge Almeida wrote:
>> Well, most programmers probably won't care about this stuff anyway,
>> and people who deal with cryptography tend to be more cautious than
>> average. But I'm not really making a case for safe versions of known
>> functions. After all, the usual functions do fine for most
>> applications. memset() would be enough to clear RAM with sensitive
>> data if we had a pragma (or equivalent) to convince the compiler to
>> not ignore it (I mean a pragma to invoke on a particular function
>> definition when the programmer  feels that a black box behaviour is
>> undesirable). Of course, solving the problem of the compiler copying
>> stuff around might be harder nut to crack.
>
> Sounds like you want explicit_bzero from libbsd?
>
According to their man page, yes. I'll have to [try to] check the
source. I wonder how they do it? Even the volatile modifier doesn't
solve the problem, according to the link in previous post.

Anyway, there are probably circumstances where not optimizing a
particular function would be useful. Zeroing sensitive data is just
the first that comes to mind. (For example, what if you prefer
overwriting your sensitive data with random bytes?)

Jorge


  reply	other threads:[~2017-11-13  7:17 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-10  9:54 [gentoo-user] memset_s Jorge Almeida
2017-11-10 10:52 ` Marc Joliet
2017-11-10 11:34   ` Jorge Almeida
2017-11-10 16:25     ` R0b0t1
2017-11-10 18:20       ` Alexander Kapshuk
2017-11-10 20:09       ` Jorge Almeida
2017-11-10 23:19         ` R0b0t1
2017-11-11  0:10           ` Jorge Almeida
2017-11-13  3:03             ` Mart Raudsepp
2017-11-13  7:17               ` Jorge Almeida [this message]
2017-11-13 10:44                 ` [gentoo-user] memset_s Nikos Chantziaras
2017-11-13 11:16                   ` Jorge Almeida
2017-11-13 11:38                   ` Mart Raudsepp
2017-11-13 14:26                     ` Nikos Chantziaras
2017-11-14 17:36         ` [gentoo-user] memset_s Jorge Almeida
2017-11-15  4:42           ` R0b0t1
2017-11-15  7:22             ` Jorge Almeida
2017-11-15 15:28             ` [gentoo-user] memset_s Grant Edwards
2017-11-15 15:41               ` R0b0t1
2017-11-15 15:48                 ` R0b0t1
2017-11-15 21:42                   ` Grant Edwards
2017-11-16  0:19                     ` R0b0t1
2017-11-15 15:50                 ` Jorge Almeida
2017-11-15 17:39                   ` Michael Orlitzky
2017-11-15  8:54           ` Nikos Chantziaras
2017-11-15  9:05             ` Jorge Almeida
2017-11-15 10:31               ` Nikos Chantziaras
2017-11-10 11:38 ` Nikos Chantziaras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKpSnpK_f2DCkZj9ca8LPzNE7hcJBcpaAO-c1L891Rc5v-cucQ@mail.gmail.com \
    --to=jjalmeida@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox