SHA256
3
0
forked from pool/zstd

Accepting request 944040 from home:dirkmueller:Factory

- add noexecstack.patch (bsc#1194337)

OBS-URL: https://build.opensuse.org/request/show/944040
OBS-URL: https://build.opensuse.org/package/show/Archiving/zstd?expand=0&rev=73
This commit is contained in:
Martin Pluskal 2022-01-05 14:26:37 +00:00 committed by Git OBS Bridge
parent 716ab31830
commit 6a56d6a46e
3 changed files with 49 additions and 1 deletions

40
noexecstack.patch Normal file
View File

@ -0,0 +1,40 @@
From 9a9d1ec6f4536ffeb745f360ef010cefd125bfd0 Mon Sep 17 00:00:00 2001
From: "W. Felix Handte" <w@felixhandte.com>
Date: Wed, 29 Dec 2021 17:47:12 -0800
Subject: [PATCH] Mark Huffman Decoder Assembly `noexecstack` on All
Architectures
Apparently, even when the assembly file is empty (because
`ZSTD_ENABLE_ASM_X86_64_BMI2` is false), it still is marked as possibly
needing an executable stack and so the whole library is marked as such. This
commit applies a simple patch for this problem by moving the noexecstack
indication outside the macro guard.
This commit builds on #2857.
This commit addresses #2963.
---
lib/decompress/huf_decompress_amd64.S | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/decompress/huf_decompress_amd64.S b/lib/decompress/huf_decompress_amd64.S
index 98173cce86..706786bb0d 100644
--- a/lib/decompress/huf_decompress_amd64.S
+++ b/lib/decompress/huf_decompress_amd64.S
@@ -1,7 +1,5 @@
#include "../common/portability_macros.h"
-#if ZSTD_ENABLE_ASM_X86_64_BMI2
-
/* Stack marking
* ref: https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart
*/
@@ -9,6 +7,8 @@
.section .note.GNU-stack,"",%progbits
#endif
+#if ZSTD_ENABLE_ASM_X86_64_BMI2
+
/* Calling convention:
*
* %rdi contains the first argument: HUF_DecompressAsmArgs*.

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Jan 5 13:12:22 UTC 2022 - Dirk Müller <dmueller@suse.com>
- add noexecstack.patch (bsc#1194337)
-------------------------------------------------------------------
Mon Jan 3 09:18:49 UTC 2022 - Dirk Müller <dmueller@suse.com>

View File

@ -30,6 +30,8 @@ Source1: https://github.com/facebook/zstd/releases/download/v%{version}/%
Source2: zstd.keyring
Source99: baselibs.conf
Patch1: pzstd.1.patch
# Cherry-pick from https://github.com/facebook/zstd/pull/2964
Patch2: https://github.com/facebook/zstd/commit/9a9d1ec6f4536ffeb745f360ef010cefd125bfd0.patch#/noexecstack.patch
BuildRequires: gcc
# C++ is needed for pzstd only
BuildRequires: gcc-c++
@ -47,8 +49,9 @@ compression than gzip. For roughly the same time, zstd achives a
~12%% better ratio than gzip. LZMA outperforms zstd by ~10%% faster
compression for same ratio, or ~14%% size reduction for same time.
# This compression summary is based on https://lists.opensuse.org/opensuse-factory/2019-05/msg00344.html
# This compression summary is based on https://lists.opensuse.org/opensuse-factory/2019-05/msg00344.html
%package -n %{libname}
Summary: Zstd compression library
Group: System/Libraries