Compare commits
3 Commits
imports/c8
...
c8
Author | SHA1 | Date | |
---|---|---|---|
9a9112c9b2 | |||
|
9a37f1d52e | ||
|
07a6f92e1b |
@ -1 +0,0 @@
|
|||||||
a615979db9cee82e4a934a1455577f597d290b41 SOURCES/squashfs4.3.tar.gz
|
|
477
SOURCES/CVE-2021-41072-c8s-combined.patch
Normal file
477
SOURCES/CVE-2021-41072-c8s-combined.patch
Normal file
@ -0,0 +1,477 @@
|
|||||||
|
diff -Nupr a/squashfs-tools/Makefile b/squashfs-tools/Makefile
|
||||||
|
--- a/squashfs-tools/Makefile 2023-06-26 23:57:01.519732066 -0500
|
||||||
|
+++ b/squashfs-tools/Makefile 2023-06-26 23:57:52.192705923 -0500
|
||||||
|
@@ -117,7 +117,8 @@ MKSQUASHFS_OBJS = mksquashfs.o read_fs.o
|
||||||
|
caches-queues-lists.o
|
||||||
|
|
||||||
|
UNSQUASHFS_OBJS = unsquashfs.o unsquash-1.o unsquash-2.o unsquash-3.o \
|
||||||
|
- unsquash-4.o unsquash-1234.o swap.o compressor.o unsquashfs_info.o
|
||||||
|
+ unsquash-4.o unsquash-1234.o unsquash-12.o swap.o compressor.o \
|
||||||
|
+ unsquashfs_info.o
|
||||||
|
|
||||||
|
CFLAGS ?= -O2
|
||||||
|
CFLAGS += $(EXTRA_CFLAGS) $(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 \
|
||||||
|
@@ -294,6 +295,8 @@ unsquash-4.o: unsquashfs.h unsquash-4.c
|
||||||
|
|
||||||
|
unsquash-1234.o: unsquash-1234.c
|
||||||
|
|
||||||
|
+unsquash-12.o: unsquash-12.c unsquashfs.h
|
||||||
|
+
|
||||||
|
unsquashfs_xattr.o: unsquashfs_xattr.c unsquashfs.h squashfs_fs.h xattr.h
|
||||||
|
|
||||||
|
unsquashfs_info.o: unsquashfs.h squashfs_fs.h
|
||||||
|
diff -Nupr a/squashfs-tools/unsquash-1234.c b/squashfs-tools/unsquash-1234.c
|
||||||
|
--- a/squashfs-tools/unsquash-1234.c 2023-06-26 23:57:01.519732066 -0500
|
||||||
|
+++ b/squashfs-tools/unsquash-1234.c 2023-06-26 23:57:52.192705923 -0500
|
||||||
|
@@ -25,6 +25,8 @@
|
||||||
|
* unsquash-4.
|
||||||
|
*/
|
||||||
|
|
||||||
|
+#include "unsquashfs.h"
|
||||||
|
+
|
||||||
|
#define TRUE 1
|
||||||
|
#define FALSE 0
|
||||||
|
/*
|
||||||
|
@@ -56,3 +58,23 @@ int check_name(char *name, int size)
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * Check directory for duplicate names. As the directory should be sorted,
|
||||||
|
+ * duplicates will be consecutive. Obviously we also need to check if the
|
||||||
|
+ * directory has been deliberately unsorted, to evade this check.
|
||||||
|
+ */
|
||||||
|
+int check_directory(struct dir *dir)
|
||||||
|
+{
|
||||||
|
+ int i;
|
||||||
|
+ struct dir_ent *ent;
|
||||||
|
+
|
||||||
|
+ if (dir->dir_count < 2)
|
||||||
|
+ return TRUE;
|
||||||
|
+
|
||||||
|
+ for (ent = dir->dirs, i = 0; i < dir->dir_count - 1; ent = ent->next, i++)
|
||||||
|
+ if (strcmp(ent->name, ent->next->name) >= 0)
|
||||||
|
+ return FALSE;
|
||||||
|
+
|
||||||
|
+ return TRUE;
|
||||||
|
+}
|
||||||
|
diff -Nupr a/squashfs-tools/unsquash-12.c b/squashfs-tools/unsquash-12.c
|
||||||
|
--- a/squashfs-tools/unsquash-12.c 1969-12-31 18:00:00.000000000 -0600
|
||||||
|
+++ b/squashfs-tools/unsquash-12.c 2023-06-26 23:57:52.192705923 -0500
|
||||||
|
@@ -0,0 +1,103 @@
|
||||||
|
+/*
|
||||||
|
+ * Unsquash a squashfs filesystem. This is a highly compressed read only
|
||||||
|
+ * filesystem.
|
||||||
|
+ *
|
||||||
|
+ * Copyright (c) 2021
|
||||||
|
+ * 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.
|
||||||
|
+ *
|
||||||
|
+ * unsquash-12.c
|
||||||
|
+ *
|
||||||
|
+ * Helper functions used by unsquash-1 and unsquash-2.
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+#include "unsquashfs.h"
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * Bottom up linked list merge sort.
|
||||||
|
+ *
|
||||||
|
+ */
|
||||||
|
+void sort_directory(struct dir *dir)
|
||||||
|
+{
|
||||||
|
+ struct dir_ent *cur, *l1, *l2, *next;
|
||||||
|
+ int len1, len2, stride = 1;
|
||||||
|
+
|
||||||
|
+ if (dir->dir_count < 2)
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * We can consider our linked-list to be made up of stride length
|
||||||
|
+ * sublists. Each iteration around this loop merges adjacent
|
||||||
|
+ * stride length sublists into larger 2*stride sublists. We stop
|
||||||
|
+ * when stride becomes equal to the entire list.
|
||||||
|
+ *
|
||||||
|
+ * Initially stride = 1 (by definition a sublist of 1 is sorted), and
|
||||||
|
+ * these 1 element sublists are merged into 2 element sublists, which
|
||||||
|
+ * are then merged into 4 element sublists and so on.
|
||||||
|
+ */
|
||||||
|
+ do {
|
||||||
|
+ l2 = dir->dirs; /* head of current linked list */
|
||||||
|
+ cur = NULL; /* empty output list */
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * Iterate through the linked list, merging adjacent sublists.
|
||||||
|
+ * On each interation l2 points to the next sublist pair to be
|
||||||
|
+ * merged (if there's only one sublist left this is simply added
|
||||||
|
+ * to the output list)
|
||||||
|
+ */
|
||||||
|
+ while (l2) {
|
||||||
|
+ l1 = l2;
|
||||||
|
+ for (len1 = 0; l2 && len1 < stride; len1 ++, l2 = l2->next);
|
||||||
|
+ len2 = stride;
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * l1 points to first sublist.
|
||||||
|
+ * l2 points to second sublist.
|
||||||
|
+ * Merge them onto the output list
|
||||||
|
+ */
|
||||||
|
+ while (len1 && l2 && len2) {
|
||||||
|
+ if(strcmp(l1->name, l2->name) <= 0) {
|
||||||
|
+ next = l1;
|
||||||
|
+ l1 = l1->next;
|
||||||
|
+ len1 --;
|
||||||
|
+ } else {
|
||||||
|
+ next = l2;
|
||||||
|
+ l2 = l2->next;
|
||||||
|
+ len2 --;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (cur) {
|
||||||
|
+ cur->next = next;
|
||||||
|
+ cur = next;
|
||||||
|
+ } else
|
||||||
|
+ dir->dirs = cur = next;
|
||||||
|
+ }
|
||||||
|
+ /*
|
||||||
|
+ * One sublist is now empty, copy the other one onto the
|
||||||
|
+ * output list
|
||||||
|
+ */
|
||||||
|
+ for (; len1; len1 --, l1 = l1->next) {
|
||||||
|
+ if(cur) {
|
||||||
|
+ cur->next = l1;
|
||||||
|
+ cur = l1;
|
||||||
|
+ } else
|
||||||
|
+ dir->dirs = cur = l1;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ cur->next = NULL;
|
||||||
|
+ stride = stride << 1;
|
||||||
|
+ } while(stride < dir->dir_count);
|
||||||
|
+}
|
||||||
|
diff -Nupr a/squashfs-tools/unsquash-1.c b/squashfs-tools/unsquash-1.c
|
||||||
|
--- a/squashfs-tools/unsquash-1.c 2023-06-26 23:57:01.519732066 -0500
|
||||||
|
+++ b/squashfs-tools/unsquash-1.c 2023-06-26 23:57:52.192705923 -0500
|
||||||
|
@@ -211,7 +211,7 @@ struct dir *squashfs_opendir_1(unsigned
|
||||||
|
long long start;
|
||||||
|
int bytes;
|
||||||
|
int dir_count, size;
|
||||||
|
- struct dir_ent *new_dir;
|
||||||
|
+ struct dir_ent *ent, *cur_ent = NULL;
|
||||||
|
struct dir *dir;
|
||||||
|
|
||||||
|
TRACE("squashfs_opendir: inode start block %d, offset %d\n",
|
||||||
|
@@ -224,7 +224,7 @@ struct dir *squashfs_opendir_1(unsigned
|
||||||
|
EXIT_UNSQUASH("squashfs_opendir: malloc failed!\n");
|
||||||
|
|
||||||
|
dir->dir_count = 0;
|
||||||
|
- dir->cur_entry = 0;
|
||||||
|
+ dir->cur_entry = NULL;
|
||||||
|
dir->mode = (*i)->mode;
|
||||||
|
dir->uid = (*i)->uid;
|
||||||
|
dir->guid = (*i)->gid;
|
||||||
|
@@ -295,29 +295,37 @@ struct dir *squashfs_opendir_1(unsigned
|
||||||
|
TRACE("squashfs_opendir: directory entry %s, inode "
|
||||||
|
"%d:%d, type %d\n", dire->name,
|
||||||
|
dirh.start_block, dire->offset, dire->type);
|
||||||
|
- if((dir->dir_count % DIR_ENT_SIZE) == 0) {
|
||||||
|
- new_dir = realloc(dir->dirs, (dir->dir_count +
|
||||||
|
- DIR_ENT_SIZE) * sizeof(struct dir_ent));
|
||||||
|
- if(new_dir == NULL)
|
||||||
|
- EXIT_UNSQUASH("squashfs_opendir: "
|
||||||
|
- "realloc failed!\n");
|
||||||
|
- dir->dirs = new_dir;
|
||||||
|
- }
|
||||||
|
- strcpy(dir->dirs[dir->dir_count].name, dire->name);
|
||||||
|
- dir->dirs[dir->dir_count].start_block =
|
||||||
|
- dirh.start_block;
|
||||||
|
- dir->dirs[dir->dir_count].offset = dire->offset;
|
||||||
|
- dir->dirs[dir->dir_count].type = dire->type;
|
||||||
|
+
|
||||||
|
+ ent = malloc(sizeof(struct dir_ent));
|
||||||
|
+ if (ent == NULL)
|
||||||
|
+ MEM_ERROR();
|
||||||
|
+
|
||||||
|
+ ent->name = strdup(dire->name);
|
||||||
|
+ ent->start_block = dirh.start_block;
|
||||||
|
+ ent->offset = dire->offset;
|
||||||
|
+ ent->type = dire->type;
|
||||||
|
+ ent->next = NULL;
|
||||||
|
+ if (cur_ent == NULL)
|
||||||
|
+ dir->dirs = ent;
|
||||||
|
+ else
|
||||||
|
+ cur_ent->next = ent;
|
||||||
|
+ cur_ent = ent;
|
||||||
|
dir->dir_count ++;
|
||||||
|
bytes += dire->size + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /* check directory for duplicate names. Need to sort directory first */
|
||||||
|
+ sort_directory(dir);
|
||||||
|
+ if (check_directory(dir) == FALSE) {
|
||||||
|
+ ERROR("File system corrupted: directory has duplicate names\n");
|
||||||
|
+ goto corrupted;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
return dir;
|
||||||
|
|
||||||
|
corrupted:
|
||||||
|
- free(dir->dirs);
|
||||||
|
- free(dir);
|
||||||
|
+ squashfs_closedir(dir);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff -Nupr a/squashfs-tools/unsquash-3.c b/squashfs-tools/unsquash-3.c
|
||||||
|
--- a/squashfs-tools/unsquash-3.c 2023-06-26 23:57:01.519732066 -0500
|
||||||
|
+++ b/squashfs-tools/unsquash-3.c 2023-06-26 23:57:52.192705923 -0500
|
||||||
|
@@ -288,7 +288,7 @@ struct dir *squashfs_opendir_3(unsigned
|
||||||
|
long long start;
|
||||||
|
int bytes;
|
||||||
|
int dir_count, size;
|
||||||
|
- struct dir_ent *new_dir;
|
||||||
|
+ struct dir_ent *ent, *cur_ent = NULL;
|
||||||
|
struct dir *dir;
|
||||||
|
|
||||||
|
TRACE("squashfs_opendir: inode start block %d, offset %d\n",
|
||||||
|
@@ -301,7 +301,7 @@ struct dir *squashfs_opendir_3(unsigned
|
||||||
|
EXIT_UNSQUASH("squashfs_opendir: malloc failed!\n");
|
||||||
|
|
||||||
|
dir->dir_count = 0;
|
||||||
|
- dir->cur_entry = 0;
|
||||||
|
+ dir->cur_entry = NULL;
|
||||||
|
dir->mode = (*i)->mode;
|
||||||
|
dir->uid = (*i)->uid;
|
||||||
|
dir->guid = (*i)->gid;
|
||||||
|
@@ -373,28 +373,35 @@ struct dir *squashfs_opendir_3(unsigned
|
||||||
|
TRACE("squashfs_opendir: directory entry %s, inode "
|
||||||
|
"%d:%d, type %d\n", dire->name,
|
||||||
|
dirh.start_block, dire->offset, dire->type);
|
||||||
|
- if((dir->dir_count % DIR_ENT_SIZE) == 0) {
|
||||||
|
- new_dir = realloc(dir->dirs, (dir->dir_count +
|
||||||
|
- DIR_ENT_SIZE) * sizeof(struct dir_ent));
|
||||||
|
- if(new_dir == NULL)
|
||||||
|
- EXIT_UNSQUASH("squashfs_opendir: "
|
||||||
|
- "realloc failed!\n");
|
||||||
|
- dir->dirs = new_dir;
|
||||||
|
- }
|
||||||
|
- strcpy(dir->dirs[dir->dir_count].name, dire->name);
|
||||||
|
- dir->dirs[dir->dir_count].start_block =
|
||||||
|
- dirh.start_block;
|
||||||
|
- dir->dirs[dir->dir_count].offset = dire->offset;
|
||||||
|
- dir->dirs[dir->dir_count].type = dire->type;
|
||||||
|
+
|
||||||
|
+ ent = malloc(sizeof(struct dir_ent));
|
||||||
|
+ if (ent == NULL)
|
||||||
|
+ MEM_ERROR();
|
||||||
|
+
|
||||||
|
+ ent->name = strdup(dire->name);
|
||||||
|
+ ent->start_block = dirh.start_block;
|
||||||
|
+ ent->offset = dire->offset;
|
||||||
|
+ ent->type = dire->type;
|
||||||
|
+ ent->next = NULL;
|
||||||
|
+ if (cur_ent == NULL)
|
||||||
|
+ dir->dirs = ent;
|
||||||
|
+ else
|
||||||
|
+ cur_ent->next = ent;
|
||||||
|
+ cur_ent = ent;
|
||||||
|
dir->dir_count ++;
|
||||||
|
bytes += dire->size + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /* check directory for duplicate names and sorting */
|
||||||
|
+ if (check_directory(dir) == FALSE) {
|
||||||
|
+ ERROR("File system corrupted: directory has duplicate names or is unsorted\n");
|
||||||
|
+ goto corrupted;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
return dir;
|
||||||
|
|
||||||
|
corrupted:
|
||||||
|
- free(dir->dirs);
|
||||||
|
- free(dir);
|
||||||
|
+ squashfs_closedir(dir);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
diff -Nupr a/squashfs-tools/unsquash-4.c b/squashfs-tools/unsquash-4.c
|
||||||
|
--- a/squashfs-tools/unsquash-4.c 2023-06-26 23:57:01.519732066 -0500
|
||||||
|
+++ b/squashfs-tools/unsquash-4.c 2023-06-26 23:57:52.193705923 -0500
|
||||||
|
@@ -268,7 +268,7 @@ struct dir *squashfs_opendir_4(unsigned
|
||||||
|
long long start;
|
||||||
|
int bytes;
|
||||||
|
int dir_count, size;
|
||||||
|
- struct dir_ent *new_dir;
|
||||||
|
+ struct dir_ent *ent, *cur_ent = NULL;
|
||||||
|
struct dir *dir;
|
||||||
|
|
||||||
|
TRACE("squashfs_opendir: inode start block %d, offset %d\n",
|
||||||
|
@@ -281,7 +281,7 @@ struct dir *squashfs_opendir_4(unsigned
|
||||||
|
EXIT_UNSQUASH("squashfs_opendir: malloc failed!\n");
|
||||||
|
|
||||||
|
dir->dir_count = 0;
|
||||||
|
- dir->cur_entry = 0;
|
||||||
|
+ dir->cur_entry = NULL;
|
||||||
|
dir->mode = (*i)->mode;
|
||||||
|
dir->uid = (*i)->uid;
|
||||||
|
dir->guid = (*i)->gid;
|
||||||
|
@@ -342,29 +342,36 @@ struct dir *squashfs_opendir_4(unsigned
|
||||||
|
TRACE("squashfs_opendir: directory entry %s, inode "
|
||||||
|
"%d:%d, type %d\n", dire->name,
|
||||||
|
dirh.start_block, dire->offset, dire->type);
|
||||||
|
- if((dir->dir_count % DIR_ENT_SIZE) == 0) {
|
||||||
|
- new_dir = realloc(dir->dirs, (dir->dir_count +
|
||||||
|
- DIR_ENT_SIZE) * sizeof(struct dir_ent));
|
||||||
|
- if(new_dir == NULL)
|
||||||
|
- EXIT_UNSQUASH("squashfs_opendir: "
|
||||||
|
- "realloc failed!\n");
|
||||||
|
- dir->dirs = new_dir;
|
||||||
|
- }
|
||||||
|
- strcpy(dir->dirs[dir->dir_count].name, dire->name);
|
||||||
|
- dir->dirs[dir->dir_count].start_block =
|
||||||
|
- dirh.start_block;
|
||||||
|
- dir->dirs[dir->dir_count].offset = dire->offset;
|
||||||
|
- dir->dirs[dir->dir_count].type = dire->type;
|
||||||
|
+
|
||||||
|
+ ent = malloc(sizeof(struct dir_ent));
|
||||||
|
+ if (ent == NULL)
|
||||||
|
+ MEM_ERROR();
|
||||||
|
+
|
||||||
|
+ ent->name = strdup(dire->name);
|
||||||
|
+ ent->start_block = dirh.start_block;
|
||||||
|
+ ent->offset = dire->offset;
|
||||||
|
+ ent->type = dire->type;
|
||||||
|
+ ent->next = NULL;
|
||||||
|
+ if (cur_ent == NULL)
|
||||||
|
+ dir->dirs = ent;
|
||||||
|
+ else
|
||||||
|
+ cur_ent->next = ent;
|
||||||
|
+ cur_ent = ent;
|
||||||
|
dir->dir_count ++;
|
||||||
|
bytes += dire->size + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /* check directory for duplicate names and sorting */
|
||||||
|
+ if (check_directory(dir) == FALSE) {
|
||||||
|
+ ERROR("File system corrupted: directory has duplicate names or is unsorted\n");
|
||||||
|
+ goto corrupted;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
return dir;
|
||||||
|
|
||||||
|
corrupted:
|
||||||
|
- free(dir->dirs);
|
||||||
|
- free(dir);
|
||||||
|
+ squashfs_closedir(dir);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff -Nupr a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c
|
||||||
|
--- a/squashfs-tools/unsquashfs.c 2023-06-26 23:57:01.520732065 -0500
|
||||||
|
+++ b/squashfs-tools/unsquashfs.c 2023-06-26 23:57:52.193705923 -0500
|
||||||
|
@@ -1231,14 +1231,18 @@ failed:
|
||||||
|
int squashfs_readdir(struct dir *dir, char **name, unsigned int *start_block,
|
||||||
|
unsigned int *offset, unsigned int *type)
|
||||||
|
{
|
||||||
|
- if(dir->cur_entry == dir->dir_count)
|
||||||
|
+ if (dir->cur_entry == NULL)
|
||||||
|
+ dir->cur_entry = dir->dirs;
|
||||||
|
+ else
|
||||||
|
+ dir->cur_entry = dir->cur_entry->next;
|
||||||
|
+
|
||||||
|
+ if (dir->cur_entry == NULL)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
- *name = dir->dirs[dir->cur_entry].name;
|
||||||
|
- *start_block = dir->dirs[dir->cur_entry].start_block;
|
||||||
|
- *offset = dir->dirs[dir->cur_entry].offset;
|
||||||
|
- *type = dir->dirs[dir->cur_entry].type;
|
||||||
|
- dir->cur_entry ++;
|
||||||
|
+ *name = dir->cur_entry->name;
|
||||||
|
+ *start_block = dir->cur_entry->start_block;
|
||||||
|
+ *offset = dir->cur_entry->offset;
|
||||||
|
+ *type = dir->cur_entry->type;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
@@ -1246,7 +1250,16 @@ unsigned int *offset, unsigned int *type
|
||||||
|
|
||||||
|
void squashfs_closedir(struct dir *dir)
|
||||||
|
{
|
||||||
|
- free(dir->dirs);
|
||||||
|
+ struct dir_ent *ent = dir->dirs;
|
||||||
|
+
|
||||||
|
+ while (ent) {
|
||||||
|
+ struct dir_ent *tmp = ent;
|
||||||
|
+
|
||||||
|
+ ent = ent->next;
|
||||||
|
+ free(tmp->name);
|
||||||
|
+ free(tmp);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
free(dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1895,6 +1908,7 @@ int read_super(char *source)
|
||||||
|
* 1.x, 2.x and 3.x filesystems use gzip compression.
|
||||||
|
*/
|
||||||
|
comp = lookup_compressor("gzip");
|
||||||
|
+
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
failed_mount:
|
||||||
|
diff -Nupr a/squashfs-tools/unsquashfs.h b/squashfs-tools/unsquashfs.h
|
||||||
|
--- a/squashfs-tools/unsquashfs.h 2023-06-26 23:57:01.520732065 -0500
|
||||||
|
+++ b/squashfs-tools/unsquashfs.h 2023-06-26 23:57:52.193705923 -0500
|
||||||
|
@@ -168,21 +168,22 @@ struct queue {
|
||||||
|
#define DIR_ENT_SIZE 16
|
||||||
|
|
||||||
|
struct dir_ent {
|
||||||
|
- char name[SQUASHFS_NAME_LEN + 1];
|
||||||
|
+ char *name;
|
||||||
|
unsigned int start_block;
|
||||||
|
unsigned int offset;
|
||||||
|
unsigned int type;
|
||||||
|
+ struct dir_ent *next;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct dir {
|
||||||
|
int dir_count;
|
||||||
|
- int cur_entry;
|
||||||
|
unsigned int mode;
|
||||||
|
uid_t uid;
|
||||||
|
gid_t guid;
|
||||||
|
unsigned int mtime;
|
||||||
|
unsigned int xattr;
|
||||||
|
struct dir_ent *dirs;
|
||||||
|
+ struct dir_ent *cur_entry;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct file_entry {
|
||||||
|
@@ -278,4 +279,10 @@ extern int read_uids_guids_4();
|
||||||
|
|
||||||
|
/* unsquash-1234.c */
|
||||||
|
extern int check_name(char *, int);
|
||||||
|
+
|
||||||
|
+extern void squashfs_closedir(struct dir *);
|
||||||
|
+extern int check_directory(struct dir *);
|
||||||
|
+
|
||||||
|
+/* unsquash-12.c */
|
||||||
|
+extern void sort_directory(struct dir *);
|
||||||
|
#endif
|
95
SOURCES/bz1602698.patch
Normal file
95
SOURCES/bz1602698.patch
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
diff -Nupr a/squashfs-tools/action.c b/squashfs-tools/action.c
|
||||||
|
--- a/squashfs-tools/action.c 2014-05-09 23:54:13.000000000 -0500
|
||||||
|
+++ b/squashfs-tools/action.c 2019-04-18 10:59:53.140496887 -0500
|
||||||
|
@@ -1094,8 +1094,14 @@ static int parse_sym_mode_args(struct ac
|
||||||
|
for (i = 0; i < args; i++) {
|
||||||
|
struct mode_data *entry = parse_sym_mode_arg(argv[i]);
|
||||||
|
|
||||||
|
- if (entry == NULL)
|
||||||
|
+ if (entry == NULL) {
|
||||||
|
+ while (head) {
|
||||||
|
+ cur = head;
|
||||||
|
+ head = head->next;
|
||||||
|
+ free(cur);
|
||||||
|
+ }
|
||||||
|
return 0;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
if (cur) {
|
||||||
|
cur->next = entry;
|
||||||
|
diff -Nupr a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
|
||||||
|
--- a/squashfs-tools/mksquashfs.c 2019-04-18 10:51:05.975460126 -0500
|
||||||
|
+++ b/squashfs-tools/mksquashfs.c 2019-04-18 11:04:16.860682497 -0500
|
||||||
|
@@ -3537,11 +3537,11 @@ void dir_scan2(struct dir_info *dir, str
|
||||||
|
char *subpath = strdup(subpathname(dir_ent));
|
||||||
|
struct dir_info *sub_dir = scan1_opendir("", subpath,
|
||||||
|
dir->depth + 1);
|
||||||
|
+ free(subpath);
|
||||||
|
if(sub_dir == NULL) {
|
||||||
|
ERROR_START("Could not create pseudo directory "
|
||||||
|
"\"%s\"", pseudo_ent->pathname);
|
||||||
|
ERROR_EXIT(", skipping...\n");
|
||||||
|
- free(subpath);
|
||||||
|
pseudo_ino --;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
diff -Nupr a/squashfs-tools/read_fs.c b/squashfs-tools/read_fs.c
|
||||||
|
--- a/squashfs-tools/read_fs.c 2014-05-09 23:54:13.000000000 -0500
|
||||||
|
+++ b/squashfs-tools/read_fs.c 2019-04-18 11:06:32.499233451 -0500
|
||||||
|
@@ -974,7 +974,8 @@ long long read_filesystem(char *root_nam
|
||||||
|
|
||||||
|
error:
|
||||||
|
free(id_table);
|
||||||
|
- free(inode_table);
|
||||||
|
+ if (inode_table)
|
||||||
|
+ free(inode_table);
|
||||||
|
free(directory_table);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
diff -Nupr a/squashfs-tools/unsquash-4.c b/squashfs-tools/unsquash-4.c
|
||||||
|
--- a/squashfs-tools/unsquash-4.c 2019-04-18 10:51:05.972460124 -0500
|
||||||
|
+++ b/squashfs-tools/unsquash-4.c 2019-04-18 11:32:54.600160166 -0500
|
||||||
|
@@ -50,9 +50,11 @@ int read_fragment_table_4(long long *dir
|
||||||
|
"fragment table index\n");
|
||||||
|
|
||||||
|
fragment_table = malloc(bytes);
|
||||||
|
- if(fragment_table == NULL)
|
||||||
|
+ if(fragment_table == NULL) {
|
||||||
|
+ free(fragment_table_index);
|
||||||
|
EXIT_UNSQUASH("read_fragment_table: failed to allocate "
|
||||||
|
"fragment table\n");
|
||||||
|
+ }
|
||||||
|
|
||||||
|
res = read_fs_bytes(fd, sBlk.s.fragment_table_start,
|
||||||
|
SQUASHFS_FRAGMENT_INDEX_BYTES(sBlk.s.fragments),
|
||||||
|
@@ -60,7 +62,7 @@ int read_fragment_table_4(long long *dir
|
||||||
|
if(res == FALSE) {
|
||||||
|
ERROR("read_fragment_table: failed to read fragment table "
|
||||||
|
"index\n");
|
||||||
|
- return FALSE;
|
||||||
|
+ goto out;
|
||||||
|
}
|
||||||
|
SQUASHFS_INSWAP_FRAGMENT_INDEXES(fragment_table_index, indexes);
|
||||||
|
|
||||||
|
@@ -75,7 +77,8 @@ int read_fragment_table_4(long long *dir
|
||||||
|
if(length == FALSE) {
|
||||||
|
ERROR("read_fragment_table: failed to read fragment "
|
||||||
|
"table index\n");
|
||||||
|
- return FALSE;
|
||||||
|
+ res = FALSE;
|
||||||
|
+ goto out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -83,7 +86,10 @@ int read_fragment_table_4(long long *dir
|
||||||
|
SQUASHFS_INSWAP_FRAGMENT_ENTRY(&fragment_table[i]);
|
||||||
|
|
||||||
|
*directory_table_end = fragment_table_index[0];
|
||||||
|
- return TRUE;
|
||||||
|
+ res = TRUE;
|
||||||
|
+out:
|
||||||
|
+ free(fragment_table_index);
|
||||||
|
+ return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
11
SOURCES/bz1624173.patch
Normal file
11
SOURCES/bz1624173.patch
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--- a/squashfs-tools/Makefile 2019-07-24 13:52:09.552920269 -0400
|
||||||
|
+++ b/squashfs-tools/Makefile 2019-07-24 23:52:47.839665687 -0400
|
||||||
|
@@ -107,6 +107,8 @@ XATTR_DEFAULT = 1
|
||||||
|
# End of BUILD options section #
|
||||||
|
###############################################
|
||||||
|
|
||||||
|
+EXTRA_LDFLAGS += -z now -pie
|
||||||
|
+
|
||||||
|
INCLUDEDIR = -I.
|
||||||
|
INSTALL_DIR = /usr/local/bin
|
||||||
|
|
21
SOURCES/bz1716278.patch
Normal file
21
SOURCES/bz1716278.patch
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
--- a/squashfs-tools/mksquashfs.c 2019-08-06 11:03:34.071402614 -0400
|
||||||
|
+++ b/squashfs-tools/mksquashfs.c 2019-08-06 11:09:54.063340318 -0400
|
||||||
|
@@ -267,6 +267,7 @@ pthread_mutex_t pos_mutex = PTHREAD_MUTE
|
||||||
|
pthread_mutex_t dup_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
|
||||||
|
/* user options that control parallelisation */
|
||||||
|
+#define MAX_CPUS 256
|
||||||
|
int processors = -1;
|
||||||
|
int bwriter_size;
|
||||||
|
|
||||||
|
@@ -4124,6 +4125,10 @@ void initialise_threads(int readq, int f
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /* Limit the number of processors we're going to use */
|
||||||
|
+ if(processors > MAX_CPUS)
|
||||||
|
+ processors = MAX_CPUS;
|
||||||
|
+
|
||||||
|
if(multiply_overflow(processors, 3) ||
|
||||||
|
multiply_overflow(processors * 3, sizeof(pthread_t)))
|
||||||
|
BAD_ERROR("Processors too large\n");
|
13
SOURCES/bz1754815.patch
Normal file
13
SOURCES/bz1754815.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
--- a/squashfs-tools/mksquashfs.c
|
||||||
|
+++ b/squashfs-tools/mksquashfs.c
|
||||||
|
@@ -2447,8 +2447,8 @@ void *frag_deflator(void *arg)
|
||||||
|
write_buffer->block = bytes;
|
||||||
|
bytes += compressed_size;
|
||||||
|
fragments_outstanding --;
|
||||||
|
- pthread_mutex_unlock(&fragment_mutex);
|
||||||
|
queue_put(to_writer, write_buffer);
|
||||||
|
+ pthread_mutex_unlock(&fragment_mutex);
|
||||||
|
TRACE("Writing fragment %lld, uncompressed size %d, "
|
||||||
|
"compressed size %d\n", file_buffer->block,
|
||||||
|
file_buffer->size, compressed_size);
|
||||||
|
|
20
SOURCES/bz1895017.patch
Normal file
20
SOURCES/bz1895017.patch
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
--- a/squashfs-tools/unsquashfs.c 2021-01-14 14:34:49.658184361 -0600
|
||||||
|
+++ b/squashfs-tools/unsquashfs.c 2021-01-14 14:50:19.604100949 -0600
|
||||||
|
@@ -822,8 +822,6 @@ int set_attributes(char *pathname, int m
|
||||||
|
{
|
||||||
|
struct utimbuf times = { time, time };
|
||||||
|
|
||||||
|
- write_xattr(pathname, xattr);
|
||||||
|
-
|
||||||
|
if(utime(pathname, ×) == -1) {
|
||||||
|
ERROR("set_attributes: failed to set time on %s, because %s\n",
|
||||||
|
pathname, strerror(errno));
|
||||||
|
@@ -846,6 +844,8 @@ int set_attributes(char *pathname, int m
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ write_xattr(pathname, xattr);
|
||||||
|
+
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
204
SOURCES/bz2000637.patch
Normal file
204
SOURCES/bz2000637.patch
Normal file
@ -0,0 +1,204 @@
|
|||||||
|
diff -Nupr a/squashfs-tools/Makefile b/squashfs-tools/Makefile
|
||||||
|
--- a/squashfs-tools/Makefile 2021-10-08 12:02:28.881477426 -0500
|
||||||
|
+++ b/squashfs-tools/Makefile 2021-10-08 11:47:05.503307841 -0500
|
||||||
|
@@ -117,7 +117,7 @@ MKSQUASHFS_OBJS = mksquashfs.o read_fs.o
|
||||||
|
caches-queues-lists.o
|
||||||
|
|
||||||
|
UNSQUASHFS_OBJS = unsquashfs.o unsquash-1.o unsquash-2.o unsquash-3.o \
|
||||||
|
- unsquash-4.o swap.o compressor.o unsquashfs_info.o
|
||||||
|
+ unsquash-4.o unsquash-1234.o swap.o compressor.o unsquashfs_info.o
|
||||||
|
|
||||||
|
CFLAGS ?= -O2
|
||||||
|
CFLAGS += $(EXTRA_CFLAGS) $(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 \
|
||||||
|
@@ -292,6 +292,8 @@ unsquash-3.o: unsquashfs.h unsquash-3.c
|
||||||
|
unsquash-4.o: unsquashfs.h unsquash-4.c squashfs_fs.h squashfs_swap.h \
|
||||||
|
read_fs.h
|
||||||
|
|
||||||
|
+unsquash-1234.o: unsquash-1234.c
|
||||||
|
+
|
||||||
|
unsquashfs_xattr.o: unsquashfs_xattr.c unsquashfs.h squashfs_fs.h xattr.h
|
||||||
|
|
||||||
|
unsquashfs_info.o: unsquashfs.h squashfs_fs.h
|
||||||
|
diff -Nupr a/squashfs-tools/unsquash-1234.c b/squashfs-tools/unsquash-1234.c
|
||||||
|
--- a/squashfs-tools/unsquash-1234.c 1969-12-31 18:00:00.000000000 -0600
|
||||||
|
+++ b/squashfs-tools/unsquash-1234.c 2021-10-08 11:49:06.032243697 -0500
|
||||||
|
@@ -0,0 +1,58 @@
|
||||||
|
+/*
|
||||||
|
+ * Unsquash a squashfs filesystem. This is a highly compressed read only
|
||||||
|
+ * filesystem.
|
||||||
|
+ *
|
||||||
|
+ * Copyright (c) 2021
|
||||||
|
+ * 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.
|
||||||
|
+ *
|
||||||
|
+ * unsquash-1234.c
|
||||||
|
+ *
|
||||||
|
+ * Helper functions used by unsquash-1, unsquash-2, unsquash-3 and
|
||||||
|
+ * unsquash-4.
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+#define TRUE 1
|
||||||
|
+#define FALSE 0
|
||||||
|
+/*
|
||||||
|
+ * Check name for validity, name should not
|
||||||
|
+ * - be ".", "./", or
|
||||||
|
+ * - be "..", "../" or
|
||||||
|
+ * - have a "/" anywhere in the name, or
|
||||||
|
+ * - be shorter than the expected size
|
||||||
|
+ */
|
||||||
|
+int check_name(char *name, int size)
|
||||||
|
+{
|
||||||
|
+ char *start = name;
|
||||||
|
+
|
||||||
|
+ if(name[0] == '.') {
|
||||||
|
+ if(name[1] == '.')
|
||||||
|
+ name++;
|
||||||
|
+ if(name[1] == '/' || name[1] == '\0')
|
||||||
|
+ return FALSE;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ while(name[0] != '/' && name[0] != '\0')
|
||||||
|
+ name ++;
|
||||||
|
+
|
||||||
|
+ if(name[0] == '/')
|
||||||
|
+ return FALSE;
|
||||||
|
+
|
||||||
|
+ if((name - start) != size)
|
||||||
|
+ return FALSE;
|
||||||
|
+
|
||||||
|
+ return TRUE;
|
||||||
|
+}
|
||||||
|
diff -Nupr a/squashfs-tools/unsquash-1.c b/squashfs-tools/unsquash-1.c
|
||||||
|
--- a/squashfs-tools/unsquash-1.c 2014-03-08 23:31:59.000000000 -0600
|
||||||
|
+++ b/squashfs-tools/unsquash-1.c 2021-10-08 11:51:18.827274779 -0500
|
||||||
|
@@ -2,7 +2,7 @@
|
||||||
|
* Unsquash a squashfs filesystem. This is a highly compressed read only
|
||||||
|
* filesystem.
|
||||||
|
*
|
||||||
|
- * Copyright (c) 2009, 2010, 2011, 2012
|
||||||
|
+ * Copyright (c) 2009, 2010, 2011, 2012, 2021
|
||||||
|
* Phillip Lougher <phillip@squashfs.org.uk>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@@ -285,6 +285,13 @@ struct dir *squashfs_opendir_1(unsigned
|
||||||
|
memcpy(dire->name, directory_table + bytes,
|
||||||
|
dire->size + 1);
|
||||||
|
dire->name[dire->size + 1] = '\0';
|
||||||
|
+
|
||||||
|
+ /* check name for invalid characters (i.e /, ., ..) */
|
||||||
|
+ if(check_name(dire->name, dire->size + 1) == FALSE) {
|
||||||
|
+ ERROR("File system corrupted: invalid characters in name\n");
|
||||||
|
+ goto corrupted;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
TRACE("squashfs_opendir: directory entry %s, inode "
|
||||||
|
"%d:%d, type %d\n", dire->name,
|
||||||
|
dirh.start_block, dire->offset, dire->type);
|
||||||
|
diff -Nupr a/squashfs-tools/unsquash-3.c b/squashfs-tools/unsquash-3.c
|
||||||
|
--- a/squashfs-tools/unsquash-3.c 2014-03-08 23:31:59.000000000 -0600
|
||||||
|
+++ b/squashfs-tools/unsquash-3.c 2021-10-08 11:56:30.881697731 -0500
|
||||||
|
@@ -2,7 +2,7 @@
|
||||||
|
* Unsquash a squashfs filesystem. This is a highly compressed read only
|
||||||
|
* filesystem.
|
||||||
|
*
|
||||||
|
- * Copyright (c) 2009, 2010, 2011, 2012, 2013
|
||||||
|
+ * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2021
|
||||||
|
* Phillip Lougher <phillip@squashfs.org.uk>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@@ -363,6 +363,13 @@ struct dir *squashfs_opendir_3(unsigned
|
||||||
|
memcpy(dire->name, directory_table + bytes,
|
||||||
|
dire->size + 1);
|
||||||
|
dire->name[dire->size + 1] = '\0';
|
||||||
|
+
|
||||||
|
+ /* check name for invalid characters (i.e /, ., ..) */
|
||||||
|
+ if(check_name(dire->name, dire->size + 1) == FALSE) {
|
||||||
|
+ ERROR("File system corrupted: invalid characters in name\n");
|
||||||
|
+ goto corrupted;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
TRACE("squashfs_opendir: directory entry %s, inode "
|
||||||
|
"%d:%d, type %d\n", dire->name,
|
||||||
|
dirh.start_block, dire->offset, dire->type);
|
||||||
|
diff -Nupr a/squashfs-tools/unsquash-4.c b/squashfs-tools/unsquash-4.c
|
||||||
|
--- a/squashfs-tools/unsquash-4.c 2021-10-08 12:02:28.879477411 -0500
|
||||||
|
+++ b/squashfs-tools/unsquash-4.c 2021-10-08 11:57:20.357081890 -0500
|
||||||
|
@@ -2,7 +2,7 @@
|
||||||
|
* Unsquash a squashfs filesystem. This is a highly compressed read only
|
||||||
|
* filesystem.
|
||||||
|
*
|
||||||
|
- * Copyright (c) 2009, 2010, 2011, 2012, 2013
|
||||||
|
+ * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2021
|
||||||
|
* Phillip Lougher <phillip@squashfs.org.uk>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@@ -332,6 +332,13 @@ struct dir *squashfs_opendir_4(unsigned
|
||||||
|
memcpy(dire->name, directory_table + bytes,
|
||||||
|
dire->size + 1);
|
||||||
|
dire->name[dire->size + 1] = '\0';
|
||||||
|
+
|
||||||
|
+ /* check name for invalid characters (i.e /, ., ..) */
|
||||||
|
+ if(check_name(dire->name, dire->size + 1) == FALSE) {
|
||||||
|
+ ERROR("File system corrupted: invalid characters in name\n");
|
||||||
|
+ goto corrupted;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
TRACE("squashfs_opendir: directory entry %s, inode "
|
||||||
|
"%d:%d, type %d\n", dire->name,
|
||||||
|
dirh.start_block, dire->offset, dire->type);
|
||||||
|
diff -Nupr a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c
|
||||||
|
--- a/squashfs-tools/unsquashfs.c 2021-10-08 12:02:28.888477481 -0500
|
||||||
|
+++ b/squashfs-tools/unsquashfs.c 2021-10-08 11:59:29.508084687 -0500
|
||||||
|
@@ -3,7 +3,7 @@
|
||||||
|
* filesystem.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
|
||||||
|
- * 2012, 2013, 2014
|
||||||
|
+ * 2012, 2013, 2014, 2021
|
||||||
|
* Phillip Lougher <phillip@squashfs.org.uk>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@@ -2478,8 +2478,8 @@ int parse_number(char *arg, int *res)
|
||||||
|
|
||||||
|
|
||||||
|
#define VERSION() \
|
||||||
|
- printf("unsquashfs version 4.3 (2014/05/12)\n");\
|
||||||
|
- printf("copyright (C) 2014 Phillip Lougher "\
|
||||||
|
+ printf("unsquashfs version 4.3 (2021/10/8)\n");\
|
||||||
|
+ printf("copyright (C) 2021 Phillip Lougher "\
|
||||||
|
"<phillip@squashfs.org.uk>\n\n");\
|
||||||
|
printf("This program is free software; you can redistribute it and/or"\
|
||||||
|
"\n");\
|
||||||
|
diff -Nupr a/squashfs-tools/unsquashfs.h b/squashfs-tools/unsquashfs.h
|
||||||
|
--- a/squashfs-tools/unsquashfs.h 2014-05-09 23:54:13.000000000 -0500
|
||||||
|
+++ b/squashfs-tools/unsquashfs.h 2021-10-08 12:01:00.424790607 -0500
|
||||||
|
@@ -4,7 +4,7 @@
|
||||||
|
* Unsquash a squashfs filesystem. This is a highly compressed read only
|
||||||
|
* filesystem.
|
||||||
|
*
|
||||||
|
- * Copyright (c) 2009, 2010, 2013, 2014
|
||||||
|
+ * Copyright (c) 2009, 2010, 2013, 2014, 2021
|
||||||
|
* Phillip Lougher <phillip@squashfs.org.uk>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@@ -275,4 +275,7 @@ extern struct inode *read_inode_4(unsign
|
||||||
|
extern struct dir *squashfs_opendir_4(unsigned int, unsigned int,
|
||||||
|
struct inode **);
|
||||||
|
extern int read_uids_guids_4();
|
||||||
|
+
|
||||||
|
+/* unsquash-1234.c */
|
||||||
|
+extern int check_name(char *, int);
|
||||||
|
#endif
|
@ -1,7 +1,7 @@
|
|||||||
Summary: Utility for the creation of squashfs filesystems
|
Summary: Utility for the creation of squashfs filesystems
|
||||||
Name: squashfs-tools
|
Name: squashfs-tools
|
||||||
Version: 4.3
|
Version: 4.3
|
||||||
Release: 17%{?dist}
|
Release: 21%{?dist}
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
URL: http://squashfs.sourceforge.net/
|
URL: http://squashfs.sourceforge.net/
|
||||||
@ -27,6 +27,21 @@ Patch3: cve-2015-4645.patch
|
|||||||
Patch4: local-cve-fix.patch
|
Patch4: local-cve-fix.patch
|
||||||
# rhbz 1611746
|
# rhbz 1611746
|
||||||
Patch5: mksquashfs-sysmacros-fix.patch
|
Patch5: mksquashfs-sysmacros-fix.patch
|
||||||
|
# rhbz 1602698
|
||||||
|
Patch6: bz1602698.patch
|
||||||
|
# rhbz 1624173
|
||||||
|
Patch7: bz1624173.patch
|
||||||
|
# rhbz 1716278
|
||||||
|
Patch8: bz1716278.patch
|
||||||
|
# rhbz 1754815
|
||||||
|
Patch9: bz1754815.patch
|
||||||
|
# rhbz 1895017
|
||||||
|
Patch10: bz1895017.patch
|
||||||
|
# rhbz 2000637 - CVE-2021-40153
|
||||||
|
Patch11: bz2000637.patch
|
||||||
|
# rhbz 2007303 - CVE-2021-41072
|
||||||
|
Patch12: CVE-2021-41072-c8s-combined.patch
|
||||||
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||||
BuildRequires: zlib-devel
|
BuildRequires: zlib-devel
|
||||||
BuildRequires: xz-devel
|
BuildRequires: xz-devel
|
||||||
@ -46,6 +61,13 @@ contains the utilities for manipulating squashfs filesystems.
|
|||||||
%patch3 -p1
|
%patch3 -p1
|
||||||
%patch4 -p0
|
%patch4 -p0
|
||||||
%patch5 -p1
|
%patch5 -p1
|
||||||
|
%patch6 -p1
|
||||||
|
%patch7 -p1
|
||||||
|
%patch8 -p1
|
||||||
|
%patch9 -p1
|
||||||
|
%patch10 -p1
|
||||||
|
%patch11 -p1
|
||||||
|
%patch12 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
pushd squashfs-tools
|
pushd squashfs-tools
|
||||||
@ -72,6 +94,26 @@ rm -rf %{buildroot}
|
|||||||
%{_sbindir}/unsquashfs
|
%{_sbindir}/unsquashfs
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Sep 18 2023 Abhi Das <adas@redhat.com> - 4.3-21
|
||||||
|
- CVE-2021-41072 squashfs-tools: additional write outside destination directory exploit fix
|
||||||
|
CVE-2021-40153 squashfs-tools: unvalidated filepaths allow writing outside of destination
|
||||||
|
Resolves: rhbz#2007303 rhbz#2000637
|
||||||
|
|
||||||
|
* Thu Feb 25 2021 Abhi Das <adas@redhat.com> - 4.3-20
|
||||||
|
- rhbz#1895017 - unsquashfs does not preserve file capabilities
|
||||||
|
rhbz#1754815 - Kdump: Building kdump initramfs img may fail with 'dracut: Failed making squash image' occasionally
|
||||||
|
Resolves: rhbz#1895017, rhbz#1754815
|
||||||
|
|
||||||
|
* Tue Aug 06 2019 Abhi Das <adas@redhat.com> - 4.3-19
|
||||||
|
- rhbz#1602698 - Fix coverity issues
|
||||||
|
rhbz#1624173 - Fix annocheck failures
|
||||||
|
rhbz#1716278 - limit max cpus in mksquashfs
|
||||||
|
Resolves: rhbz#1602698, rhbz#1624173, rhbz#1716278
|
||||||
|
|
||||||
|
* Tue Aug 06 2019 Abhi Das <adas@redhat.com> - 4.3-18
|
||||||
|
- Add manual gating test
|
||||||
|
Resolves: rhbz#1682413
|
||||||
|
|
||||||
* Mon Aug 20 2018 Josh Boyer <jwboyer@redhat.com> - 4.3-17
|
* Mon Aug 20 2018 Josh Boyer <jwboyer@redhat.com> - 4.3-17
|
||||||
- Fix build against glibc 2.28
|
- Fix build against glibc 2.28
|
||||||
Resolves: rhbz#1611746
|
Resolves: rhbz#1611746
|
||||||
|
Loading…
Reference in New Issue
Block a user