]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: better parameters for the interval stack overflow test
authorŠtěpán Němec <snemec@redhat.com>
Wed, 1 Dec 2021 11:12:00 +0000 (12:12 +0100)
committerPhil Sutter <phil@nwl.cc>
Wed, 8 Dec 2021 12:18:11 +0000 (13:18 +0100)
Wider testing has shown that 128 kB stack is too low (e.g. for systems
with 64 kB page size), leading to false failures in some environments.

Based on results from a matrix of RHEL 8 and RHEL 9 systems across
x86_64, aarch64, ppc64le and s390x architectures as well as some
anecdotal testing of other Linux distros on x86_64 machines, 400 kB
seems safe: the normal nft stack (which should stay constant during
this test) on all tested systems doesn't exceed 200 kB (stays around
100 kB on typical systems with 4 kB page size), while always growing
beyond 500 kB in the failing case (nftables before baecd1cf2685) with
the increased set size.

Fixes: d8ccad2a2b73 ("tests: cover baecd1cf2685 ("segtree: Fix segfault when restoring a huge interval set")")
Signed-off-by: Štěpán Němec <snemec@redhat.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
tests/shell/testcases/sets/0068interval_stack_overflow_0

index 6620572449c3ca3d920bb3fce86f6c3055cfa780..2cbc986802644a96e5a51eabeb328099421d3195 100755 (executable)
@@ -9,7 +9,7 @@ trap 'rm -f "$ruleset_file"' EXIT
 {
        echo 'define big_set = {'
        for ((i = 1; i < 255; i++)); do
-               for ((j = 1; j < 80; j++)); do
+               for ((j = 1; j < 255; j++)); do
                        echo "10.0.$i.$j,"
                done
        done
@@ -26,4 +26,4 @@ table inet test68_table {
 }
 EOF
 
-( ulimit -s 128 && $NFT -f "$ruleset_file" )
+( ulimit -s 400 && $NFT -f "$ruleset_file" )