summaryrefslogtreecommitdiffstats
path: root/patches/cve/CVE-2018-11412-ext4-do-not-allow-external-inodes-for-inline-data.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/cve/CVE-2018-11412-ext4-do-not-allow-external-inodes-for-inline-data.patch')
-rw-r--r--patches/cve/CVE-2018-11412-ext4-do-not-allow-external-inodes-for-inline-data.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/patches/cve/CVE-2018-11412-ext4-do-not-allow-external-inodes-for-inline-data.patch b/patches/cve/CVE-2018-11412-ext4-do-not-allow-external-inodes-for-inline-data.patch
new file mode 100644
index 0000000..49a8664
--- /dev/null
+++ b/patches/cve/CVE-2018-11412-ext4-do-not-allow-external-inodes-for-inline-data.patch
@@ -0,0 +1,54 @@
1From e81d371dac30019816a1c5a3a2c4c44bb3c68558 Mon Sep 17 00:00:00 2001
2From: Theodore Ts'o <tytso@mit.edu>
3Date: Tue, 22 May 2018 16:15:24 -0400
4Subject: [PATCH] ext4: do not allow external inodes for inline data
5
6commit 117166efb1ee8f13c38f9e96b258f16d4923f888 upstream.
7
8The inline data feature was implemented before we added support for
9external inodes for xattrs. It makes no sense to support that
10combination, but the problem is that there are a number of extended
11attribute checks that are skipped if e_value_inum is non-zero.
12
13Unfortunately, the inline data code is completely e_value_inum
14unaware, and attempts to interpret the xattr fields as if it were an
15inline xattr --- at which point, Hilarty Ensues.
16
17This addresses CVE-2018-11412.
18
19https://bugzilla.kernel.org/show_bug.cgi?id=199803
20
21CVE: CVE-2018-11412
22Upstream-Status: Backport [https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-4.14.y&id=e81d371dac30019816a1c5a3a2c4c44bb3c68558]
23
24Reported-by: Jann Horn <jannh@google.com>
25Reviewed-by: Andreas Dilger <adilger@dilger.ca>
26Signed-off-by: Theodore Ts'o <tytso@mit.edu>
27Fixes: e50e5129f384 ("ext4: xattr-in-inode support")
28Cc: stable@kernel.org
29Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
30Signed-off-by: Andreas Wellving <andreas.wellving@enea.com>
31---
32 fs/ext4/inline.c | 6 ++++++
33 1 file changed, 6 insertions(+)
34
35diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
36index fd9501977f1c..8f5dc243effd 100644
37--- a/fs/ext4/inline.c
38+++ b/fs/ext4/inline.c
39@@ -150,6 +150,12 @@ int ext4_find_inline_data_nolock(struct inode *inode)
40 goto out;
41
42 if (!is.s.not_found) {
43+ if (is.s.here->e_value_inum) {
44+ EXT4_ERROR_INODE(inode, "inline data xattr refers "
45+ "to an external xattr inode");
46+ error = -EFSCORRUPTED;
47+ goto out;
48+ }
49 EXT4_I(inode)->i_inline_off = (u16)((void *)is.s.here -
50 (void *)ext4_raw_inode(&is.iloc));
51 EXT4_I(inode)->i_inline_size = EXT4_MIN_INLINE_DATA_SIZE +
52--
532.20.1
54