diff options
author | Andreas Wellving <andreas.wellving@enea.com> | 2018-10-15 11:03:37 +0200 |
---|---|---|
committer | Adrian Dudau <Adrian.Dudau@enea.com> | 2018-10-16 17:40:48 +0200 |
commit | 22fb5ca1b9a574ee206dce77c597ac34917e07db (patch) | |
tree | 2304cfcceefcebf4c15ba6a823ca864bb70f6df6 | |
parent | cff017671d315e638a8739fab4f3916c0972ec3e (diff) | |
download | enea-kernel-cache-22fb5ca1b9a574ee206dce77c597ac34917e07db.tar.gz |
hfsplus: CVE-2018-14617
hfsplus: fix NULL dereference in hfsplus_lookup()
References:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-4.9.y&id=1cedd72d0f688b9c169836649ac9ec07a3c601d6
https://bugzilla.kernel.org/show_bug.cgi?id=200297
Change-Id: Ifc245db8a6f5a5d41674ea3861dbbe096d61ed24
Signed-off-by: Andreas Wellving <andreas.wellving@enea.com>
-rw-r--r-- | patches/cve/4.9.x.scc | 1 | ||||
-rw-r--r-- | patches/cve/CVE-2018-14617-hfsplus-fix-NULL-dereference-in-hfsplus_lookup.patch | 60 |
2 files changed, 61 insertions, 0 deletions
diff --git a/patches/cve/4.9.x.scc b/patches/cve/4.9.x.scc index 9c3d920..fe717bb 100644 --- a/patches/cve/4.9.x.scc +++ b/patches/cve/4.9.x.scc | |||
@@ -52,3 +52,4 @@ patch CVE-2018-10938-Cipso-cipso_v4_optptr-enter-infinite-loop.patch | |||
52 | 52 | ||
53 | #CVEs fixed in 4.9.127: | 53 | #CVEs fixed in 4.9.127: |
54 | patch CVE-2018-14609-btrfs-relocation-Only-remove-reloc-rb_trees-if-reloc.patch | 54 | patch CVE-2018-14609-btrfs-relocation-Only-remove-reloc-rb_trees-if-reloc.patch |
55 | patch CVE-2018-14617-hfsplus-fix-NULL-dereference-in-hfsplus_lookup.patch | ||
diff --git a/patches/cve/CVE-2018-14617-hfsplus-fix-NULL-dereference-in-hfsplus_lookup.patch b/patches/cve/CVE-2018-14617-hfsplus-fix-NULL-dereference-in-hfsplus_lookup.patch new file mode 100644 index 0000000..496b201 --- /dev/null +++ b/patches/cve/CVE-2018-14617-hfsplus-fix-NULL-dereference-in-hfsplus_lookup.patch | |||
@@ -0,0 +1,60 @@ | |||
1 | From a7ec7a4193a2eb3b5341243fc0b621c1ac9e4ec4 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Ernesto=20A=2E=20Fern=C3=A1ndez?= | ||
3 | <ernesto.mnd.fernandez@gmail.com> | ||
4 | Date: Thu, 23 Aug 2018 17:00:25 -0700 | ||
5 | Subject: [PATCH] hfsplus: fix NULL dereference in hfsplus_lookup() | ||
6 | MIME-Version: 1.0 | ||
7 | Content-Type: text/plain; charset=UTF-8 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | |||
10 | An HFS+ filesystem can be mounted read-only without having a metadata | ||
11 | directory, which is needed to support hardlinks. But if the catalog | ||
12 | data is corrupted, a directory lookup may still find dentries claiming | ||
13 | to be hardlinks. | ||
14 | |||
15 | hfsplus_lookup() does check that ->hidden_dir is not NULL in such a | ||
16 | situation, but mistakenly does so after dereferencing it for the first | ||
17 | time. Reorder this check to prevent a crash. | ||
18 | |||
19 | This happens when looking up corrupted catalog data (dentry) on a | ||
20 | filesystem with no metadata directory (this could only ever happen on a | ||
21 | read-only mount). Wen Xu sent the replication steps in detail to the | ||
22 | fsdevel list: https://bugzilla.kernel.org/show_bug.cgi?id=200297 | ||
23 | |||
24 | CVE: CVE-2018-14617 | ||
25 | Upstream-Status: Backport | ||
26 | |||
27 | Link: http://lkml.kernel.org/r/20180712215344.q44dyrhymm4ajkao@eaf | ||
28 | Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com> | ||
29 | Reported-by: Wen Xu <wen.xu@gatech.edu> | ||
30 | Cc: Viacheslav Dubeyko <slava@dubeyko.com> | ||
31 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
32 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
33 | Signed-off-by: Andreas Wellving <andreas.wellving@enea.com> | ||
34 | --- | ||
35 | fs/hfsplus/dir.c | 4 ++-- | ||
36 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
37 | |||
38 | diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c | ||
39 | index c5a70f8..f376626 100644 | ||
40 | --- a/fs/hfsplus/dir.c | ||
41 | +++ b/fs/hfsplus/dir.c | ||
42 | @@ -77,13 +77,13 @@ static struct dentry *hfsplus_lookup(struct inode *dir, struct dentry *dentry, | ||
43 | cpu_to_be32(HFSP_HARDLINK_TYPE) && | ||
44 | entry.file.user_info.fdCreator == | ||
45 | cpu_to_be32(HFSP_HFSPLUS_CREATOR) && | ||
46 | + HFSPLUS_SB(sb)->hidden_dir && | ||
47 | (entry.file.create_date == | ||
48 | HFSPLUS_I(HFSPLUS_SB(sb)->hidden_dir)-> | ||
49 | create_date || | ||
50 | entry.file.create_date == | ||
51 | HFSPLUS_I(d_inode(sb->s_root))-> | ||
52 | - create_date) && | ||
53 | - HFSPLUS_SB(sb)->hidden_dir) { | ||
54 | + create_date)) { | ||
55 | struct qstr str; | ||
56 | char name[32]; | ||
57 | |||
58 | -- | ||
59 | |||
60 | |||