summaryrefslogtreecommitdiff
path: root/sys-fs/squashfs-tools/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-fs/squashfs-tools/files
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-fs/squashfs-tools/files')
-rw-r--r--sys-fs/squashfs-tools/files/squashfs-tools-4.3-2gb.patch30
-rw-r--r--sys-fs/squashfs-tools/files/squashfs-tools-4.3-aligned-data.patch15
-rw-r--r--sys-fs/squashfs-tools/files/squashfs-tools-4.3-extmatch.patch121
-rw-r--r--sys-fs/squashfs-tools/files/squashfs-tools-4.3-local-cve-fix.patch19
-rw-r--r--sys-fs/squashfs-tools/files/squashfs-tools-4.3-mem-overflow.patch35
-rw-r--r--sys-fs/squashfs-tools/files/squashfs-tools-4.3-musl.patch24
-rw-r--r--sys-fs/squashfs-tools/files/squashfs-tools-4.3-sysmacros.patch25
-rw-r--r--sys-fs/squashfs-tools/files/squashfs-tools-4.3-xattrs.patch34
8 files changed, 303 insertions, 0 deletions
diff --git a/sys-fs/squashfs-tools/files/squashfs-tools-4.3-2gb.patch b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-2gb.patch
new file mode 100644
index 000000000000..467448f62639
--- /dev/null
+++ b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-2gb.patch
@@ -0,0 +1,30 @@
+From 9c1db6d13a51a2e009f0027ef336ce03624eac0d Mon Sep 17 00:00:00 2001
+From: "Guan, Xin" <guanx.bac@gmail.com>
+Date: Sat, 13 Sep 2014 13:15:26 +0200
+Subject: [PATCH] Fix 2GB-limit of the is_fragment(...) function.
+
+Applies to squashfs-tools 4.3.
+
+Reported-by: Bruno Wolff III <bruno@wolff.to>
+Signed-off-by: Guan, Xin <guanx.bac@gmail.com>
+Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
+---
+ squashfs-tools/mksquashfs.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
+index f1fcff1cc284..d221c35865a0 100644
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -2029,7 +2029,7 @@ struct file_info *duplicate(long long file_size, long long bytes,
+
+ inline int is_fragment(struct inode_info *inode)
+ {
+- int file_size = inode->buf.st_size;
++ off_t file_size = inode->buf.st_size;
+
+ /*
+ * If this block is to be compressed differently to the
+--
+2.8.2
+
diff --git a/sys-fs/squashfs-tools/files/squashfs-tools-4.3-aligned-data.patch b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-aligned-data.patch
new file mode 100644
index 000000000000..024129ffa958
--- /dev/null
+++ b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-aligned-data.patch
@@ -0,0 +1,15 @@
+the mksquashfs code has an all_zeros func that does:
+ long *p = (long *) file_buffer->data;
+
+make sure we force the data field to be aligned so that still works.
+
+--- a/squashfs-tools/caches-queues-lists.h
++++ b/squashfs-tools/caches-queues-lists.h
+@@ -123,6 +123,7 @@ struct file_buffer {
+ char locked;
+ char wait_on_unlock;
+ char noD;
++ long _pad;
+ char data[0];
+ };
+
diff --git a/sys-fs/squashfs-tools/files/squashfs-tools-4.3-extmatch.patch b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-extmatch.patch
new file mode 100644
index 000000000000..7ffc062006c0
--- /dev/null
+++ b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-extmatch.patch
@@ -0,0 +1,121 @@
+From https://github.com/plougher/squashfs-tools/pull/9
+
+From 4280e74de14070869787a9166242f9ce2dafd82e Mon Sep 17 00:00:00 2001
+From: Alexandru Ardelean <aa@ocedo.com>
+Date: Wed, 6 Jan 2016 15:33:43 +0200
+Subject: [PATCH] squashfs-tools: with fnmatch.h compatibility with musl
+
+musl does not define FNM_EXTMATCH
+
+Signed-off-by: Alexandru Ardelean <aa@ocedo.com>
+---
+ squashfs-tools/action.c | 2 +-
+ squashfs-tools/fnmatch_compat.h | 32 ++++++++++++++++++++++++++++++++
+ squashfs-tools/mksquashfs.c | 2 +-
+ squashfs-tools/unsquashfs.c | 1 +
+ squashfs-tools/unsquashfs.h | 1 -
+ 5 files changed, 35 insertions(+), 3 deletions(-)
+ create mode 100644 squashfs-tools/fnmatch_compat.h
+
+diff --git a/squashfs-tools/action.c b/squashfs-tools/action.c
+index 35889a4..4b06ccb 100644
+--- a/squashfs-tools/action.c
++++ b/squashfs-tools/action.c
+@@ -31,7 +31,6 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+-#include <fnmatch.h>
+ #include <pwd.h>
+ #include <grp.h>
+ #include <sys/wait.h>
+@@ -43,6 +42,7 @@
+ #include "mksquashfs.h"
+ #include "action.h"
+ #include "error.h"
++#include "fnmatch_compat.h"
+
+ /*
+ * code to parse actions
+diff --git a/squashfs-tools/fnmatch_compat.h b/squashfs-tools/fnmatch_compat.h
+new file mode 100644
+index 0000000..7b4afd8
+--- /dev/null
++++ b/squashfs-tools/fnmatch_compat.h
+@@ -0,0 +1,32 @@
++#ifndef FNMATCH_COMPAT
++#define FNMATCH_COMPAT
++/*
++ * Squashfs
++ *
++ * Copyright (c) 2015
++ * Phillip Lougher <phillip@squashfs.org.uk>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2,
++ * or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++ *
++ * fnmatch_compat.h
++ */
++
++#include <fnmatch.h>
++
++#ifndef FNM_EXTMATCH
++#define FNM_EXTMATCH 0
++#endif
++
++#endif
+diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
+index d221c35..4e7cbdd 100644
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -46,7 +46,6 @@
+ #include <sys/mman.h>
+ #include <pthread.h>
+ #include <regex.h>
+-#include <fnmatch.h>
+ #include <sys/wait.h>
+ #include <limits.h>
+ #include <ctype.h>
+@@ -76,6 +75,7 @@
+ #include "read_fs.h"
+ #include "restore.h"
+ #include "process_fragments.h"
++#include "fnmatch_compat.h"
+
+ int delete = FALSE;
+ int fd;
+diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c
+index 1323dd6..2428baa 100644
+--- a/squashfs-tools/unsquashfs.c
++++ b/squashfs-tools/unsquashfs.c
+@@ -30,6 +30,7 @@
+ #include "xattr.h"
+ #include "unsquashfs_info.h"
+ #include "stdarg.h"
++#include "fnmatch_compat.h"
+
+ #include <sys/sysinfo.h>
+ #include <sys/types.h>
+diff --git a/squashfs-tools/unsquashfs.h b/squashfs-tools/unsquashfs.h
+index ecd0bb4..0edbd25 100644
+--- a/squashfs-tools/unsquashfs.h
++++ b/squashfs-tools/unsquashfs.h
+@@ -40,7 +40,6 @@
+ #include <grp.h>
+ #include <time.h>
+ #include <regex.h>
+-#include <fnmatch.h>
+ #include <signal.h>
+ #include <pthread.h>
+ #include <math.h>
diff --git a/sys-fs/squashfs-tools/files/squashfs-tools-4.3-local-cve-fix.patch b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-local-cve-fix.patch
new file mode 100644
index 000000000000..7637f67cd591
--- /dev/null
+++ b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-local-cve-fix.patch
@@ -0,0 +1,19 @@
+taken from Fedora
+
+commit af393379e34c5677f95bbec11645b6c3028195b4
+Author: Bruno Wolff III <bruno@wolff.to>
+Date: Wed Jun 24 14:27:31 2015 -0500
+
+Update printf formats to match datatypes after CVE patch
+
+--- squashfs-tools/unsquash-4.c
++++ squashfs-tools/unsquash-4.c
+@@ -35,7 +35,7 @@
+ size_t indexes = SQUASHFS_FRAGMENT_INDEXES(sBlk.s.fragments);
+ long long *fragment_table_index;
+
+- TRACE("read_fragment_table: %d fragments, reading %d fragment indexes "
++ TRACE("read_fragment_table: %u fragments, reading %zu fragment indexes "
+ "from 0x%llx\n", sBlk.s.fragments, indexes,
+ sBlk.s.fragment_table_start);
+
diff --git a/sys-fs/squashfs-tools/files/squashfs-tools-4.3-mem-overflow.patch b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-mem-overflow.patch
new file mode 100644
index 000000000000..a9b000149e4e
--- /dev/null
+++ b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-mem-overflow.patch
@@ -0,0 +1,35 @@
+taken from Fedora
+
+From 604b607d8ac91eb8afc0b6e3d917d5c073096103 Mon Sep 17 00:00:00 2001
+From: Phillip Lougher <phillip@squashfs.org.uk>
+Date: Wed, 11 Jun 2014 04:51:37 +0100
+Subject: mksquashfs: ensure value does not overflow a signed int in -mem
+ option
+
+Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
+
+diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
+index 5370ecf..9676dc8 100644
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -5193,7 +5193,16 @@ print_compressor_options:
+ argv[0]);
+ exit(1);
+ }
+- /* convert from bytes to Mbytes */
++
++ /*
++ * convert from bytes to Mbytes, ensuring the value
++ * does not overflow a signed int
++ */
++ if(number >= (1LL << 51)) {
++ ERROR("%s: -mem invalid mem size\n", argv[0]);
++ exit(1);
++ }
++
+ total_mem = number / 1048576;
+ if(total_mem < (SQUASHFS_LOWMEM / SQUASHFS_TAKE)) {
+ ERROR("%s: -mem should be %d Mbytes or "
+--
+cgit v0.10.1
+
diff --git a/sys-fs/squashfs-tools/files/squashfs-tools-4.3-musl.patch b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-musl.patch
new file mode 100644
index 000000000000..52b7f48c8eab
--- /dev/null
+++ b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-musl.patch
@@ -0,0 +1,24 @@
+From https://github.com/plougher/squashfs-tools/pull/9
+
+From b0ca8a5c98ff73e70b2ab1bc24aa824aa2458287 Mon Sep 17 00:00:00 2001
+From: Alexandru Ardelean <aa@ocedo.com>
+Date: Wed, 6 Jan 2016 15:36:48 +0200
+Subject: [PATCH] pseudo.c: add explicit <sys/stat.h> include
+
+Signed-off-by: Alexandru Ardelean <aa@ocedo.com>
+---
+ squashfs-tools/pseudo.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/squashfs-tools/pseudo.c b/squashfs-tools/pseudo.c
+index f85fe60..83bfc97 100644
+--- a/squashfs-tools/pseudo.c
++++ b/squashfs-tools/pseudo.c
+@@ -32,6 +32,7 @@
+ #include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
++#include <sys/stat.h>
+ #include <ctype.h>
+
+ #include "pseudo.h"
diff --git a/sys-fs/squashfs-tools/files/squashfs-tools-4.3-sysmacros.patch b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-sysmacros.patch
new file mode 100644
index 000000000000..1430b1a2ee0d
--- /dev/null
+++ b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-sysmacros.patch
@@ -0,0 +1,25 @@
+sys/types.h might not always include sys/sysmacros.h for major/minor/makedev
+
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -59,6 +59,7 @@
+ #else
+ #include <endian.h>
+ #include <sys/sysinfo.h>
++#include <sys/sysmacros.h>
+ #endif
+
+ #include "squashfs_fs.h"
+--- a/squashfs-tools/unsquashfs.c
++++ b/squashfs-tools/unsquashfs.c
+@@ -38,6 +38,10 @@
+ #include <limits.h>
+ #include <ctype.h>
+
++#ifdef linux
++#include <sys/sysmacros.h>
++#endif
++
+ struct cache *fragment_cache, *data_cache;
+ struct queue *to_reader, *to_inflate, *to_writer, *from_writer;
+ pthread_t *thread, *inflator_thread;
diff --git a/sys-fs/squashfs-tools/files/squashfs-tools-4.3-xattrs.patch b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-xattrs.patch
new file mode 100644
index 000000000000..47b0ea5c9859
--- /dev/null
+++ b/sys-fs/squashfs-tools/files/squashfs-tools-4.3-xattrs.patch
@@ -0,0 +1,34 @@
+From ffe9e55c4993422ce36213fa86d4fc29c22646ea Mon Sep 17 00:00:00 2001
+From: Wessel Dankers <wsl-debian-804194@fruit.je>
+Date: Fri, 17 Jun 2016 09:46:42 +0800
+Subject: [PATCH] unsquashfs: Correctly set file capabilities
+
+As posted on https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804194.
+---
+ squashfs-tools/unsquashfs.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c
+index 1323dd6..a5f0117 100644
+--- a/squashfs-tools/unsquashfs.c
++++ b/squashfs-tools/unsquashfs.c
+@@ -821,8 +821,6 @@ int set_attributes(char *pathname, int mode, uid_t uid, gid_t guid, time_t time,
+ {
+ struct utimbuf times = { time, time };
+
+- write_xattr(pathname, xattr);
+-
+ if(utime(pathname, &times) == -1) {
+ ERROR("set_attributes: failed to set time on %s, because %s\n",
+ pathname, strerror(errno));
+@@ -845,6 +843,8 @@ int set_attributes(char *pathname, int mode, uid_t uid, gid_t guid, time_t time,
+ return FALSE;
+ }
+
++ write_xattr(pathname, xattr);
++
+ return TRUE;
+ }
+
+--
+2.8.0.rc3.226.g39d4020