Pull fscrypt updates from Eric Biggers: - Add the IV_INO_LBLK_64 encryption policy flag which modifies the encryption to be optimized for UFS inline encryption hardware. - For AES-128-CBC, use the crypto API's implementation of ESSIV (which was added in 5.4) rather than doing ESSIV manually. - A few other cleanups. * tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt: f2fs: add support for IV_INO_LBLK_64 encryption policies ext4: add support for IV_INO_LBLK_64 encryption policies fscrypt: add support for IV_INO_LBLK_64 policies fscrypt: avoid data race on fscrypt_mode::logged_impl_name docs: ioctl-number: document fscrypt ioctl numbers fscrypt: zeroize fscrypt_info before freeing fscrypt: remove struct fscrypt_ctx fscrypt: invoke crypto API for ESSIV handling
Showing the changes to include/linux (1 of 14 files). Show all
Unified · Split
| @@ -20,7 +20,6 @@ · 19 unmodified lines | |||
| 20 | 20 | ||
| 21 | #define FS_CRYPTO_BLOCK_SIZE 16 | 21 | #define FS_CRYPTO_BLOCK_SIZE 16 |
| 22 | 22 | ||
| 23 | struct fscrypt_ctx; | ||
| 24 | struct fscrypt_info; | 23 | struct fscrypt_info; |
| 25 | 24 | ||
| 26 | struct fscrypt_str { | 25 | struct fscrypt_str { |
| @@ -62,18 +61,9 @@ struct fscrypt_operations { · 35 unmodified lines | |||
| 62 | bool (*dummy_context)(struct inode *); | 61 | bool (*dummy_context)(struct inode *); |
| 63 | bool (*empty_dir)(struct inode *); | 62 | bool (*empty_dir)(struct inode *); |
| 64 | unsigned int max_namelen; | 63 | unsigned int max_namelen; |
| 65 | }; | 64 | bool (*has_stable_inodes)(struct super_block *sb); |
| 66 | 65 | void (*get_ino_and_lblk_bits)(struct super_block *sb, | |
| 67 | /* Decryption work */ | 66 | int *ino_bits_ret, int *lblk_bits_ret); |
| 68 | struct fscrypt_ctx { | ||
| 69 | union { | ||
| 70 | struct { | ||
| 71 | struct bio *bio; | ||
| 72 | struct work_struct work; | ||
| 73 | }; | ||
| 74 | struct list_head free_list; /* Free list */ | ||
| 75 | }; | ||
| 76 | u8 flags; /* Flags */ | ||
| 77 | }; | 67 | }; |
| 78 | 68 | ||
| 79 | static inline bool fscrypt_has_encryption_key(const struct inode *inode) | 69 | static inline bool fscrypt_has_encryption_key(const struct inode *inode) |
| @@ -102,8 +92,6 @@ static inline void fscrypt_handle_d_move(struct dentry *dentry) · 22 unmodified lines | |||
| 102 | 92 | ||
| 103 | /* crypto.c */ | 93 | /* crypto.c */ |
| 104 | extern void fscrypt_enqueue_decrypt_work(struct work_struct *); | 94 | extern void fscrypt_enqueue_decrypt_work(struct work_struct *); |
| 105 | extern struct fscrypt_ctx *fscrypt_get_ctx(gfp_t); | ||
| 106 | extern void fscrypt_release_ctx(struct fscrypt_ctx *); | ||
| 107 | 95 | ||
| 108 | extern struct page *fscrypt_encrypt_pagecache_blocks(struct page *page, | 96 | extern struct page *fscrypt_encrypt_pagecache_blocks(struct page *page, |
| 109 | unsigned int len, | 97 | unsigned int len, |
| @@ -244,8 +232,6 @@ static inline bool fscrypt_match_name(const struct fscrypt_name *fname, · 134 unmodified lines | |||
| 244 | 232 | ||
| 245 | /* bio.c */ | 233 | /* bio.c */ |
| 246 | extern void fscrypt_decrypt_bio(struct bio *); | 234 | extern void fscrypt_decrypt_bio(struct bio *); |
| 247 | extern void fscrypt_enqueue_decrypt_bio(struct fscrypt_ctx *ctx, | ||
| 248 | struct bio *bio); | ||
| 249 | extern int fscrypt_zeroout_range(const struct inode *, pgoff_t, sector_t, | 235 | extern int fscrypt_zeroout_range(const struct inode *, pgoff_t, sector_t, |
| 250 | unsigned int); | 236 | unsigned int); |
| 251 | 237 | ||
| @@ -295,16 +281,6 @@ static inline void fscrypt_enqueue_decrypt_work(struct work_struct *work) · 43 unmodified lines | |||
| 295 | { | 281 | { |
| 296 | } | 282 | } |
| 297 | 283 | ||
| 298 | static inline struct fscrypt_ctx *fscrypt_get_ctx(gfp_t gfp_flags) | ||
| 299 | { | ||
| 300 | return ERR_PTR(-EOPNOTSUPP); | ||
| 301 | } | ||
| 302 | |||
| 303 | static inline void fscrypt_release_ctx(struct fscrypt_ctx *ctx) | ||
| 304 | { | ||
| 305 | return; | ||
| 306 | } | ||
| 307 | |||
| 308 | static inline struct page *fscrypt_encrypt_pagecache_blocks(struct page *page, | 284 | static inline struct page *fscrypt_encrypt_pagecache_blocks(struct page *page, |
| 309 | unsigned int len, | 285 | unsigned int len, |
| 310 | unsigned int offs, | 286 | unsigned int offs, |
| @@ -484,11 +460,6 @@ static inline void fscrypt_decrypt_bio(struct bio *bio) · 173 unmodified lines | |||
| 484 | { | 460 | { |
| 485 | } | 461 | } |
| 486 | 462 | ||
| 487 | static inline void fscrypt_enqueue_decrypt_bio(struct fscrypt_ctx *ctx, | ||
| 488 | struct bio *bio) | ||
| 489 | { | ||
| 490 | } | ||
| 491 | |||
| 492 | static inline int fscrypt_zeroout_range(const struct inode *inode, pgoff_t lblk, | 463 | static inline int fscrypt_zeroout_range(const struct inode *inode, pgoff_t lblk, |
| 493 | sector_t pblk, unsigned int len) | 464 | sector_t pblk, unsigned int len) |
| 494 | { | 465 | { |