]> code.ossystems Code Review - meta-freescale.git/commitdiff
eCryptfs: CVE-2014-9683
authorSona Sarmadi <sona.sarmadi@enea.com>
Fri, 13 Mar 2015 11:54:03 +0000 (12:54 +0100)
committerZhenhua Luo <zhenhua.luo@freescale.com>
Tue, 31 Mar 2015 03:21:41 +0000 (11:21 +0800)
This fixes a 1-byte NULL write past the end of allocated memory

References
http://seclists.org/oss-sec/2015/q1/582
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-9683

Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
meta-fsl-ppc/recipes-kernel/linux/files/eCryptfs-CVE-2014-9683.patch [new file with mode: 0644]
meta-fsl-ppc/recipes-kernel/linux/linux-qoriq_3.12.bb

diff --git a/meta-fsl-ppc/recipes-kernel/linux/files/eCryptfs-CVE-2014-9683.patch b/meta-fsl-ppc/recipes-kernel/linux/files/eCryptfs-CVE-2014-9683.patch
new file mode 100644 (file)
index 0000000..0cd9c95
--- /dev/null
@@ -0,0 +1,41 @@
+From 8ffea99d6f2be99790611282f326da95a84a8cab Mon Sep 17 00:00:00 2001
+From: Michael Halcrow <mhalcrow@google.com>
+Date: Wed, 26 Nov 2014 09:09:16 -0800
+Subject: [PATCH] eCryptfs: Remove buggy and unnecessary write in file name
+ decode routine
+
+commit 942080643bce061c3dd9d5718d3b745dcb39a8bc upstream.
+
+Dmitry Chernenkov used KASAN to discover that eCryptfs writes past the
+end of the allocated buffer during encrypted filename decoding. This
+fix corrects the issue by getting rid of the unnecessary 0 write when
+the current bit offset is 2.
+
+Fixes CVE-2014-9683
+Upstream-Status: Backport
+
+Signed-off-by: Michael Halcrow <mhalcrow@google.com>
+Reported-by: Dmitry Chernenkov <dmitryc@google.com>
+Suggested-by: Kees Cook <keescook@chromium.org>
+Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+---
+ fs/ecryptfs/crypto.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
+index 000eae2..bf926f7 100644
+--- a/fs/ecryptfs/crypto.c
++++ b/fs/ecryptfs/crypto.c
+@@ -1917,7 +1917,6 @@ ecryptfs_decode_from_filename(unsigned char *dst, size_t *dst_size,
+                       break;
+               case 2:
+                       dst[dst_byte_offset++] |= (src_byte);
+-                      dst[dst_byte_offset] = 0;
+                       current_bit_offset = 0;
+                       break;
+               }
+-- 
+1.9.1
+
index f082b04666ba737c4882b455bd0d4de2e53e7a64..1e9e4761ec1a0569161a1e5b0d7af0c599ae38f6 100644 (file)
@@ -37,6 +37,7 @@ SRC_URI = "git://git.freescale.com/ppc/sdk/linux.git;nobranch=1 \
     file://fs-CVE-2014-4014.patch \
     file://tracing-CVE-2014-7825_CVE-2014-7826.patch \
     file://security-keys-CVE-2014-9529.patch \
+    file://eCryptfs-CVE-2014-9683.patch \
 "
 SRCREV = "6619b8b55796cdf0cec04b66a71288edd3057229"