Skip to content

fscrypt: forbid truncate(2) without key

Eric Biggers linux-ext4 linux-f2fs-devel linux-fscrypt linux-fsdevel linux-mtd 1 version Applied

Status from this message: Thanks, applied.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 8 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3ext4: require key for truncate(2) of encrypted filefs/ext4/inode.c+8 -07 replies
2/3f2fs: require key for truncate(2) of encrypted filefs/f2fs/file.c+7 -31 reply
3/3ubifs: require key for truncate(2) of encrypted filefs/ubifs/file.c+8 -00 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchChao Yu
1/3
2/3A-b
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] fscrypt: forbid truncate(2) without key

From: Eric Biggers <[email protected]>

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(-)
Signature · 1 line
2.13.1.508.gb3defc5cc-goog