From 5cb1e3ef5d4c6eac40e622dd759438cd3d0125a5 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 26 Nov 2015 15:21:07 -0500 Subject: [PATCH] add patch fix-an-endianness-bug-in-ext4_encrypted-zeroout --- fix-an-endianness-bug-in-ext4_encrypted-zeroout | 34 +++++++++++++++++++++++++ series | 1 + timestamps | 7 ++--- 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 fix-an-endianness-bug-in-ext4_encrypted-zeroout diff --git a/fix-an-endianness-bug-in-ext4_encrypted-zeroout b/fix-an-endianness-bug-in-ext4_encrypted-zeroout new file mode 100644 index 00000000..5ec56d31 --- /dev/null +++ b/fix-an-endianness-bug-in-ext4_encrypted-zeroout @@ -0,0 +1,34 @@ +ext4: fix an endianness bug in ext4_encrypted_zeroout() + +From: Al Viro + +ex->ee_block is not host-endian (note that accesses of other fields +of *ex right next to that line go through the helpers that do proper +conversion from little-endian to host-endian; it might make sense +to add similar for ->ee_block to avoid reintroducing that kind of +bugs...) + +Cc: stable@vger.kernel.org # v4.1+ +Signed-off-by: Al Viro +Signed-off-by: Theodore Ts'o +--- + +diff --git a/fs/ext4/crypto.c b/fs/ext4/crypto.c +index af06830..1a08350 100644 +--- a/fs/ext4/crypto.c ++++ b/fs/ext4/crypto.c +@@ -389,7 +389,7 @@ int ext4_encrypted_zeroout(struct inode *inode, struct ext4_extent *ex) + struct ext4_crypto_ctx *ctx; + struct page *ciphertext_page = NULL; + struct bio *bio; +- ext4_lblk_t lblk = ex->ee_block; ++ ext4_lblk_t lblk = le32_to_cpu(ex->ee_block); + ext4_fsblk_t pblk = ext4_ext_pblock(ex); + unsigned int len = ext4_ext_get_actual_len(ex); + int ret, err = 0; +-- +To unsubscribe from this list: send the line "unsubscribe linux-kernel" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html +Please read the FAQ at http://www.tux.org/lkml/ + diff --git a/series b/series index 65343022..11ab92d9 100644 --- a/series +++ b/series @@ -2,6 +2,7 @@ fix-handling-of-extended-tv_sec fix-unreclaimed-pages-after-truncate-in-data_journal-mode +fix-an-endianness-bug-in-ext4_encrypted-zeroout ########################################## # unstable patches diff --git a/timestamps b/timestamps index af6f630f..c06a960c 100755 --- a/timestamps +++ b/timestamps @@ -36,6 +36,7 @@ touch -d @1445651125 use-pre-zeroed-blocks-for-DAX-page-faults touch -d @1446142753 stable-boundary touch -d @1448393677 fix-handling-of-extended-tv_sec touch -d @1448397275 fix-unreclaimed-pages-after-truncate-in-data_journal-mode -touch -d @1448397325 series -touch -d @1448397331 status -touch -d @1448568726 timestamps +touch -d @1448569208 series +touch -d @1448569219 fix-an-endianness-bug-in-ext4_encrypted-zeroout +touch -d @1448569225 status +touch -d @1448569256 timestamps -- 2.11.4.GIT