linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joel Reardon <joel@clambassador.com>
To: Artem Bityutskiy <dedekind1@gmail.com>
Cc: linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [patch] Add design document for UBIFS secure deletion
Date: Fri, 23 Mar 2012 17:38:32 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.00.1203231705500.22944@eristoteles.iwoars.net> (raw)
In-Reply-To: <1332517132.18717.102.camel@sauron.fi.intel.com>

I'll answer some quickly here now while they're fresh in mind and add them
to the doc later.

>
> > In particular, it does not behave like a
> > +log-structured file system: when a KSA LEB is updated, its contents are
> > +written to a new physical location on the flash memory, UBI's logical map is
> > +then updated to this new physical address and the previous version of the KSA
> > +LEB is then erased.
>
> Am I right that you basically wanted to say that when you update a KSA
> LEB, you make sure that the physical flash does not contain the old
> contents of this LEB? Would be nice to re-phrase.
>
> Side question - how do you do this?

Here I'm just spelling out atomic update, so nothing fancy except
leb_change() to replace the keys.

>
> > Thus, except while updating the KSA, only one copy of the
> > +data in the KSA is available on the storage medium.  When the file system is
> > +created, cryptographically-suitable random data is written from random_bytes()
> > +to each of the KSA's LEBs and all the keys are marked as unused. Purging
> > +writes new versions of the KSA LEBs using UBI's atomic update feature.
>
> Just a general question about: I guess you have to call ubi_sync() then
> to make sure the old version is actually erased, right?

There was an ioctl I think I was using, but I suspect ubi_sync is
more elegant. Is it already performed after UBIFS commit?

>
> Read this far, and have 2 big questions:
>
> 1. How keys are marked as deleted (I guess in some in-memory data
> structure)
> 2. When deleted keys are removed from the medium (probably on commit?)

1. Yeah, 2bit for key state
2. During commit, the KSA LEBs are rewritten.

>
> I guess I'll find the answers below.
>
> > +When a new data node is written to the storage medium, an unused key is
> > +selected from the KSA and its position is written to the data node's header.
>
> Questions arises - how the key is selected?

Assigns the next unused key and keeps track of where it was to search
onwards.

>
> > +The keys are in a protected area of the file system, so only users with root
> > +access to the storage medium are capable of reading the keys that encrypt
> > +data.
>
> Hmm, what is the protected area? What prevents anyone from reading them
> by finding them in /dev/ubiX_Y or /dev/mtdZ ?

Protected as in the kernel stops joe user from reading raw from /dev/mtd,
no? Of course anyone with physical access can get the keys, so the
security relys on these keys being securely deleted, but anyhow keeping
live keys out of the filesystem also helps.

>
> Hmm, why is it necessary to re-initialize unused keys?
>

This can be a mount option actually, it was a response to  attack that was
proposed to me about the design. The idea here is that, suppose the
attacker reads the drive at time X with sufficient privilages to read the
keys. Then the attacker will know for certain that those keys will
eventually be used to encrypt data. So they can compromise not only the
current data, but also future data. By replacing unused keys, the attacker
is limited only to compromizing current data.

>
> Is it 2 bits per key?
>

In development it was 32bits :). But its now properly 2bits per with
bitwise ops for accessing.
>
> I guess you do not enforce these rules, you just rely on the randomness?

Yep, so the conditions need only hold with cryptographically high
probability.

>
> You'd also need to teach mkfs.ubifs to write correct KSA.
>

Ah, yes! Any other tool?

>
> Hmm, interesting how you manage checkpoints. I guess the easiest would
> be to have a special inode (not visible for users) and store checkpoints
> there?
>

The first block of the KSA stores only checkpoints, so KSA size is 1 +
minrequired + some slack. So this may need the multiple LEB
approach for one of the other UBIFS areas when its size is too big, but I
havn't done that since its generally so highly compressable that it
wasn't ever a concern.

