All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kyle <lists@lolwut.org>
To: Chris Murphy <lists@colorremedies.com>
Cc: Hugo Mills <hugo@carfax.org.uk>, linux-btrfs@vger.kernel.org
Subject: Re: Impossible or Possible to Securely Erase File on Btrfs?
Date: Mon, 18 Mar 2013 19:00:43 -0400	[thread overview]
Message-ID: <51479C9B.80507@lolwut.org> (raw)
In-Reply-To: <140D9ED4-B0CF-437E-AE58-9B6FB209DBD2@colorremedies.com>

On 3/18/2013 3:09 PM, Chris Murphy wrote:
>
> On Mar 18, 2013, at 12:57 PM, Hugo Mills <hugo@carfax.org.uk> wrote:
>
>> On Mon, Mar 18, 2013 at 02:15:17PM -0400, Kyle wrote:
>>> After reading through the btrfs documentation I'm curious to know if
>>> it's possible to ever securely erase a file from a btrfs filesystem
>>> (or ZFS for that matter).
>>
>>    Not really.
>>
>>    It gets even worse for SSDs, because the SSD itself can be
>> effectively CoW, with old pages lurking away in the flash storage
>> where (with a bit of physical persuasion of the hardware) they can be
>> read. So you have the same problem on SSDs even with non-CoW
>> filesystems.
>
> Encryption is the solution, either dmcrypt, encryptfs, or Opal SED.
>
> With even consumer SSDs now, Opal 2.0 is increasingly common, so data on the SSD is already encrypted whether locked or not. By default the drive is unlocked, so the DEK is exposed but data on the chips is encrypted. Unfortunately I'm not aware of user space tools to manage Opal drives on linux, it's a side topic question but if anyone knows of such a tool I'd like to know about it. I don't think hdparm does, rather it manages the ATA  Security features like Secure Erase, Secure Enhanced Erase, and I think it can also cause DEK regeneration on SED drives which effectively is encryption erase (removes the existing DEK, creates a new one, thereby rendering the drive effectively erased in seconds). But I don't think it manages KEKs and the locking/unlocking of the drive.
>
> Booting from these Opal compliant SEDs is difficult because it requires firmware or bootloader support; and then also kernel and user space tools to support to lock/unlock when the computer is put to sleep/hibernation and then woken. For that use case it's necessary to use software encryption, dmcrypt/LUKS on Linux.
>
> Another possibility for the OP's use case is encryptfs which encrypts above btrfs. The file contents are encrypted, but the file names and file system itself (and metadata) are not. In this case, deletion is functionally equivalent to having filled the blocks with random data (short of the DEK escaping into the wild).
>
> Chris Murphy
>

I'm doubtful that encryption would be as effective as what Chris Mason 
was suggesting, which is to either find and use a disk with secure erase 
trim or rotate out the drives and securely erase them so that the data 
is destroyed entirely rather than encrypted.

Simply having the data exist on a disk, even if it's encrypted, still 
leaves it open to various attacks. For instance, multiple side channel 
attacks exist which could reveal the decryption key, permitting all data 
on the disk to be read including deleted but not yet overwritten files. 
Physical access to the machine may not even be required: A remote 
attacker able to exploit the machine and read the disk blocks would be 
able to recover the data as well.

Granted these types of attacks are rare, however ultimately the only way 
to secure unneeded sensitive data against a determined attacker is to 
destroy it outright. For encrypted data, it's true the decryption keys 
could be destroyed, thus essentially destroying the data (subject to the 
security of the cryptographic algorithm itself) however this would 
destroy the entire filesystem, not securely erase a single file.

Hugo made the point that a multitude of other data-leakage paths exist, 
and while this is true, at a minimum one should be able to destroy 
individual files beyond recovery so that should data leakage occur in 
the future, previously securely erased data is not recoverable. At 
least, in an ideal world.

For the time being I'll be thankful I'm not a person tasked with 
protecting/erasing such highly sensitive data. Aside from the 
confidence-inspiring crunching of decommissioned hard disks going 
through an industrial shredder, it must be a nightmare.

-Kyle

  reply	other threads:[~2013-03-18 23:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-18 18:15 Impossible or Possible to Securely Erase File on Btrfs? Kyle
2013-03-18 18:57 ` Hugo Mills
2013-03-18 19:09   ` Chris Murphy
2013-03-18 23:00     ` Kyle [this message]
2013-03-19  4:41       ` Chris Murphy
2013-03-18 19:18 ` Chris Mason
2013-03-18 22:48   ` Gareth Pye
2013-03-19  9:19     ` David Sterba
2013-03-19  3:18   ` Chris Murphy
2013-03-19  9:06     ` David Sterba
2013-03-20  0:52       ` Chris Murphy
2013-03-19 22:46 ` Marek Otahal
2013-03-20 19:20   ` Martin Steigerwald

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=51479C9B.80507@lolwut.org \
    --to=lists@lolwut.org \
    --cc=hugo@carfax.org.uk \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lists@colorremedies.com \
    /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.