All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@bugzilla.kernel.org
To: linux-ext4@vger.kernel.org
Subject: [Bug 92271] Provide a way to really delete files, please
Date: Sat, 31 Jan 2015 17:21:37 +0000	[thread overview]
Message-ID: <bug-92271-13602-ppMMR3F7Ce@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-92271-13602@https.bugzilla.kernel.org/>

https://bugzilla.kernel.org/show_bug.cgi?id=92271

Theodore Tso <tytso@mit.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |tytso@mit.edu
         Resolution|---                         |INVALID

--- Comment #10 from Theodore Tso <tytso@mit.edu> ---
The problem is for flash based devices, there ultimately is no way to be
completely sure.   Even in the case of eMMC devices that support secure trim,
that is only going to trim most recent flash page where the data was located.  
The FTL could have copied the data to another flash page, and not gotten around
to erasing the older flash page.  And most flash devices don't even have secure
trim, and trim is a discretionary command that the flash device is free to
ignore whenever it feels like it.  So ultimately, this is a Very Hard Problem.

It's true that we could try to do better at it, but ultimately most users will
never know if they can actually trust a file that has been "securely unlinked",
whether you do this with a system call or by honoring the 's' chattr bit.   It
will depend on the file system you are using, the sort of storage stack used by
the file system, and so in practice having such a "secure unlink" feature could
do more harm than good, because it many users could end up trusting it when
they really shouldn't.

In terms of your original use case, the simplest solution is to simply not let
the signing keys hit a storage device at all.  So for example, you could use a
ramdisk.  Perhaps more convenient for users who are not running as root is to
use tmpfs.   Try seeing if /var/run/$UID is present, or if not, fall back to a
directory in /tmp.   Yes, it's possible for tmpfs to be written to swap, but
you can get around that problem by forking a process which mmap's the private
keys, and then calls mlock(2) to make sure they stay in memory.   Each user is
allowed to mlock 64k of memory by default, which should be plenty for storing
some private keys that you want to discard when you're done with the kernel
compile.

This has the advantage of working for *everyone*, whereas most SSD's don't have
secure trim. and most kernel developers, not having the patience of saints, and
not trusting the reliability of cheap flash, are unlikely to be building on top
of eMMC flash.

The final thing to consider is what exactly is your threat environment.   If
the attacker has sufficient privilegs to steal deleted files from your build
machine, you have much bigger problems.   The attacker would be much better
served to try compromise the C compiler, or simply make a copy of the keys
during the build process.   Sure, there are scenarios where the bad guy might
be able to steal the disk after the build was finished, and before the disk
blocks gets reused, and somehow didn't have the privileges to play monkey
business during the build.   Such scenarios can be imagined.  But is it worth
it to spend huge amounts of engineering time creating a "secure unlink" that is
only guaranteed to work on storage devices which are highly unlikely to be used
for kernel builds in the first place?

This is, of course, open source, so if you want to send patches, we'll be happy
to review them.    But in terms of a feature request, this is going to be
extremely low priority, especially since there are workarounds which are much
better, more applicable, and more secure than your proposed solution.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

  parent reply	other threads:[~2015-01-31 17:21 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-29 11:47 [Bug 92271] New: Provide a way to really delete files, please bugzilla-daemon
2015-01-29 19:13 ` [Bug 92271] " bugzilla-daemon
2015-01-29 19:30 ` bugzilla-daemon
2015-01-29 19:49 ` bugzilla-daemon
2015-01-29 20:59 ` bugzilla-daemon
2015-01-29 21:01 ` bugzilla-daemon
2015-01-29 21:20 ` bugzilla-daemon
2015-01-29 21:55 ` bugzilla-daemon
2015-01-29 22:02 ` bugzilla-daemon
2015-01-29 22:11 ` bugzilla-daemon
2015-01-31 17:21 ` bugzilla-daemon [this message]
2015-01-31 18:36 ` bugzilla-daemon
2015-01-31 20:56 ` bugzilla-daemon
2015-02-01  1:51 ` bugzilla-daemon
2015-02-01  1:58 ` bugzilla-daemon
2015-02-01 10:14 ` bugzilla-daemon
2015-02-01 10:35 ` bugzilla-daemon
2015-02-01 11:04 ` bugzilla-daemon
2015-02-01 16:33 ` bugzilla-daemon
2015-02-01 17:18 ` bugzilla-daemon
2015-02-02  8:32 ` bugzilla-daemon
2015-02-02 11:13 ` bugzilla-daemon
2015-02-02 17:12 ` bugzilla-daemon
2015-02-03 17:29 ` bugzilla-daemon
2015-02-03 17:44 ` bugzilla-daemon
2015-02-03 17:47 ` bugzilla-daemon
2015-02-03 18:20 ` bugzilla-daemon

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=bug-92271-13602-ppMMR3F7Ce@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@bugzilla.kernel.org \
    --cc=linux-ext4@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.