mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
t_setrlimit: Adjust resource limit to 20M
With ASLR enabled by default, RLIMIT_STACK test fails due to the fact
that default stack gap can be as big as 15M. Because of that the
resource limit of 4M results in test program receiving SIGSEGV
immediately after exiting the setrlimit syscall. Since the idea of this
test is to check if rlim_cur does not extend past rlim_max, adjusting
the resource limit to 20M should not invalidate the test results.
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D33116
(cherry picked from commit 4f741801d8)
This commit is contained in:
parent
5b042fcbdf
commit
408c698b13
1 changed files with 4 additions and 0 deletions
|
|
@ -551,7 +551,11 @@ ATF_TC_BODY(setrlimit_stack, tc)
|
|||
struct rlimit res;
|
||||
|
||||
/* Ensure soft limit is not bigger than hard limit */
|
||||
#ifdef __FreeBSD__
|
||||
res.rlim_cur = res.rlim_max = 20971520;
|
||||
#else
|
||||
res.rlim_cur = res.rlim_max = 4192256;
|
||||
#endif
|
||||
ATF_REQUIRE(setrlimit(RLIMIT_STACK, &res) == 0);
|
||||
ATF_REQUIRE(getrlimit(RLIMIT_STACK, &res) == 0);
|
||||
ATF_CHECK(res.rlim_cur <= res.rlim_max);
|
||||
|
|
|
|||
Loading…
Reference in a new issue