summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/elfutils/elfutils/elfutils-0.148-CVE-2014-9447.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/elfutils/elfutils/elfutils-0.148-CVE-2014-9447.patch')
-rw-r--r--meta/recipes-devtools/elfutils/elfutils/elfutils-0.148-CVE-2014-9447.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/meta/recipes-devtools/elfutils/elfutils/elfutils-0.148-CVE-2014-9447.patch b/meta/recipes-devtools/elfutils/elfutils/elfutils-0.148-CVE-2014-9447.patch
new file mode 100644
index 0000000000..8edec1b2ed
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils/elfutils-0.148-CVE-2014-9447.patch
@@ -0,0 +1,51 @@
1libelf: Fix dir traversal vuln in ar extraction.
2
3read_long_names terminates names at the first '/' found but
4then skips one character without checking (it's supposed to
5be '\n'). Hence the next name could start with any character
6including '/'. This leads to a directory traversal vulnerability
7at the time the contents of the archive is extracted.
8
9The danger is mitigated by the fact that only one '/' is
10possible in a resulting filename and only in the leading position.
11Hence only files in the root directory can be written via this vuln
12and only when ar is executed as root. The fix for the vuln is to not
13skip any characters while looking for '/'.
14
15Upstream commit:
16https://git.fedorahosted.org/cgit/elfutils.git/commit/
17?id=147018e729e7c22eeabf15b82d26e4bf68a0d18e
18
19Fixes CVE-2014-9447
20Upstream-Status: Backport
21
22Signed-off-by: Alexander Cherepanov <cherepan@mccme.ru>
23Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
24---
25diff -ruN a/libelf/ChangeLog b/libelf/ChangeLog
26--- a/libelf/ChangeLog 2015-03-03 10:45:03.586045753 +0100
27+++ b/libelf/ChangeLog 2015-03-03 10:47:14.052545814 +0100
28@@ -1,3 +1,8 @@
29+2014-12-28 Alexander Cherepanov <cherepan@mccme.ru>
30+
31+ * elf_begin.c (read_long_names): Don't miss '/' right after
32+ another '/'. Fixes a dir traversal vuln in ar extraction.
33+
34 2010-06-14 Ulrich Drepper <drepper@redhat.com>
35
36 * gelf_update_shdr.c: Implicitly set ELF_F_DIRTY bit.
37diff -ruN a/libelf/elf_begin.c b/libelf/elf_begin.c
38--- a/libelf/elf_begin.c 2015-03-03 10:45:04.414010849 +0100
39+++ b/libelf/elf_begin.c 2015-03-03 10:45:46.736226750 +0100
40@@ -765,10 +765,7 @@
41 break;
42
43 /* NUL-terminate the string. */
44- *runp = '\0';
45-
46- /* Skip the NUL byte and the \012. */
47- runp += 2;
48+ *runp++ = '\0';
49
50 /* A sanity check. Somebody might have generated invalid
51 archive. */