[test] Test that the exec-stack bit isn't set on libzstd.so

Tests that libzstd.so doesn't have the exec-stack bit set using
readelf. If the stack is marked executable systemd will refuse
to link against zstd. We now test that it isn't set on every PR.

Adds a test for PR #2857
Fixes Issue #2865
This commit is contained in:
Nick Terrell
2021-11-30 18:13:00 -08:00
parent 7847c2fd68
commit 360c2630e4
2 changed files with 10 additions and 5 deletions
+3 -3
View File
@@ -117,11 +117,11 @@ jobs:
make -C zlibWrapper test make -C zlibWrapper test
make -C zlibWrapper valgrindTest make -C zlibWrapper valgrindTest
lz4-threadpool-partial-libs: lz4-threadpool-libs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: LZ4, thread pool, and partial libs testslib wrapper test - name: LZ4, thread pool, and libs build testslib wrapper test
run: | run: |
make lz4install make lz4install
make -C tests test-lz4 make -C tests test-lz4
@@ -129,7 +129,7 @@ jobs:
make clean make clean
make -C tests test-pool make -C tests test-pool
make clean make clean
bash tests/libzstd_partial_builds.sh bash tests/libzstd_builds.sh
gcc-make-tests-32bit: gcc-make-tests-32bit:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -23,14 +23,19 @@ mustBeAbsent() {
# default compilation : all features enabled - no zbuff # default compilation : all features enabled - no zbuff
$ECHO "testing default library compilation" $ECHO "testing default library compilation"
CFLAGS= make -C $DIR/../lib libzstd.a > $INTOVOID CFLAGS= make -C $DIR/../lib libzstd libzstd.a > $INTOVOID
nm $DIR/../lib/libzstd.a | $GREP "\.o" > tmplog nm $DIR/../lib/libzstd.a | $GREP "\.o" > tmplog
isPresent "zstd_compress.o" isPresent "zstd_compress.o"
isPresent "zstd_decompress.o" isPresent "zstd_decompress.o"
isPresent "zdict.o" isPresent "zdict.o"
isPresent "zstd_v07.o" isPresent "zstd_v07.o"
mustBeAbsent "zbuff_compress.o" mustBeAbsent "zbuff_compress.o"
$RM $DIR/../lib/libzstd.a tmplog $RM tmplog
# Check that the exec-stack bit isn't set
readelf -lW $DIR/../lib/libzstd.so | $GREP "GNU_STACK" > tmplog
mustBeAbsent "RWE"
$RM $DIR/../lib/libzstd.a $DIR/../lib/libzstd.so* tmplog
# compression disabled => also disable zdict # compression disabled => also disable zdict
$ECHO "testing with compression disabled" $ECHO "testing with compression disabled"