public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: GNU C Library <libc-alpha@sourceware.org>
Subject: fopen mode for buffer clearing
Date: Thu, 13 Apr 2017 09:41:00 -0000	[thread overview]
Message-ID: <d2c4eb40-7619-424b-7c2d-2b9e6be1a292@redhat.com> (raw)

We used to use mmap for the internal FILE * buffer.  This had the side 
effect that after fclose, the data in the buffer may not be gone from 
the system as a whole, but it will definitely not be part of the address 
space of the process anymore.  This is desirable if the stdio stream 
functions are used to process sensitive data because it reduces the risk 
of leaks.

Would it make sense to add an fopen mode flag to indicate that the 
implementation should clear the buffer (with explicit_bzero) before 
deallocating it?  This would also apply to reallocating buffers in getline.

Thanks,
Florian

             reply	other threads:[~2017-04-13  9:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-13  9:41 Florian Weimer [this message]
2017-04-13 17:28 ` Adhemerval Zanella

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=d2c4eb40-7619-424b-7c2d-2b9e6be1a292@redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).