summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Wellving <andreas.wellving@enea.com>2018-10-12 15:49:44 +0200
committerAdrian Dudau <Adrian.Dudau@enea.com>2018-10-16 17:39:36 +0200
commit5c044f4e3ba6f258312bbcd0e2545bd972db02aa (patch)
tree61526ce91acf14497aa4852240de336511afd2b2
parent5580db5bda636e69110ab0bf0733192bd1050fbc (diff)
downloadenea-kernel-cache-5c044f4e3ba6f258312bbcd0e2545bd972db02aa.tar.gz
ext4: CVE-2018-10881
ext4: clear i_data in ext4_inode_info when removing inline data References: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6e8ab72a812396996035a37e5ca4b3b99b5d214b Signed-off-by: Andreas Wellving <andreas.wellving@enea.com> Change-Id: I1070aa3fee30f445dfad0b86fc12787f7f50235d
-rw-r--r--patches/cve/4.9.x.scc1
-rw-r--r--patches/cve/CVE-2018-10881-ext4-clear-i_data-in-ext4_inode_info-when-removing-i.patch50
2 files changed, 51 insertions, 0 deletions
diff --git a/patches/cve/4.9.x.scc b/patches/cve/4.9.x.scc
index e5bf4ac..55c4591 100644
--- a/patches/cve/4.9.x.scc
+++ b/patches/cve/4.9.x.scc
@@ -31,4 +31,5 @@ patch CVE-2018-10876-ext4-only-look-at-the-bg_flags-field-if-it-is-valid.patch
31patch CVE-2018-10877-ext4-verify-the-depth-of-extent-tree-in-ext4_find_ex.patch 31patch CVE-2018-10877-ext4-verify-the-depth-of-extent-tree-in-ext4_find_ex.patch
32patch CVE-2018-10878-ext4-always-check-block-group-bounds-in-ext4_init_bl.patch 32patch CVE-2018-10878-ext4-always-check-block-group-bounds-in-ext4_init_bl.patch
33patch CVE-2018-10879-ext4-make-sure-bitmaps-and-the-inode-table-don-t-ove.patch 33patch CVE-2018-10879-ext4-make-sure-bitmaps-and-the-inode-table-don-t-ove.patch
34patch CVE-2018-10881-ext4-clear-i_data-in-ext4_inode_info-when-removing-i.patch
34 35
diff --git a/patches/cve/CVE-2018-10881-ext4-clear-i_data-in-ext4_inode_info-when-removing-i.patch b/patches/cve/CVE-2018-10881-ext4-clear-i_data-in-ext4_inode_info-when-removing-i.patch
new file mode 100644
index 0000000..1abf375
--- /dev/null
+++ b/patches/cve/CVE-2018-10881-ext4-clear-i_data-in-ext4_inode_info-when-removing-i.patch
@@ -0,0 +1,50 @@
1From 6e8ab72a812396996035a37e5ca4b3b99b5d214b Mon Sep 17 00:00:00 2001
2From: Theodore Ts'o <tytso@mit.edu>
3Date: Fri, 15 Jun 2018 12:28:16 -0400
4Subject: [PATCH] ext4: clear i_data in ext4_inode_info when removing inline
5 data
6
7When converting from an inode from storing the data in-line to a data
8block, ext4_destroy_inline_data_nolock() was only clearing the on-disk
9copy of the i_blocks[] array. It was not clearing copy of the
10i_blocks[] in ext4_inode_info, in i_data[], which is the copy actually
11used by ext4_map_blocks().
12
13This didn't matter much if we are using extents, since the extents
14header would be invalid and thus the extents could would re-initialize
15the extents tree. But if we are using indirect blocks, the previous
16contents of the i_blocks array will be treated as block numbers, with
17potentially catastrophic results to the file system integrity and/or
18user data.
19
20This gets worse if the file system is using a 1k block size and
21s_first_data is zero, but even without this, the file system can get
22quite badly corrupted.
23
24This addresses CVE-2018-10881.
25Upstream-Status: Backport
26
27https://bugzilla.kernel.org/show_bug.cgi?id=200015
28
29Signed-off-by: Theodore Ts'o <tytso@mit.edu>
30Cc: stable@kernel.org
31Signed-off-by: Andreas Wellving <andreas.wellving@enea.com>
32---
33 fs/ext4/inline.c | 1 +
34 1 file changed, 1 insertion(+)
35
36diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
37index 44b4fcd..d79115d 100644
38--- a/fs/ext4/inline.c
39+++ b/fs/ext4/inline.c
40@@ -437,6 +437,7 @@ static int ext4_destroy_inline_data_nolock(handle_t *handle,
41
42 memset((void *)ext4_raw_inode(&is.iloc)->i_block,
43 0, EXT4_MIN_INLINE_DATA_SIZE);
44+ memset(ei->i_data, 0, EXT4_MIN_INLINE_DATA_SIZE);
45
46 if (ext4_has_feature_extents(inode->i_sb)) {
47 if (S_ISDIR(inode->i_mode) ||
48--
49
50