summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Wellving <andreas.wellving@enea.com>2018-10-12 10:02:31 +0200
committerAdrian Dudau <Adrian.Dudau@enea.com>2018-10-16 17:34:14 +0200
commit70d96b74d700846ca3454a406629edff6f9edc04 (patch)
tree219593b44c5bed3f1ede36e5130028b48054568c
parent5590d516e5d8c7c1066f28e84d91d861e250a42c (diff)
downloadenea-kernel-cache-70d96b74d700846ca3454a406629edff6f9edc04.tar.gz
ext4: CVE-2018-1092
ext4: fail ext4_iget for root directory if unallocated References: https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git/commit/?id=8e4b5eae5decd9dfe5a4ee369c22028f90ab4c44 Change-Id: If2dd6fd5735e5e0e3282342dec93342f6b2c0943 Signed-off-by: Andreas Wellving <andreas.wellving@enea.com>
-rw-r--r--patches/cve/4.9.x.scc3
-rw-r--r--patches/cve/CVE-2018-1092-ext4-fail-ext4_iget-for-root-directory-if-unallocate.patch48
2 files changed, 51 insertions, 0 deletions
diff --git a/patches/cve/4.9.x.scc b/patches/cve/4.9.x.scc
index 3fa8213..4b6ec00 100644
--- a/patches/cve/4.9.x.scc
+++ b/patches/cve/4.9.x.scc
@@ -11,3 +11,6 @@ patch CVE-2018-7480-blkcg-fix-double-free-of-new_blkg-in-blkcg_init_queu.patch
11 11
12#CVEs fixed in 4.9.92: 12#CVEs fixed in 4.9.92:
13patch CVE-2018-1130-dccp-check-sk-for-closed-state-in-dccp_sendmsg.patch 13patch CVE-2018-1130-dccp-check-sk-for-closed-state-in-dccp_sendmsg.patch
14
15#CVEs fixed in 4.9.96:
16patch CVE-2018-1092-ext4-fail-ext4_iget-for-root-directory-if-unallocate.patch
diff --git a/patches/cve/CVE-2018-1092-ext4-fail-ext4_iget-for-root-directory-if-unallocate.patch b/patches/cve/CVE-2018-1092-ext4-fail-ext4_iget-for-root-directory-if-unallocate.patch
new file mode 100644
index 0000000..5d1d8dc
--- /dev/null
+++ b/patches/cve/CVE-2018-1092-ext4-fail-ext4_iget-for-root-directory-if-unallocate.patch
@@ -0,0 +1,48 @@
1From 8e4b5eae5decd9dfe5a4ee369c22028f90ab4c44 Mon Sep 17 00:00:00 2001
2From: Theodore Ts'o <tytso@mit.edu>
3Date: Thu, 29 Mar 2018 21:56:09 -0400
4Subject: [PATCH] ext4: fail ext4_iget for root directory if unallocated
5
6If the root directory has an i_links_count of zero, then when the file
7system is mounted, then when ext4_fill_super() notices the problem and
8tries to call iput() the root directory in the error return path,
9ext4_evict_inode() will try to free the inode on disk, before all of
10the file system structures are set up, and this will result in an OOPS
11caused by a NULL pointer dereference.
12
13This issue has been assigned CVE-2018-1092.
14
15https://bugzilla.kernel.org/show_bug.cgi?id=199179
16https://bugzilla.redhat.com/show_bug.cgi?id=1560777
17
18CVE: CVE-2018-1092
19Upstream-Status: Backport
20
21Reported-by: Wen Xu <wen.xu@gatech.edu>
22Signed-off-by: Theodore Ts'o <tytso@mit.edu>
23Cc: stable@vger.kernel.org
24Signed-off-by: Andreas Wellving <andreas.wellving@enea.com>
25---
26 fs/ext4/inode.c | 6 ++++++
27 1 file changed, 6 insertions(+)
28
29diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
30index 4359655..18aa2ef 100644
31--- a/fs/ext4/inode.c
32+++ b/fs/ext4/inode.c
33@@ -4732,6 +4732,12 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
34 goto bad_inode;
35 raw_inode = ext4_raw_inode(&iloc);
36
37+ if ((ino == EXT4_ROOT_INO) && (raw_inode->i_links_count == 0)) {
38+ EXT4_ERROR_INODE(inode, "root inode unallocated");
39+ ret = -EFSCORRUPTED;
40+ goto bad_inode;
41+ }
42+
43 if (EXT4_INODE_SIZE(inode->i_sb) > EXT4_GOOD_OLD_INODE_SIZE) {
44 ei->i_extra_isize = le16_to_cpu(raw_inode->i_extra_isize);
45 if (EXT4_GOOD_OLD_INODE_SIZE + ei->i_extra_isize >
46--
47
48