summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-intel/CVE-2018-12233.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-intel/CVE-2018-12233.patch')
-rw-r--r--recipes-kernel/linux/linux-intel/CVE-2018-12233.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-intel/CVE-2018-12233.patch b/recipes-kernel/linux/linux-intel/CVE-2018-12233.patch
new file mode 100644
index 0000000..d7b6fb8
--- /dev/null
+++ b/recipes-kernel/linux/linux-intel/CVE-2018-12233.patch
@@ -0,0 +1,52 @@
1From 7d29fb53439c8c91874550cc078eda6db8feafe7 Mon Sep 17 00:00:00 2001
2From: Shankara Pailoor <shankarapailoor@gmail.com>
3Date: Tue, 5 Jun 2018 08:33:27 -0500
4Subject: [PATCH] jfs: Fix inconsistency between memory allocation and
5 ea_buf->max_size
6
7commit 92d34134193e5b129dc24f8d79cb9196626e8d7a upstream.
8
9The code is assuming the buffer is max_size length, but we weren't
10allocating enough space for it.
11
12CVE: CVE-2018-12233
13Upstream-Status: Backport
14
15Signed-off-by: Shankara Pailoor <shankarapailoor@gmail.com>
16Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
17Cc: Guenter Roeck <linux@roeck-us.net>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
20---
21 fs/jfs/xattr.c | 10 ++++++----
22 1 file changed, 6 insertions(+), 4 deletions(-)
23
24diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c
25index c60f3d3..a679798 100644
26--- a/fs/jfs/xattr.c
27+++ b/fs/jfs/xattr.c
28@@ -491,15 +491,17 @@ static int ea_get(struct inode *inode, struct ea_buffer *ea_buf, int min_size)
29 if (size > PSIZE) {
30 /*
31 * To keep the rest of the code simple. Allocate a
32- * contiguous buffer to work with
33+ * contiguous buffer to work with. Make the buffer large
34+ * enough to make use of the whole extent.
35 */
36- ea_buf->xattr = kmalloc(size, GFP_KERNEL);
37+ ea_buf->max_size = (size + sb->s_blocksize - 1) &
38+ ~(sb->s_blocksize - 1);
39+
40+ ea_buf->xattr = kmalloc(ea_buf->max_size, GFP_KERNEL);
41 if (ea_buf->xattr == NULL)
42 return -ENOMEM;
43
44 ea_buf->flag = EA_MALLOC;
45- ea_buf->max_size = (size + sb->s_blocksize - 1) &
46- ~(sb->s_blocksize - 1);
47
48 if (ea_size == 0)
49 return 0;
50--
511.9.1
52