mirror of
https://github.com/PartialVolume/shredos.x86_64.git
synced 2026-02-20 17:42:10 +00:00
Upgrade buildroot to 2023.05 (from 2021.08.2), kernel is upgraded to 6.3 (from 5.13.19).
This commit is contained in:
@@ -1,55 +0,0 @@
|
||||
From 41ef9a0bc36b9db7115fbe9623f989bfb47bbade Mon Sep 17 00:00:00 2001
|
||||
From: Chris Liddell <chris.liddell@artifex.com>
|
||||
Date: Tue, 20 Oct 2020 09:49:45 +0100
|
||||
Subject: [PATCH] Bug 702985: drop use of FT_CALLBACK_DEF() def
|
||||
|
||||
From 2.10.3, Freetype disappeared the FT_CALLBACK_DEF() macro, which is what
|
||||
we used when defining our callbacks from Freetype.
|
||||
|
||||
No guidance forthcoming from the Freetype developer who made those changes,
|
||||
so change to explicitly declaring the callbacks file static.
|
||||
|
||||
Should fix the reported build failures.
|
||||
|
||||
Downloaded from upstream commit:
|
||||
https://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=41ef9a0bc36b
|
||||
|
||||
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
||||
---
|
||||
base/fapi_ft.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/base/fapi_ft.c b/base/fapi_ft.c
|
||||
index 65fa6dcf4..21aef2f06 100644
|
||||
--- a/base/fapi_ft.c
|
||||
+++ b/base/fapi_ft.c
|
||||
@@ -125,7 +125,7 @@ static void
|
||||
delete_inc_int_info(gs_fapi_server * a_server,
|
||||
FT_IncrementalRec * a_inc_int_info);
|
||||
|
||||
-FT_CALLBACK_DEF(void *)
|
||||
+static void *
|
||||
FF_alloc(FT_Memory memory, long size)
|
||||
{
|
||||
gs_memory_t *mem = (gs_memory_t *) memory->user;
|
||||
@@ -133,7 +133,7 @@ FF_alloc(FT_Memory memory, long size)
|
||||
return (gs_malloc(mem, size, 1, "FF_alloc"));
|
||||
}
|
||||
|
||||
-FT_CALLBACK_DEF(void *)
|
||||
+static void *
|
||||
FF_realloc(FT_Memory memory, long cur_size, long new_size, void *block)
|
||||
{
|
||||
gs_memory_t *mem = (gs_memory_t *) memory->user;
|
||||
@@ -153,7 +153,7 @@ FT_CALLBACK_DEF(void *)
|
||||
return (tmp);
|
||||
}
|
||||
|
||||
-FT_CALLBACK_DEF(void)
|
||||
+static void
|
||||
FF_free(FT_Memory memory, void *block)
|
||||
{
|
||||
gs_memory_t *mem = (gs_memory_t *) memory->user;
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -1,234 +0,0 @@
|
||||
From a9bd3dec9fde03327a4a2c69dad1036bf9632e20 Mon Sep 17 00:00:00 2001
|
||||
From: Chris Liddell <chris.liddell@artifex.com>
|
||||
Date: Tue, 7 Sep 2021 20:36:12 +0100
|
||||
Subject: [PATCH] Bug 704342: Include device specifier strings in access
|
||||
validation
|
||||
|
||||
for the "%pipe%", %handle%" and %printer% io devices.
|
||||
|
||||
We previously validated only the part after the "%pipe%" Postscript device
|
||||
specifier, but this proved insufficient.
|
||||
|
||||
This rebuilds the original file name string, and validates it complete. The
|
||||
slight complication for "%pipe%" is it can be reached implicitly using
|
||||
"|" so we have to check both prefixes.
|
||||
|
||||
Addresses CVE-2021-3781
|
||||
|
||||
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
|
||||
---
|
||||
base/gdevpipe.c | 22 +++++++++++++++-
|
||||
base/gp_mshdl.c | 11 +++++++-
|
||||
base/gp_msprn.c | 10 ++++++-
|
||||
base/gp_os2pr.c | 13 +++++++++-
|
||||
base/gslibctx.c | 69 ++++++++++---------------------------------------
|
||||
5 files changed, 65 insertions(+), 60 deletions(-)
|
||||
|
||||
diff --git a/base/gdevpipe.c b/base/gdevpipe.c
|
||||
index 96d71f5d8..5bdc485be 100644
|
||||
--- a/base/gdevpipe.c
|
||||
+++ b/base/gdevpipe.c
|
||||
@@ -72,8 +72,28 @@ pipe_fopen(gx_io_device * iodev, const char *fname, const char *access,
|
||||
#else
|
||||
gs_lib_ctx_t *ctx = mem->gs_lib_ctx;
|
||||
gs_fs_list_t *fs = ctx->core->fs;
|
||||
+ /* The pipe device can be reached in two ways, explicltly with %pipe%
|
||||
+ or implicitly with "|", so we have to check for both
|
||||
+ */
|
||||
+ char f[gp_file_name_sizeof];
|
||||
+ const char *pipestr = "|";
|
||||
+ const size_t pipestrlen = strlen(pipestr);
|
||||
+ const size_t preflen = strlen(iodev->dname);
|
||||
+ const size_t nlen = strlen(fname);
|
||||
+ int code1;
|
||||
+
|
||||
+ if (preflen + nlen >= gp_file_name_sizeof)
|
||||
+ return_error(gs_error_invalidaccess);
|
||||
+
|
||||
+ memcpy(f, iodev->dname, preflen);
|
||||
+ memcpy(f + preflen, fname, nlen + 1);
|
||||
+
|
||||
+ code1 = gp_validate_path(mem, f, access);
|
||||
+
|
||||
+ memcpy(f, pipestr, pipestrlen);
|
||||
+ memcpy(f + pipestrlen, fname, nlen + 1);
|
||||
|
||||
- if (gp_validate_path(mem, fname, access) != 0)
|
||||
+ if (code1 != 0 && gp_validate_path(mem, f, access) != 0 )
|
||||
return gs_error_invalidfileaccess;
|
||||
|
||||
/*
|
||||
diff --git a/base/gp_mshdl.c b/base/gp_mshdl.c
|
||||
index 2b964ed74..8d87ceadc 100644
|
||||
--- a/base/gp_mshdl.c
|
||||
+++ b/base/gp_mshdl.c
|
||||
@@ -95,8 +95,17 @@ mswin_handle_fopen(gx_io_device * iodev, const char *fname, const char *access,
|
||||
long hfile; /* Correct for Win32, may be wrong for Win64 */
|
||||
gs_lib_ctx_t *ctx = mem->gs_lib_ctx;
|
||||
gs_fs_list_t *fs = ctx->core->fs;
|
||||
+ char f[gp_file_name_sizeof];
|
||||
+ const size_t preflen = strlen(iodev->dname);
|
||||
+ const size_t nlen = strlen(fname);
|
||||
|
||||
- if (gp_validate_path(mem, fname, access) != 0)
|
||||
+ if (preflen + nlen >= gp_file_name_sizeof)
|
||||
+ return_error(gs_error_invalidaccess);
|
||||
+
|
||||
+ memcpy(f, iodev->dname, preflen);
|
||||
+ memcpy(f + preflen, fname, nlen + 1);
|
||||
+
|
||||
+ if (gp_validate_path(mem, f, access) != 0)
|
||||
return gs_error_invalidfileaccess;
|
||||
|
||||
/* First we try the open_handle method. */
|
||||
diff --git a/base/gp_msprn.c b/base/gp_msprn.c
|
||||
index ed4827968..746a974f7 100644
|
||||
--- a/base/gp_msprn.c
|
||||
+++ b/base/gp_msprn.c
|
||||
@@ -168,8 +168,16 @@ mswin_printer_fopen(gx_io_device * iodev, const char *fname, const char *access,
|
||||
uintptr_t *ptid = &((tid_t *)(iodev->state))->tid;
|
||||
gs_lib_ctx_t *ctx = mem->gs_lib_ctx;
|
||||
gs_fs_list_t *fs = ctx->core->fs;
|
||||
+ const size_t preflen = strlen(iodev->dname);
|
||||
+ const size_t nlen = strlen(fname);
|
||||
|
||||
- if (gp_validate_path(mem, fname, access) != 0)
|
||||
+ if (preflen + nlen >= gp_file_name_sizeof)
|
||||
+ return_error(gs_error_invalidaccess);
|
||||
+
|
||||
+ memcpy(pname, iodev->dname, preflen);
|
||||
+ memcpy(pname + preflen, fname, nlen + 1);
|
||||
+
|
||||
+ if (gp_validate_path(mem, pname, access) != 0)
|
||||
return gs_error_invalidfileaccess;
|
||||
|
||||
/* First we try the open_printer method. */
|
||||
diff --git a/base/gp_os2pr.c b/base/gp_os2pr.c
|
||||
index f852c71fc..ba54cde66 100644
|
||||
--- a/base/gp_os2pr.c
|
||||
+++ b/base/gp_os2pr.c
|
||||
@@ -107,9 +107,20 @@ os2_printer_fopen(gx_io_device * iodev, const char *fname, const char *access,
|
||||
FILE ** pfile, char *rfname, uint rnamelen)
|
||||
{
|
||||
os2_printer_t *pr = (os2_printer_t *)iodev->state;
|
||||
- char driver_name[256];
|
||||
+ char driver_name[gp_file_name_sizeof];
|
||||
gs_lib_ctx_t *ctx = mem->gs_lib_ctx;
|
||||
gs_fs_list_t *fs = ctx->core->fs;
|
||||
+ const size_t preflen = strlen(iodev->dname);
|
||||
+ const int size_t = strlen(fname);
|
||||
+
|
||||
+ if (preflen + nlen >= gp_file_name_sizeof)
|
||||
+ return_error(gs_error_invalidaccess);
|
||||
+
|
||||
+ memcpy(driver_name, iodev->dname, preflen);
|
||||
+ memcpy(driver_name + preflen, fname, nlen + 1);
|
||||
+
|
||||
+ if (gp_validate_path(mem, driver_name, access) != 0)
|
||||
+ return gs_error_invalidfileaccess;
|
||||
|
||||
/* First we try the open_printer method. */
|
||||
/* Note that the loop condition here ensures we don't
|
||||
diff --git a/base/gslibctx.c b/base/gslibctx.c
|
||||
index 6dfed6cd5..318039fad 100644
|
||||
--- a/base/gslibctx.c
|
||||
+++ b/base/gslibctx.c
|
||||
@@ -655,82 +655,39 @@ rewrite_percent_specifiers(char *s)
|
||||
int
|
||||
gs_add_outputfile_control_path(gs_memory_t *mem, const char *fname)
|
||||
{
|
||||
- char *fp, f[gp_file_name_sizeof];
|
||||
- const int pipe = 124; /* ASCII code for '|' */
|
||||
- const int len = strlen(fname);
|
||||
- int i, code;
|
||||
+ char f[gp_file_name_sizeof];
|
||||
+ int code;
|
||||
|
||||
/* Be sure the string copy will fit */
|
||||
- if (len >= gp_file_name_sizeof)
|
||||
+ if (strlen(fname) >= gp_file_name_sizeof)
|
||||
return gs_error_rangecheck;
|
||||
strcpy(f, fname);
|
||||
- fp = f;
|
||||
/* Try to rewrite any %d (or similar) in the string */
|
||||
rewrite_percent_specifiers(f);
|
||||
- for (i = 0; i < len; i++) {
|
||||
- if (f[i] == pipe) {
|
||||
- fp = &f[i + 1];
|
||||
- /* Because we potentially have to check file permissions at two levels
|
||||
- for the output file (gx_device_open_output_file and the low level
|
||||
- fopen API, if we're using a pipe, we have to add both the full string,
|
||||
- (including the '|', and just the command to which we pipe - since at
|
||||
- the pipe_fopen(), the leading '|' has been stripped.
|
||||
- */
|
||||
- code = gs_add_control_path(mem, gs_permit_file_writing, f);
|
||||
- if (code < 0)
|
||||
- return code;
|
||||
- code = gs_add_control_path(mem, gs_permit_file_control, f);
|
||||
- if (code < 0)
|
||||
- return code;
|
||||
- break;
|
||||
- }
|
||||
- if (!IS_WHITESPACE(f[i]))
|
||||
- break;
|
||||
- }
|
||||
- code = gs_add_control_path(mem, gs_permit_file_control, fp);
|
||||
+
|
||||
+ code = gs_add_control_path(mem, gs_permit_file_control, f);
|
||||
if (code < 0)
|
||||
return code;
|
||||
- return gs_add_control_path(mem, gs_permit_file_writing, fp);
|
||||
+ return gs_add_control_path(mem, gs_permit_file_writing, f);
|
||||
}
|
||||
|
||||
int
|
||||
gs_remove_outputfile_control_path(gs_memory_t *mem, const char *fname)
|
||||
{
|
||||
- char *fp, f[gp_file_name_sizeof];
|
||||
- const int pipe = 124; /* ASCII code for '|' */
|
||||
- const int len = strlen(fname);
|
||||
- int i, code;
|
||||
+ char f[gp_file_name_sizeof];
|
||||
+ int code;
|
||||
|
||||
/* Be sure the string copy will fit */
|
||||
- if (len >= gp_file_name_sizeof)
|
||||
+ if (strlen(fname) >= gp_file_name_sizeof)
|
||||
return gs_error_rangecheck;
|
||||
strcpy(f, fname);
|
||||
- fp = f;
|
||||
/* Try to rewrite any %d (or similar) in the string */
|
||||
- for (i = 0; i < len; i++) {
|
||||
- if (f[i] == pipe) {
|
||||
- fp = &f[i + 1];
|
||||
- /* Because we potentially have to check file permissions at two levels
|
||||
- for the output file (gx_device_open_output_file and the low level
|
||||
- fopen API, if we're using a pipe, we have to add both the full string,
|
||||
- (including the '|', and just the command to which we pipe - since at
|
||||
- the pipe_fopen(), the leading '|' has been stripped.
|
||||
- */
|
||||
- code = gs_remove_control_path(mem, gs_permit_file_writing, f);
|
||||
- if (code < 0)
|
||||
- return code;
|
||||
- code = gs_remove_control_path(mem, gs_permit_file_control, f);
|
||||
- if (code < 0)
|
||||
- return code;
|
||||
- break;
|
||||
- }
|
||||
- if (!IS_WHITESPACE(f[i]))
|
||||
- break;
|
||||
- }
|
||||
- code = gs_remove_control_path(mem, gs_permit_file_control, fp);
|
||||
+ rewrite_percent_specifiers(f);
|
||||
+
|
||||
+ code = gs_remove_control_path(mem, gs_permit_file_control, f);
|
||||
if (code < 0)
|
||||
return code;
|
||||
- return gs_remove_control_path(mem, gs_permit_file_writing, fp);
|
||||
+ return gs_remove_control_path(mem, gs_permit_file_writing, f);
|
||||
}
|
||||
|
||||
int
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# From https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9533/SHA512SUMS
|
||||
sha512 c142ef9d83896aa8fd18c8e412220fe8f4950614be00d327d27ab051fe85e16524bf2ee00f46c2aca7a352ce47bc3acf2c4de0f7bbea7e4c55474b8af6cdc0a6 ghostscript-9.53.3.tar.gz
|
||||
# From https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9561/SHA512SUMS
|
||||
sha512 f498384af80654c040635564b8bc9a64c4bb5b0769bb00aade4042bbe9117c482362dc1a1fac72db3ce9487dd5a5bb8fb81b35b360680fe598df33dfbbe79499 ghostscript-9.56.1.tar.gz
|
||||
|
||||
# Hash for license file:
|
||||
sha256 6f852249f975287b3efd43a5883875e47fa9f3125e2f1b18b5c09517ac30ecf2 LICENSE
|
||||
sha256 8ce064f423b7c24a011b6ebf9431b8bf9861a5255e47c84bfb23fc526d030a8b LICENSE
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
GHOSTSCRIPT_VERSION = 9.53.3
|
||||
GHOSTSCRIPT_VERSION = 9.56.1
|
||||
GHOSTSCRIPT_SITE = https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs$(subst .,,$(GHOSTSCRIPT_VERSION))
|
||||
GHOSTSCRIPT_LICENSE = AGPL-3.0
|
||||
GHOSTSCRIPT_LICENSE_FILES = LICENSE
|
||||
@@ -21,9 +21,6 @@ GHOSTSCRIPT_DEPENDENCIES = \
|
||||
libpng \
|
||||
tiff
|
||||
|
||||
# 0002-Bug-704342-Include-device-specifier-strings-in-acces.patch
|
||||
GHOSTSCRIPT_IGNORE_CVES += CVE-2021-3781
|
||||
|
||||
# Ghostscript includes (old) copies of several libraries, delete them.
|
||||
# Inspired by linuxfromscratch:
|
||||
# http://www.linuxfromscratch.org/blfs/view/svn/pst/gs.html
|
||||
@@ -69,9 +66,18 @@ else
|
||||
GHOSTSCRIPT_CONF_OPTS += --disable-openjpeg
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_OPENJPEG)$(BR2_PACKAGE_JBIG2DEC),yy)
|
||||
# Dependencies already handle on per-package basis above,
|
||||
# but duplicated here for consistency.
|
||||
GHOSTSCRIPT_DEPENDENCIES += openjpeg jbig2dec
|
||||
GHOSTSCRIPT_CONF_OPTS += --with-pdf
|
||||
else
|
||||
GHOSTSCRIPT_CONF_OPTS += --without-pdf
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_CUPS),y)
|
||||
GHOSTSCRIPT_DEPENDENCIES += cups
|
||||
GHOSTSCRIPT_CONF_OPTS += \
|
||||
GHOSTSCRIPT_CONF_OPTS += \
|
||||
CUPSCONFIG=$(STAGING_DIR)/usr/bin/cups-config \
|
||||
--enable-cups
|
||||
else
|
||||
@@ -85,4 +91,8 @@ else
|
||||
GHOSTSCRIPT_CONF_OPTS += --without-x
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
|
||||
GHOSTSCRIPT_CONF_OPTS += --without-tesseract
|
||||
endif
|
||||
|
||||
$(eval $(autotools-package))
|
||||
|
||||
Reference in New Issue
Block a user