kernel-fxtec-pro1x/fs/f2fs
Eric Biggers b32863f17f ANDROID: dm: add dm-default-key target for metadata encryption
Add a device-mapper target "dm-default-key" which assigns an encryption
key to bios that aren't for the contents of an encrypted file.

This ensures that all blocks on-disk will be encrypted with some key,
without the performance hit of file contents being encrypted twice when
fscrypt (File-Based Encryption) is used.

It is only appropriate to use dm-default-key when key configuration is
tightly controlled, like it is in Android, such that all fscrypt keys
are at least as hard to compromise as the default key.

Compared to the original version of dm-default-key, this has been
modified to use the new vendor-independent inline encryption framework
(which works even when no inline encryption hardware is present), the
table syntax has been changed to match dm-crypt, and support for
specifying Adiantum encryption has been added.  These changes also mean
that dm-default-key now always explicitly specifies the DUN (the IV).

Also, to handle f2fs moving blocks of encrypted files around without the
key, and to handle ext4 and f2fs filesystems mounted without
'-o inlinecrypt', the mapping logic is no longer "set a key on the bio
if it doesn't have one already", but rather "set a key on the bio unless
the bio has the bi_skip_dm_default_key flag set".  Filesystems set this
flag on *all* bios for encrypted file contents, regardless of whether
they are encrypting/decrypting the file using inline encryption or the
traditional filesystem-layer encryption, or moving the raw data.

For the bi_skip_dm_default_key flag, a new field in struct bio is used
rather than a bit in bi_opf so that fscrypt_set_bio_crypt_ctx() can set
the flag, minimizing the changes needed to filesystems.  (bi_opf is
usually overwritten after fscrypt_set_bio_crypt_ctx() is called.)

Bug: 137270441
Bug: 147814592
Change-Id: I69c9cd1e968ccf990e4ad96e5115b662237f5095
Signed-off-by: Eric Biggers <ebiggers@google.com>
2020-01-24 10:49:09 -08:00
..
acl.c f2fs: Replace spaces with tab 2019-05-08 21:35:15 -07:00
acl.h
checkpoint.c f2fs: show f2fs instance in printk_ratelimited 2019-12-02 15:05:28 -08:00
data.c ANDROID: dm: add dm-default-key target for metadata encryption 2020-01-24 10:49:09 -08:00
debug.c fs: f2fs: Remove unnecessary checks of SM_I(sbi) in update_general_status() 2019-09-23 14:11:59 -07:00
dir.c f2fs: show f2fs instance in printk_ratelimited 2019-12-02 15:05:28 -08:00
extent_cache.c f2fs: introduce f2fs_<level> macros to wrap f2fs_printk() 2019-07-11 18:47:33 -07:00
f2fs.h ANDROID: ext4, f2fs: enable direct I/O with inline encryption 2020-01-24 10:49:09 -08:00
file.c Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-4.19.y' into android-4.19 2020-01-14 14:37:59 -08:00
gc.c f2fs: stop GC when the victim becomes fully valid 2019-12-02 15:05:34 -08:00
gc.h
hash.c f2fs: Support case-insensitive file name lookups 2019-09-23 14:11:59 -07:00
inline.c Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-4.19.y' into android-4.19 2019-10-07 13:29:05 -07:00
inode.c f2fs: show f2fs instance in printk_ratelimited 2019-12-02 15:05:28 -08:00
Kconfig f2fs: Add a small clarification to CONFIG_FS_F2FS_FS_SECURITY 2019-09-23 14:12:04 -07:00
Makefile f2fs: add fs-verity support 2019-09-23 14:11:57 -07:00
namei.c f2fs: fix to update dir's i_pino during cross_rename 2019-12-02 15:04:09 -08:00
node.c f2fs: show f2fs instance in printk_ratelimited 2019-12-02 15:05:28 -08:00
node.h
recovery.c f2fs: support aligned pinned file 2019-12-02 15:04:08 -08:00
segment.c f2fs: Fix deadlock in f2fs_gc() context during atomic files handling 2019-12-02 15:05:31 -08:00
segment.h f2fs: support aligned pinned file 2019-12-02 15:04:08 -08:00
shrinker.c
super.c BACKPORT: FROMLIST: Update Inline Encryption from v5 to v6 of patch series 2020-01-13 07:11:38 -08:00
sysfs.c f2fs: expose main_blkaddr in sysfs 2019-12-02 15:05:33 -08:00
trace.c f2fs: do not use mutex lock in atomic context 2019-04-05 22:32:59 +02:00
trace.h
verity.c f2fs: add fs-verity support 2019-09-23 14:11:57 -07:00
xattr.c f2fs: fix to avoid memory leakage in f2fs_listxattr 2019-12-02 15:04:04 -08:00
xattr.h f2fs: add fs-verity support 2019-09-23 14:11:57 -07:00