Skip to content

Commit 553ba02

Browse files
committed
[test] Test that the exec-stack bit isn't set on libzstd.so
Adds a test for PR facebook#2857. 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.
1 parent 7847c2f commit 553ba02

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.github/workflows/dev-short-tests.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,19 @@ jobs:
117117
make -C zlibWrapper test
118118
make -C zlibWrapper valgrindTest
119119
120-
lz4-threadpool-partial-libs:
120+
lz4-threadpool-libs:
121121
runs-on: ubuntu-latest
122122
steps:
123123
- uses: actions/checkout@v2
124-
- name: LZ4, thread pool, and partial libs testslib wrapper test
124+
- name: LZ4, thread pool, and libs build testslib wrapper test
125125
run: |
126126
make lz4install
127127
make -C tests test-lz4
128128
make check < /dev/null | tee # mess with lz4 console detection
129129
make clean
130130
make -C tests test-pool
131131
make clean
132-
bash tests/libzstd_partial_builds.sh
132+
bash tests/libzstd_builds.sh
133133
134134
gcc-make-tests-32bit:
135135
runs-on: ubuntu-latest

tests/libzstd_partial_builds.sh tests/libzstd_builds.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,19 @@ mustBeAbsent() {
2323

2424
# default compilation : all features enabled - no zbuff
2525
$ECHO "testing default library compilation"
26-
CFLAGS= make -C $DIR/../lib libzstd.a > $INTOVOID
26+
CFLAGS= make -C $DIR/../lib libzstd libzstd.a > $INTOVOID
2727
nm $DIR/../lib/libzstd.a | $GREP "\.o" > tmplog
2828
isPresent "zstd_compress.o"
2929
isPresent "zstd_decompress.o"
3030
isPresent "zdict.o"
3131
isPresent "zstd_v07.o"
3232
mustBeAbsent "zbuff_compress.o"
33-
$RM $DIR/../lib/libzstd.a tmplog
33+
rm tmplog
34+
35+
# Check that the exec-stack bit isn't set
36+
readelf -lW $DIR/../lib/libzstd.so | $GREP "GNU_STACK" > tmplog
37+
mustBeAbsent "RWE"
38+
$RM $DIR/../lib/libzstd.a $DIR/../lib/libzstd.so* tmplog
3439

3540
# compression disabled => also disable zdict
3641
$ECHO "testing with compression disabled"

0 commit comments

Comments
 (0)