Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Nov 2021 22:47:05 +0000
From:      bugzilla-noreply@freebsd.org
To:        testing@FreeBSD.org
Subject:   [Bug 259969] lib.libc.sys.setrlimit_test.setrlimit_stack fails with ASLR on by default
Message-ID:  <bug-259969-32464-oF4Hv1u5K7@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-259969-32464@https.bugs.freebsd.org/bugzilla/>
References:  <bug-259969-32464@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D259969

Dawid Gorecki <dgr@semihalf.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dgr@semihalf.com

--- Comment #2 from Dawid Gorecki <dgr@semihalf.com> ---
This issue is caused by the way setrlimit handles stack gap. Currently
setrlimit does know about stack gap, however only the rlim_cur value is
adjusted taking into consideration the size of the stack gap. rlim_max is a
hard limit, so we don't adjust it.

This test sets stack both rlim_cur and rlim_max to around 4MiB. By default
stack gap that FreeBSD has can be as big as 3% of maximum stack size, so for
amd64 this is around 15M. Because of that, when trying to set stack limit to
4M, in most cases the test will receive SIGSEGV immediately when exiting the
syscall. Adjusting the resource limit from 4M to a value higher than maximum
stack gap size should resolve this problem.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-259969-32464-oF4Hv1u5K7>