Skip to content

fscrypt: fixes for presentation of long encrypted filenames

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

Status from this message: Thanks, applied to the fscrypt tree.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 16 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/6f2fs: check entire encrypted bigname when finding a dentryfs/f2fs/dir.c fs/f2fs/f2fs.h fs/f2fs/hash.c +1 more+31 -204 replies
2/6fscrypt: avoid collisions when presenting long encrypted filenamesfs/crypto/fname.c fs/ext4/namei.c fs/f2fs/dir.c+5 -51 reply
3/6fscrypt: introduce helper function for filename matchingfs/crypto/fname.c fs/crypto/fscrypt_private.h include/linux/fscrypt_notsupp.h +1 more+157 -222 replies
4/6ext4: switch to using fscrypt_match_name()fs/ext4/namei.c+5 -171 reply
5/6f2fs: switch to using fscrypt_match_name()fs/f2fs/dir.c+4 -247 replies
6/6ext4: clean up ext4_match() and callersfs/ext4/namei.c+25 -561 reply

Reviews trailers per patch

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

PatchJaegeuk Kim
1/6
2/6
3/6
4/6
5/6A-b
6/6

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/6] fscrypt: fixes for presentation of long encrypted filenames

From: Eric Biggers <[email protected]>

This series fixes the bugs that have been identified with how filesystems handle presenting long encrypted filenames without the key.

Patch 1 is Jaegeuk's fix to make f2fs start checking the ciphertext portion of the digested names. I made one change to this patch which is that to determine whether we should use the hash from the fscrypt_name structure rather than compute the hash, we should check for 'disk_name.name' being NULL rather than 'hash' being nonzero, since 0 is a valid hash value.

Patch 2 fixes the bug found on Chrome OS where the wrong part of the ciphertext was included in the digested names, causing collisions and undeletable files.

Patches 3-6 clean things up to be less insane and confusing, e.g. by introducing a shared function for name matching and a struct to represent a digested name.

Patches 1-2 will need to be backported and I think they should be merged into 4.12 through the fscrypt tree. The other patches are nice to have but it's not a big deal if they need to wait for next cycle.

This patch series leaves out UBIFS; it can be changed to use the common matching function once available, if desired.

Eric Biggers (5):
fscrypt: avoid collisions when presenting long encrypted filenames
fscrypt: introduce helper function for filename matching
ext4: switch to using fscrypt_match_name()
f2fs: switch to using fscrypt_match_name()
ext4: clean up ext4_match() and callers

Jaegeuk Kim (1):
f2fs: check entire encrypted bigname when finding a dentry

 fs/crypto/fname.c               |  90 +++++++++++++++++++++++++++--------
 fs/crypto/fscrypt_private.h     |   2 -
 fs/ext4/namei.c                 | 103 ++++++++++++----------------------------
 fs/f2fs/dir.c                   |  25 ++--------
 fs/f2fs/f2fs.h                  |   3 +-
 fs/f2fs/hash.c                  |   7 ++-
 fs/f2fs/inline.c                |   4 +-
 include/linux/fscrypt_notsupp.h |   9 ++++
 include/linux/fscrypt_supp.h    |  78 ++++++++++++++++++++++++++++++
 9 files changed, 202 insertions(+), 119 deletions(-)
Signature · 6 lines
2.12.2.816.g2cccc81164-goog


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot