linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* fs/crypto: root read-access without key
@ 2017-02-14 10:18 Anand Jain
  2017-02-14 10:48 ` Richard Weinberger
  2017-02-14 15:50 ` Theodore Ts'o
  0 siblings, 2 replies; 10+ messages in thread
From: Anand Jain @ 2017-02-14 10:18 UTC (permalink / raw)
  To: Theodore Ts'o, linux-fsdevel


Hi Ted,

  As of now root[1] can access the plain-text when the data is cached
  by the user-with-the-key and, root gets error no-key when data is
  not cached by the user-with-the-key. I think this behavior is a
  bug if not, wrong design, or looks like I am missing something.

  [1] for that matter any user who has read access to the files but
  does not have the keys.

Repo:
-----------
The user enters key of edir-user
$ e4crypt add_key /ext4/edir-user/

root with no-key is not able to read file-data yet.

# cat /ext4/edir-user/tf1
cat: tf1: Required key not available

now the user above, reads tf1
$ cat /ext4/edir-user/tf1
this is test created by user

So now root with no-key is able to read the file
# cat /ext4/edir-user/tf1
this is test created by user
-----------

  Instead, this should either always return cipher-text (thru DIO)
  or always return error-no-key. So that, behavior does not depend
  file-data cache.

  Hope we agree on the common behavior, BTRFS as of now returns
  error-no-key for all users without-the-key, however in the long
  term when relevant code is ready, it would be beneficial to
  provide the cipher-text in this context and the encryption
  metadata through the xattr. So that, we could use rsync -X
  without-key, to back up the encrypted files which will also copy
  the required encryption metadata through the extended attributes.
  Next, when rsync -X is run when key-is-in, it would read
  plain-text but no encryption metadata should be read at this time,
  as it has already reading the plain-text anyway. In this way
  we control the backup and restore.

  This may be controversial but just the idea floating so that we
  have better compatibility and, as probably extended attribute
  is more common across other OSs including NTFS, hopefully one day
  we could backup encrypted-file across FSs without having to decrypt,
  and decrypt at the destination only when required. This also
  means we need page->index to be common or we can provide such
  info through the extended attributes again or fs/crypto v2
  could add a feature to drop encryption metadata dependency on
  the page->index.

Thanks, Anand

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-02-17 17:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-14 10:18 fs/crypto: root read-access without key Anand Jain
2017-02-14 10:48 ` Richard Weinberger
2017-02-14 12:50   ` Anand Jain
2017-02-14 13:30     ` Richard Weinberger
2017-02-14 15:50 ` Theodore Ts'o
2017-02-14 19:00   ` Al Viro
2017-02-15 15:39     ` Theodore Ts'o
2017-02-15  8:04   ` Anand Jain
2017-02-17  4:43     ` Eric Biggers
2017-02-17 17:13       ` Anand Jain

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).