linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] fscrypt: forbid truncate(2) without key
@ 2017-06-13 23:47 Eric Biggers
  2017-06-13 23:47 ` [PATCH 1/3] ext4: require key for truncate(2) of encrypted file Eric Biggers
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Eric Biggers @ 2017-06-13 23:47 UTC (permalink / raw)
  To: linux-fscrypt
  Cc: Theodore Ts'o, linux-fsdevel, linux-ext4, linux-f2fs-devel,
	linux-mtd, Eric Biggers

From: Eric Biggers <ebiggers@google.com>

These patches update the various filesystems to forbid userspace from
truncating encrypted files without the encryption key, as it's not
possible to handle this correctly in general.  I believe this may have
been missed because truncate() doesn't require opening the file first,
and therefore it's not prevented by the existing requirement that open()
is only allowed with the encryption key.

It probably makes sense to take this series through the fscrypt tree, as
the changes for each filesystem are basically identical.  (Eventually it
might make sense to add an S_ENCRYPTED flag to struct inode and move
some of these "hooks" up into the VFS; this one might fit nicely into
setattr_prepare(), for example.)

Eric Biggers (3):
  ext4: require key for truncate(2) of encrypted file
  f2fs: require key for truncate(2) of encrypted file
  ubifs: require key for truncate(2) of encrypted file

 fs/ext4/inode.c |  8 ++++++++
 fs/f2fs/file.c  | 10 +++++++---
 fs/ubifs/file.c |  8 ++++++++
 3 files changed, 23 insertions(+), 3 deletions(-)

-- 
2.13.1.508.gb3defc5cc-goog

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

end of thread, other threads:[~2017-06-23 23:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-13 23:47 [PATCH 0/3] fscrypt: forbid truncate(2) without key Eric Biggers
2017-06-13 23:47 ` [PATCH 1/3] ext4: require key for truncate(2) of encrypted file Eric Biggers
2017-06-14  0:14   ` Andreas Dilger
2017-06-14  3:12     ` Eric Biggers
2017-06-14  4:02       ` Andreas Dilger
2017-06-14  6:52   ` Christoph Hellwig
2017-06-14  7:03     ` Eric Biggers
2017-06-14  7:06       ` Christoph Hellwig
2017-06-23 23:52   ` Theodore Ts'o
2017-06-13 23:47 ` [PATCH 2/3] f2fs: " Eric Biggers
2017-06-14 12:44   ` [f2fs-dev] " Chao Yu
2017-06-13 23:47 ` [PATCH 3/3] ubifs: " Eric Biggers

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