f2fs: Handle casefolding with Encryption
Expand f2fs's casefolding support to include encrypted directories. To index casefolded+encrypted directories, we use the SipHash of the casefolded name, keyed by a key derived from the directory's fscrypt master key. This ensures that the dirhash doesn't leak information about the plaintext filenames. Encryption keys are unavailable during roll-forward recovery, so we can't compute the dirhash when recovering a new dentry in an encrypted + casefolded directory. To avoid having to force a checkpoint when a new file is fsync'ed, store the dirhash on-disk appended to i_name. This patch incorporates work by Eric Biggers <ebiggers@google.com> and Jaegeuk Kim <jaegeuk@kernel.org>. Co-developed-by:Eric Biggers <ebiggers@google.com> Signed-off-by:
Eric Biggers <ebiggers@google.com> Signed-off-by:
Daniel Rosenberg <drosen@google.com> Reviewed-by:
Eric Biggers <ebiggers@google.com> Signed-off-by:
Jaegeuk Kim <jaegeuk@kernel.org>
Showing
- fs/f2fs/dir.c 76 additions, 22 deletionsfs/f2fs/dir.c
- fs/f2fs/f2fs.h 5 additions, 3 deletionsfs/f2fs/f2fs.h
- fs/f2fs/hash.c 10 additions, 1 deletionfs/f2fs/hash.c
- fs/f2fs/inline.c 4 additions, 0 deletionsfs/f2fs/inline.c
- fs/f2fs/recovery.c 11 additions, 1 deletionfs/f2fs/recovery.c
- fs/f2fs/super.c 0 additions, 6 deletionsfs/f2fs/super.c
Loading
Please register or sign in to comment