summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Stratulat <adrian.stratulat@enea.com>2019-05-28 11:42:57 +0200
committerAdrian Stratulat <adrian.stratulat@enea.com>2019-05-28 12:57:10 +0200
commit8c226b6462bfbecd88caa83bf13cef888584628a (patch)
tree92fcca1d7f64e93ec31d52f14fe0a2e1b5b85431
parent8f4dae8fb7ae74e4ae7087712cb44492e294e6b0 (diff)
downloadenea-kernel-cache-8c226b6462bfbecd88caa83bf13cef888584628a.tar.gz
linux-qoriq: CVE-2019-9213
References: https://nvd.nist.gov/vuln/detail/CVE-2019-9213 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0a1d52994d440e21def1c2174932410b4f2a98a1 Change-Id: I7e7c96ccfc698f229b195692ecf804c89a27e933 Signed-off-by: Adrian Stratulat <adrian.stratulat@enea.com>
-rw-r--r--patches/cve/4.14.x.scc2
-rw-r--r--patches/cve/CVE-2019-9213.patch46
2 files changed, 48 insertions, 0 deletions
diff --git a/patches/cve/4.14.x.scc b/patches/cve/4.14.x.scc
index b41503c..8280a4c 100644
--- a/patches/cve/4.14.x.scc
+++ b/patches/cve/4.14.x.scc
@@ -1 +1,3 @@
1patch CVE-2019-8980.patch 1patch CVE-2019-8980.patch
2
3patch CVE-2019-9213.patch
diff --git a/patches/cve/CVE-2019-9213.patch b/patches/cve/CVE-2019-9213.patch
new file mode 100644
index 0000000..3b1d5d9
--- /dev/null
+++ b/patches/cve/CVE-2019-9213.patch
@@ -0,0 +1,46 @@
1From 0a1d52994d440e21def1c2174932410b4f2a98a1 Mon Sep 17 00:00:00 2001
2From: Jann Horn <jannh@google.com>
3Date: Wed, 27 Feb 2019 21:29:52 +0100
4Subject: mm: enforce min addr even if capable() in expand_downwards()
5
6security_mmap_addr() does a capability check with current_cred(), but
7we can reach this code from contexts like a VFS write handler where
8current_cred() must not be used.
9
10This can be abused on systems without SMAP to make NULL pointer
11dereferences exploitable again.
12
13Fixes: 8869477a49c3 ("security: protect from stack expansion into low vm addresses")
14Cc: stable@kernel.org
15Signed-off-by: Jann Horn <jannh@google.com>
16Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17Signed-off-by: Adrian Stratulat <adrian.stratulat@enea.com>
18Upstream-Status: Backport [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0a1d52994d440e21def1c2174932410b4f2a98a1]
19CVE: CVE-2019-9213
20---
21 mm/mmap.c | 7 +++----
22 1 file changed, 3 insertions(+), 4 deletions(-)
23
24diff --git a/mm/mmap.c b/mm/mmap.c
25index f901065c4c64..fc1809b1bed6 100644
26--- a/mm/mmap.c
27+++ b/mm/mmap.c
28@@ -2426,12 +2426,11 @@ int expand_downwards(struct vm_area_struct *vma,
29 {
30 struct mm_struct *mm = vma->vm_mm;
31 struct vm_area_struct *prev;
32- int error;
33+ int error = 0;
34
35 address &= PAGE_MASK;
36- error = security_mmap_addr(address);
37- if (error)
38- return error;
39+ if (address < mmap_min_addr)
40+ return -EPERM;
41
42 /* Enforce stack_guard_gap */
43 prev = vma->vm_prev;
44--
45cgit 1.2-0.3.lf.el7
46