Cheers,
Joel Reardon

  reply	other threads:[~2012-03-23 16:38 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-09 15:24 [patch] Adding Secure Deletion to UBIFS Joel Reardon
2012-02-13 16:54 ` Artem Bityutskiy
2012-02-23 14:59   ` Joel Reardon
2012-02-23 15:29     ` [patch] Add encryption key parameter to compress/decompress functions Joel Reardon
2012-03-09  7:17       ` Artem Bityutskiy
2012-03-19 16:54         ` [patch] Add design document for UBIFS secure deletion Joel Reardon
2012-03-20 20:10           ` Randy Dunlap
2012-03-21 13:26             ` Joel Reardon
2012-03-21 16:20               ` Artem Bityutskiy
2012-03-21 16:10           ` Artem Bityutskiy
2012-03-23 13:50             ` Joel Reardon
2012-03-23 15:38               ` Artem Bityutskiy
2012-03-23 16:38                 ` Joel Reardon [this message]
2012-03-26 15:03                   ` Artem Bityutskiy
2012-02-29 17:09     ` [patch] Adding Secure Deletion to UBIFS Artem Bityutskiy
2012-03-15 14:48     ` [patch] Remove notion of key schemes Joel Reardon
2012-03-16 12:43       ` Artem Bityutskiy
2012-03-16 12:51       ` Artem Bityutskiy
2012-03-16 13:34         ` Joel Reardon
2012-03-16 13:41           ` Artem Bityutskiy
2012-03-16 15:02             ` Joel Reardon
2012-03-19 14:56               ` Artem Bityutskiy
2012-02-20 20:15 ` [patch] Move CRC computation to separate function Joel Reardon
2012-02-29 16:10   ` Artem Bityutskiy
2012-03-19 22:46     ` Joel Reardon
2012-03-23 14:09       ` Artem Bityutskiy
2012-03-23 16:45         ` Joel Reardon
2012-03-23 16:51           ` Artem Bityutskiy
2012-03-25 20:38             ` Joel Reardon
2012-03-26 15:34               ` Artem Bityutskiy
2012-03-25 21:11             ` [patch] Add a encryption key parameter to the compress / decompress function Joel Reardon
2012-03-25 21:38               ` [patch] Add cryptographic functionality when a key is passed to the compress / decompress functions Joel Reardon
2012-03-27  8:33                 ` Artem Bityutskiy
2012-03-29 14:39                   ` [patch] UBIFS: " Joel Reardon
2012-04-02 14:36                     ` Artem Bityutskiy
2012-04-02 14:48                       ` Joel Reardon
2012-04-02 14:57                         ` Artem Bityutskiy
2012-04-02 14:58                           ` Joel Reardon
2012-04-03 10:29                           ` Joel Reardon
2012-04-03 10:41                             ` Guillaume LECERF
2012-04-03 11:35                               ` Joel Reardon
2012-04-12 14:05                                 ` Artem Bityutskiy
2012-03-27  8:27               ` [patch] Add a encryption key parameter to the compress / decompress function Artem Bityutskiy
2012-03-29 14:11                 ` [patch] UBIFS: " Joel Reardon
2012-04-02 14:02                   ` Artem Bityutskiy
2012-02-29 17:25 ` [patch] Adding Secure Deletion to UBIFS Artem Bityutskiy
2012-03-01 13:41   ` Joel Reardon
2012-03-09  7:36     ` Artem Bityutskiy
2012-03-09 19:29       ` Joel Reardon
2012-03-12 13:30         ` Artem Bityutskiy
2012-03-12 13:34           ` Joel Reardon
2012-03-12 13:36           ` Artem Bityutskiy
2012-03-12 13:37             ` Joel Reardon
2012-03-14 10:20             ` Joel Reardon
2012-03-14 10:27               ` Artem Bityutskiy

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=alpine.DEB.2.00.1203231705500.22944@eristoteles.iwoars.net \
    --to=joel@clambassador.com \
    --cc=dedekind1@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.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 NNTP newsgroup(s).