diff options
5 files changed, 5 insertions, 224 deletions
diff --git a/meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-mksquashfs.c-get-inline-functions-work-with-C99.patch b/meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-mksquashfs.c-get-inline-functions-work-with-C99.patch deleted file mode 100644 index a5bab05448..0000000000 --- a/meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-mksquashfs.c-get-inline-functions-work-with-C99.patch +++ /dev/null | |||
| @@ -1,154 +0,0 @@ | |||
| 1 | From ac6268e843c43286eebff2a1052182c2393cdb2e Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Roy Li <rongqing.li@windriver.com> | ||
| 3 | Date: Mon, 14 Sep 2015 12:31:42 +0800 | ||
| 4 | Subject: [PATCH] mksquashfs.c: get inline functions work with both gnu11 and gnu89 | ||
| 5 | |||
| 6 | Upstream-Status: Pending | ||
| 7 | |||
| 8 | After gcc upgraded to gcc5, and if the codes is compiled without optimization(-O0), | ||
| 9 | and the below error will happen: | ||
| 10 | |||
| 11 | | mksquashfs.o: In function `create_inode': | ||
| 12 | | git/squashfs-tools/mksquashfs.c:897: undefined reference to `get_inode_no' | ||
| 13 | | git/squashfs-tools/mksquashfs.c:960: undefined reference to `get_parent_no' | ||
| 14 | | git/squashfs-tools/mksquashfs.c:983: undefined reference to `get_parent_no' | ||
| 15 | | mksquashfs.o: In function `reader_read_process': | ||
| 16 | | git/squashfs-tools/mksquashfs.c:2132: undefined reference to `is_fragment' | ||
| 17 | | mksquashfs.o: In function `reader_read_file': | ||
| 18 | | git/squashfs-tools/mksquashfs.c:2228: undefined reference to `is_fragment' | ||
| 19 | | mksquashfs.o: In function `dir_scan': | ||
| 20 | | git/squashfs-tools/mksquashfs.c:3101: undefined reference to `create_dir_entry' | ||
| 21 | |||
| 22 | gcc5 defaults to -std=gnu11 instead of -std=gnu89, and it requires that exactly one C | ||
| 23 | source file has the callable copy of the inline function. Consider the following | ||
| 24 | program: | ||
| 25 | |||
| 26 | inline int | ||
| 27 | foo (void) | ||
| 28 | { | ||
| 29 | return 42; | ||
| 30 | } | ||
| 31 | |||
| 32 | int | ||
| 33 | main (void) | ||
| 34 | { | ||
| 35 | return foo (); | ||
| 36 | } | ||
| 37 | |||
| 38 | The program above will not link with the C99 inline semantics, because no out-of-line | ||
| 39 | function foo is generated. To fix this, either mark the function foo as static, or | ||
| 40 | add the following declaration: | ||
| 41 | static inline int foo (void); | ||
| 42 | |||
| 43 | more information refer to: https://gcc.gnu.org/gcc-5/porting_to.html; | ||
| 44 | |||
| 45 | but the use of "extern inline" will lead to the compilation issue if gcc is not | ||
| 46 | gcc5, as the commit in oe-core d0af30c92fde [alsa-lib: Change function type to | ||
| 47 | "static __inline__"] | ||
| 48 | "extern __inline__ function()" is the inlined version that | ||
| 49 | can be used in this compilation unit, but there will be another | ||
| 50 | definition of this function somewhere, so compiler will not emit | ||
| 51 | any code for the function body. This causes problem in -O0, | ||
| 52 | where functions are never inlined, the function call is preserved, | ||
| 53 | but linker can't find the symbol, thus the error happens. | ||
| 54 | |||
| 55 | so replace "inline" with "static inline" to make it work with both gnu11 and gnu89 | ||
| 56 | |||
| 57 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
| 58 | --- | ||
| 59 | squashfs-tools/mksquashfs.c | 20 ++++++++++---------- | ||
| 60 | 1 file changed, 10 insertions(+), 10 deletions(-) | ||
| 61 | |||
| 62 | diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c | ||
| 63 | index d221c35..6bba1d2 100644 | ||
| 64 | --- a/squashfs-tools/mksquashfs.c | ||
| 65 | +++ b/squashfs-tools/mksquashfs.c | ||
| 66 | @@ -828,13 +828,13 @@ char *subpathname(struct dir_ent *dir_ent) | ||
| 67 | } | ||
| 68 | |||
| 69 | |||
| 70 | -inline unsigned int get_inode_no(struct inode_info *inode) | ||
| 71 | +static inline unsigned int get_inode_no(struct inode_info *inode) | ||
| 72 | { | ||
| 73 | return inode->inode_number; | ||
| 74 | } | ||
| 75 | |||
| 76 | |||
| 77 | -inline unsigned int get_parent_no(struct dir_info *dir) | ||
| 78 | +static inline unsigned int get_parent_no(struct dir_info *dir) | ||
| 79 | { | ||
| 80 | return dir->depth ? get_inode_no(dir->dir_ent->inode) : inode_no; | ||
| 81 | } | ||
| 82 | @@ -2027,7 +2027,7 @@ struct file_info *duplicate(long long file_size, long long bytes, | ||
| 83 | } | ||
| 84 | |||
| 85 | |||
| 86 | -inline int is_fragment(struct inode_info *inode) | ||
| 87 | +static inline int is_fragment(struct inode_info *inode) | ||
| 88 | { | ||
| 89 | off_t file_size = inode->buf.st_size; | ||
| 90 | |||
| 91 | @@ -2996,13 +2996,13 @@ struct inode_info *lookup_inode2(struct stat *buf, int pseudo, int id) | ||
| 92 | } | ||
| 93 | |||
| 94 | |||
| 95 | -inline struct inode_info *lookup_inode(struct stat *buf) | ||
| 96 | +static inline struct inode_info *lookup_inode(struct stat *buf) | ||
| 97 | { | ||
| 98 | return lookup_inode2(buf, 0, 0); | ||
| 99 | } | ||
| 100 | |||
| 101 | |||
| 102 | -inline void alloc_inode_no(struct inode_info *inode, unsigned int use_this) | ||
| 103 | +static inline void alloc_inode_no(struct inode_info *inode, unsigned int use_this) | ||
| 104 | { | ||
| 105 | if (inode->inode_number == 0) { | ||
| 106 | inode->inode_number = use_this ? : inode_no ++; | ||
| 107 | @@ -3013,7 +3013,7 @@ inline void alloc_inode_no(struct inode_info *inode, unsigned int use_this) | ||
| 108 | } | ||
| 109 | |||
| 110 | |||
| 111 | -inline struct dir_ent *create_dir_entry(char *name, char *source_name, | ||
| 112 | +static inline struct dir_ent *create_dir_entry(char *name, char *source_name, | ||
| 113 | char *nonstandard_pathname, struct dir_info *dir) | ||
| 114 | { | ||
| 115 | struct dir_ent *dir_ent = malloc(sizeof(struct dir_ent)); | ||
| 116 | @@ -3031,7 +3031,7 @@ inline struct dir_ent *create_dir_entry(char *name, char *source_name, | ||
| 117 | } | ||
| 118 | |||
| 119 | |||
| 120 | -inline void add_dir_entry(struct dir_ent *dir_ent, struct dir_info *sub_dir, | ||
| 121 | +static inline void add_dir_entry(struct dir_ent *dir_ent, struct dir_info *sub_dir, | ||
| 122 | struct inode_info *inode_info) | ||
| 123 | { | ||
| 124 | struct dir_info *dir = dir_ent->our_dir; | ||
| 125 | @@ -3047,7 +3047,7 @@ inline void add_dir_entry(struct dir_ent *dir_ent, struct dir_info *sub_dir, | ||
| 126 | } | ||
| 127 | |||
| 128 | |||
| 129 | -inline void add_dir_entry2(char *name, char *source_name, | ||
| 130 | +static inline void add_dir_entry2(char *name, char *source_name, | ||
| 131 | char *nonstandard_pathname, struct dir_info *sub_dir, | ||
| 132 | struct inode_info *inode_info, struct dir_info *dir) | ||
| 133 | { | ||
| 134 | @@ -3059,7 +3059,7 @@ inline void add_dir_entry2(char *name, char *source_name, | ||
| 135 | } | ||
| 136 | |||
| 137 | |||
| 138 | -inline void free_dir_entry(struct dir_ent *dir_ent) | ||
| 139 | +static inline void free_dir_entry(struct dir_ent *dir_ent) | ||
| 140 | { | ||
| 141 | if(dir_ent->name) | ||
| 142 | free(dir_ent->name); | ||
| 143 | @@ -3080,7 +3080,7 @@ inline void free_dir_entry(struct dir_ent *dir_ent) | ||
| 144 | } | ||
| 145 | |||
| 146 | |||
| 147 | -inline void add_excluded(struct dir_info *dir) | ||
| 148 | +static inline void add_excluded(struct dir_info *dir) | ||
| 149 | { | ||
| 150 | dir->excluded ++; | ||
| 151 | } | ||
| 152 | -- | ||
| 153 | 1.9.1 | ||
| 154 | |||
diff --git a/meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-squashfs-tools-patch-for-CVE-2015-4645-6.patch b/meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-squashfs-tools-patch-for-CVE-2015-4645-6.patch deleted file mode 100644 index 2261ea94b7..0000000000 --- a/meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-squashfs-tools-patch-for-CVE-2015-4645-6.patch +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 1 | From 3c0d67184d6edb63f3b7d6d5eb81531daa6388f3 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Changqing Li <changqing.li@windriver.com> | ||
| 3 | Date: Tue, 28 Aug 2018 16:25:36 +0800 | ||
| 4 | Subject: [PATCH] squashfs-tools: patch for CVE-2015-4645(6) | ||
| 5 | |||
| 6 | Upstream-Status: Backport[https://github.com/devttys0/sasquatch/pull/ | ||
| 7 | 5/commits/6777e08cc38bc780d27c69c1d8c272867b74524f] | ||
| 8 | |||
| 9 | CVE: CVE-2015-4645 CVE-2015-4646 | ||
| 10 | |||
| 11 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
| 12 | --- | ||
| 13 | squashfs-tools/unsquash-4.c | 11 ++++++++--- | ||
| 14 | 1 file changed, 8 insertions(+), 3 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/squashfs-tools/unsquash-4.c b/squashfs-tools/unsquash-4.c | ||
| 17 | index ecdaac7..692ae25 100644 | ||
| 18 | --- a/squashfs-tools/unsquash-4.c | ||
| 19 | +++ b/squashfs-tools/unsquash-4.c | ||
| 20 | @@ -31,9 +31,9 @@ static unsigned int *id_table; | ||
| 21 | int read_fragment_table_4(long long *directory_table_end) | ||
| 22 | { | ||
| 23 | int res, i; | ||
| 24 | - int bytes = SQUASHFS_FRAGMENT_BYTES(sBlk.s.fragments); | ||
| 25 | - int indexes = SQUASHFS_FRAGMENT_INDEXES(sBlk.s.fragments); | ||
| 26 | - long long fragment_table_index[indexes]; | ||
| 27 | + size_t bytes = SQUASHFS_FRAGMENT_BYTES(sBlk.s.fragments); | ||
| 28 | + size_t indexes = SQUASHFS_FRAGMENT_INDEXES(sBlk.s.fragments); | ||
| 29 | + long long *fragment_table_index; | ||
| 30 | |||
| 31 | TRACE("read_fragment_table: %d fragments, reading %d fragment indexes " | ||
| 32 | "from 0x%llx\n", sBlk.s.fragments, indexes, | ||
| 33 | @@ -43,6 +43,11 @@ int read_fragment_table_4(long long *directory_table_end) | ||
| 34 | *directory_table_end = sBlk.s.fragment_table_start; | ||
| 35 | return TRUE; | ||
| 36 | } | ||
| 37 | + | ||
| 38 | + fragment_table_index = malloc(indexes*sizeof(long long)); | ||
| 39 | + if(fragment_table_index == NULL) | ||
| 40 | + EXIT_UNSQUASH("read_fragment_table: failed to allocate " | ||
| 41 | + "fragment table index\n"); | ||
| 42 | |||
| 43 | fragment_table = malloc(bytes); | ||
| 44 | if(fragment_table == NULL) | ||
| 45 | -- | ||
| 46 | 2.7.4 | ||
| 47 | |||
diff --git a/meta/recipes-devtools/squashfs-tools/squashfs-tools/fix-compat.patch b/meta/recipes-devtools/squashfs-tools/squashfs-tools/fix-compat.patch deleted file mode 100644 index 87c1e8cac0..0000000000 --- a/meta/recipes-devtools/squashfs-tools/squashfs-tools/fix-compat.patch +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | include missing sys/stat.h for stat* function declarations | ||
| 2 | |||
| 3 | Upstream-Status: Pending | ||
| 4 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 5 | |||
| 6 | Index: squashfs-tools/pseudo.c | ||
| 7 | =================================================================== | ||
| 8 | --- squashfs-tools.orig/pseudo.c | ||
| 9 | +++ squashfs-tools/pseudo.c | ||
| 10 | @@ -32,6 +32,7 @@ | ||
| 11 | #include <stdlib.h> | ||
| 12 | #include <sys/types.h> | ||
| 13 | #include <sys/wait.h> | ||
| 14 | +#include <sys/stat.h> | ||
| 15 | #include <ctype.h> | ||
| 16 | |||
| 17 | #include "pseudo.h" | ||
diff --git a/meta/recipes-devtools/squashfs-tools/squashfs-tools/squashfs-tools-4.3-sysmacros.patch b/meta/recipes-devtools/squashfs-tools/squashfs-tools/squashfs-tools-4.3-sysmacros.patch index 39521a7d8b..f2e88f416a 100644 --- a/meta/recipes-devtools/squashfs-tools/squashfs-tools/squashfs-tools-4.3-sysmacros.patch +++ b/meta/recipes-devtools/squashfs-tools/squashfs-tools/squashfs-tools-4.3-sysmacros.patch | |||
| @@ -19,7 +19,7 @@ sys/types.h might not always include sys/sysmacros.h for major/minor/makedev | |||
| 19 | #include "squashfs_fs.h" | 19 | #include "squashfs_fs.h" |
| 20 | --- a/squashfs-tools/unsquashfs.c | 20 | --- a/squashfs-tools/unsquashfs.c |
| 21 | +++ b/squashfs-tools/unsquashfs.c | 21 | +++ b/squashfs-tools/unsquashfs.c |
| 22 | @@ -38,6 +38,10 @@ | 22 | @@ -40,6 +40,10 @@ |
| 23 | #include <limits.h> | 23 | #include <limits.h> |
| 24 | #include <ctype.h> | 24 | #include <ctype.h> |
| 25 | 25 | ||
diff --git a/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb b/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb index dc1568a77c..ab2ff01b62 100644 --- a/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +++ b/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb | |||
| @@ -6,12 +6,9 @@ LICENSE = "GPL-2" | |||
| 6 | LIC_FILES_CHKSUM = "file://../COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | 6 | LIC_FILES_CHKSUM = "file://../COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" |
| 7 | 7 | ||
| 8 | PV = "4.3+gitr${SRCPV}" | 8 | PV = "4.3+gitr${SRCPV}" |
| 9 | SRCREV = "9c1db6d13a51a2e009f0027ef336ce03624eac0d" | 9 | SRCREV = "f95864afe8833fe3ad782d714b41378e860977b1" |
| 10 | SRC_URI = "git://github.com/plougher/squashfs-tools.git;protocol=https \ | 10 | SRC_URI = "git://github.com/plougher/squashfs-tools.git;protocol=https \ |
| 11 | file://0001-mksquashfs.c-get-inline-functions-work-with-C99.patch;striplevel=2 \ | ||
| 12 | file://squashfs-tools-4.3-sysmacros.patch;striplevel=2 \ | 11 | file://squashfs-tools-4.3-sysmacros.patch;striplevel=2 \ |
| 13 | file://fix-compat.patch \ | ||
| 14 | file://0001-squashfs-tools-patch-for-CVE-2015-4645-6.patch;striplevel=2 \ | ||
| 15 | " | 12 | " |
| 16 | UPSTREAM_CHECK_COMMITS = "1" | 13 | UPSTREAM_CHECK_COMMITS = "1" |
| 17 | SRC_URI[lzma.md5sum] = "29d5ffd03a5a3e51aef6a74e9eafb759" | 14 | SRC_URI[lzma.md5sum] = "29d5ffd03a5a3e51aef6a74e9eafb759" |
| @@ -24,13 +21,15 @@ COMPATIBLE_HOST_libc-musl = 'null' | |||
| 24 | 21 | ||
| 25 | EXTRA_OEMAKE = "${PACKAGECONFIG_CONFARGS}" | 22 | EXTRA_OEMAKE = "${PACKAGECONFIG_CONFARGS}" |
| 26 | 23 | ||
| 27 | PACKAGECONFIG ??= "gzip xz lzo lz4 lzma xattr" | 24 | PACKAGECONFIG ??= "gzip xz lzo lz4 lzma xattr reproducible" |
| 28 | PACKAGECONFIG[gzip] = "GZIP_SUPPORT=1,GZIP_SUPPORT=0,zlib" | 25 | PACKAGECONFIG[gzip] = "GZIP_SUPPORT=1,GZIP_SUPPORT=0,zlib" |
| 29 | PACKAGECONFIG[xz] = "XZ_SUPPORT=1,XZ_SUPPORT=0,xz" | 26 | PACKAGECONFIG[xz] = "XZ_SUPPORT=1,XZ_SUPPORT=0,xz" |
| 30 | PACKAGECONFIG[lzo] = "LZO_SUPPORT=1,LZO_SUPPORT=0,lzo" | 27 | PACKAGECONFIG[lzo] = "LZO_SUPPORT=1,LZO_SUPPORT=0,lzo" |
| 31 | PACKAGECONFIG[lz4] = "LZ4_SUPPORT=1,LZ4_SUPPORT=0,lz4" | 28 | PACKAGECONFIG[lz4] = "LZ4_SUPPORT=1,LZ4_SUPPORT=0,lz4" |
| 32 | PACKAGECONFIG[lzma] = "LZMA_XZ_SUPPORT=1,LZMA_XZ_SUPPORT=0,xz" | 29 | PACKAGECONFIG[lzma] = "LZMA_XZ_SUPPORT=1,LZMA_XZ_SUPPORT=0,xz" |
| 33 | PACKAGECONFIG[xattr] = "XATTR_SUPPORT=1,XATTR_SUPPORT=0,attr" | 30 | PACKAGECONFIG[xattr] = "XATTR_SUPPORT=1,XATTR_SUPPORT=0,attr" |
| 31 | PACKAGECONFIG[zstd] = "ZSTD_SUPPORT=1,ZSTD_SUPPORT=0,zstd" | ||
| 32 | PACKAGECONFIG[reproducible] = "REPRODUCIBLE_DEFAULT=1,REPRODUCIBLE_DEFAULT=0," | ||
| 34 | 33 | ||
| 35 | do_compile() { | 34 | do_compile() { |
| 36 | oe_runmake mksquashfs unsquashfs | 35 | oe_runmake mksquashfs unsquashfs |
