1 ext4: fix an endianness bug in ext4_encrypted_zeroout()
3 From: Al Viro <viro@ZenIV.linux.org.uk>
5 ex->ee_block is not host-endian (note that accesses of other fields
6 of *ex right next to that line go through the helpers that do proper
7 conversion from little-endian to host-endian; it might make sense
8 to add similar for ->ee_block to avoid reintroducing that kind of
11 Cc: stable@vger.kernel.org # v4.1+
12 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
16 diff --git a/fs/ext4/crypto.c b/fs/ext4/crypto.c
17 index af06830..1a08350 100644
18 --- a/fs/ext4/crypto.c
19 +++ b/fs/ext4/crypto.c
20 @@ -389,7 +389,7 @@ int ext4_encrypted_zeroout(struct inode *inode, struct ext4_extent *ex)
21 struct ext4_crypto_ctx *ctx;
22 struct page *ciphertext_page = NULL;
24 - ext4_lblk_t lblk = ex->ee_block;
25 + ext4_lblk_t lblk = le32_to_cpu(ex->ee_block);
26 ext4_fsblk_t pblk = ext4_ext_pblock(ex);
27 unsigned int len = ext4_ext_get_actual_len(ex);
30 To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
31 the body of a message to majordomo@vger.kernel.org
32 More majordomo info at http://vger.kernel.org/majordomo-info.html
33 Please read the FAQ at http://www.tux.org/lkml/