summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/squashfs-tools/squashfs-tools/squashfs-4.2-fix-CVE-2012-4024.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/squashfs-tools/squashfs-tools/squashfs-4.2-fix-CVE-2012-4024.patch')
-rw-r--r--meta/recipes-devtools/squashfs-tools/squashfs-tools/squashfs-4.2-fix-CVE-2012-4024.patch32
1 files changed, 23 insertions, 9 deletions
diff --git a/meta/recipes-devtools/squashfs-tools/squashfs-tools/squashfs-4.2-fix-CVE-2012-4024.patch b/meta/recipes-devtools/squashfs-tools/squashfs-tools/squashfs-4.2-fix-CVE-2012-4024.patch
index 8b9904fd56..52af60206a 100644
--- a/meta/recipes-devtools/squashfs-tools/squashfs-tools/squashfs-4.2-fix-CVE-2012-4024.patch
+++ b/meta/recipes-devtools/squashfs-tools/squashfs-tools/squashfs-4.2-fix-CVE-2012-4024.patch
@@ -1,7 +1,12 @@
1From bf9776123b854ce30a21403e4df4d4f5deb6af91 Mon Sep 17 00:00:00 2001
2From: "yanjun.zhu" <yanjun.zhu@windriver.com>
3Date: Wed, 20 May 2015 18:14:12 +0200
4Subject: [PATCH 3/4] Fix CVE-2012-4024
5
1Upstream-Status: Backport 6Upstream-Status: Backport
2 7
3Reference:http://squashfs.git.sourceforge.net/git/gitweb.cgi?p= 8Reference:
4squashfs/squashfs;a=commit;h=19c38fba0be1ce949ab44310d7f49887576cc123 9https://github.com/plougher/squashfs-tools/commit/19c38fba0be1ce949ab44310d7f49887576cc123
5 10
6Fix potential stack overflow in get_component() where an individual 11Fix potential stack overflow in get_component() where an individual
7pathname component in an extract file (specified on the command line 12pathname component in an extract file (specified on the command line
@@ -12,10 +17,16 @@ Fix by dynamically allocating targname rather than storing it as
12a fixed size on the stack. 17a fixed size on the stack.
13 18
14Signed-off-by: yanjun.zhu <yanjun.zhu@windriver.com> 19Signed-off-by: yanjun.zhu <yanjun.zhu@windriver.com>
15diff -urpN a/unsquashfs.c b/unsquashfs.c 20Signed-off-by: Martin Jansa <martin.jansa@lge.com>
16--- a/unsquashfs.c 2012-11-29 17:04:08.000000000 +0800 21---
17+++ b/unsquashfs.c 2012-11-29 17:04:25.000000000 +0800 22 squashfs-tools/unsquashfs.c | 17 +++++++++++------
18@@ -1034,15 +1034,18 @@ void squashfs_closedir(struct dir *dir) 23 1 file changed, 11 insertions(+), 6 deletions(-)
24
25diff --git a/unsquashfs.c b/unsquashfs.c
26index d532486..4fc04e8 100644
27--- a/unsquashfs.c
28+++ b/unsquashfs.c
29@@ -1076,15 +1076,18 @@ void squashfs_closedir(struct dir *dir)
19 } 30 }
20 31
21 32
@@ -37,7 +48,7 @@ diff -urpN a/unsquashfs.c b/unsquashfs.c
37 48
38 return target; 49 return target;
39 } 50 }
40@@ -1068,12 +1071,12 @@ void free_path(struct pathname *paths) 51@@ -1110,12 +1113,12 @@ void free_path(struct pathname *paths)
41 52
42 struct pathname *add_path(struct pathname *paths, char *target, char *alltarget) 53 struct pathname *add_path(struct pathname *paths, char *target, char *alltarget)
43 { 54 {
@@ -52,7 +63,7 @@ diff -urpN a/unsquashfs.c b/unsquashfs.c
52 63
53 if(paths == NULL) { 64 if(paths == NULL) {
54 paths = malloc(sizeof(struct pathname)); 65 paths = malloc(sizeof(struct pathname));
55@@ -1097,7 +1100,7 @@ struct pathname *add_path(struct pathnam 66@@ -1139,7 +1142,7 @@ struct pathname *add_path(struct pathname *paths, char *target, char *alltarget)
56 sizeof(struct path_entry)); 67 sizeof(struct path_entry));
57 if(paths->name == NULL) 68 if(paths->name == NULL)
58 EXIT_UNSQUASH("Out of memory in add_path\n"); 69 EXIT_UNSQUASH("Out of memory in add_path\n");
@@ -61,7 +72,7 @@ diff -urpN a/unsquashfs.c b/unsquashfs.c
61 paths->name[i].paths = NULL; 72 paths->name[i].paths = NULL;
62 if(use_regex) { 73 if(use_regex) {
63 paths->name[i].preg = malloc(sizeof(regex_t)); 74 paths->name[i].preg = malloc(sizeof(regex_t));
64@@ -1130,6 +1133,8 @@ struct pathname *add_path(struct pathnam 75@@ -1172,6 +1175,8 @@ struct pathname *add_path(struct pathname *paths, char *target, char *alltarget)
65 /* 76 /*
66 * existing matching entry 77 * existing matching entry
67 */ 78 */
@@ -70,3 +81,6 @@ diff -urpN a/unsquashfs.c b/unsquashfs.c
70 if(paths->name[i].paths == NULL) { 81 if(paths->name[i].paths == NULL) {
71 /* 82 /*
72 * No sub-directory which means this is the leaf 83 * No sub-directory which means this is the leaf
84--
852.1.4
86