diff options
author | David Gstir <david@sigma-star.at> | 2016-11-13 22:20:48 +0100 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2016-11-13 20:18:16 -0500 |
commit | 9c4bb8a3a9b4de21753053d667310c2b7cb39916 (patch) | |
tree | f384bbd76dfc293f2cc66c770c5ccfdbc42c43c8 /include/linux/fscrypto.h | |
parent | 0b93e1b94b86f826d18a2aaf219a53e271274d49 (diff) | |
download | lwn-9c4bb8a3a9b4de21753053d667310c2b7cb39916.tar.gz lwn-9c4bb8a3a9b4de21753053d667310c2b7cb39916.zip |
fscrypt: Let fs select encryption index/tweak
Avoid re-use of page index as tweak for AES-XTS when multiple parts of
same page are encrypted. This will happen on multiple (partial) calls of
fscrypt_encrypt_page on same page.
page->index is only valid for writeback pages.
Signed-off-by: David Gstir <david@sigma-star.at>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'include/linux/fscrypto.h')
-rw-r--r-- | include/linux/fscrypto.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/fscrypto.h b/include/linux/fscrypto.h index e9be944a324c..98c71e973a96 100644 --- a/include/linux/fscrypto.h +++ b/include/linux/fscrypto.h @@ -250,9 +250,9 @@ extern struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *, gfp_t); extern void fscrypt_release_ctx(struct fscrypt_ctx *); extern struct page *fscrypt_encrypt_page(const struct inode *, struct page *, unsigned int, unsigned int, - gfp_t); + pgoff_t, gfp_t); extern int fscrypt_decrypt_page(const struct inode *, struct page *, unsigned int, - unsigned int); + unsigned int, pgoff_t); extern void fscrypt_decrypt_bio_pages(struct fscrypt_ctx *, struct bio *); extern void fscrypt_pullback_bio_page(struct page **, bool); extern void fscrypt_restore_control_page(struct page *); @@ -299,13 +299,14 @@ static inline struct page *fscrypt_notsupp_encrypt_page(const struct inode *i, struct page *p, unsigned int len, unsigned int offs, - gfp_t f) + pgoff_t index, gfp_t f) { return ERR_PTR(-EOPNOTSUPP); } static inline int fscrypt_notsupp_decrypt_page(const struct inode *i, struct page *p, - unsigned int len, unsigned int offs) + unsigned int len, unsigned int offs, + pgoff_t index) { return -EOPNOTSUPP; } |