git: af949c590bd8 - main - Disable stack gap for ntpd during build.
Brooks Davis
brooks at freebsd.org
Fri May 21 17:28:25 UTC 2021
On Fri, May 21, 2021 at 01:34:52PM +0000, Marcin Wojtas wrote:
> The branch main has been updated by mw:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=af949c590bd8a00a5973b5875d7e0fa6832ea64a
>
> commit af949c590bd8a00a5973b5875d7e0fa6832ea64a
> Author: Marcin Wojtas <mw at FreeBSD.org>
> AuthorDate: 2021-05-21 09:29:22 +0000
> Commit: Marcin Wojtas <mw at FreeBSD.org>
> CommitDate: 2021-05-21 13:33:06 +0000
>
> Disable stack gap for ntpd during build.
>
> When starting, ntpd calls setrlimit(2) to limit maximum size of its
> stack. The stack limit chosen by ntpd is 200K, so when stack gap
> is enabled, the stack gap is larger than this limit, which results
> in ntpd crashing.
>
> Submitted by: Dawid Gorecki <dgr at semihalf.com>
> Reviewed by: cy, imp
> Obtained from: Semihalf
> Sponsored by: Stormshield
> Differential Revision: https://reviews.freebsd.org/D29553
> ---
> usr.sbin/ntp/ntpd/Makefile | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/usr.sbin/ntp/ntpd/Makefile b/usr.sbin/ntp/ntpd/Makefile
> index 2d8a8b9d2a2d..b9c3a05547d4 100644
> --- a/usr.sbin/ntp/ntpd/Makefile
> +++ b/usr.sbin/ntp/ntpd/Makefile
> @@ -56,4 +56,7 @@ CLEANFILES+= .version version.c
> version.c:
> sh -e ${.CURDIR:H}/scripts/mkver ntpd
>
> +afterbuild:
> + ${ELFCTL} -e +noaslrstkgap ${PROG}
> +
> .include <bsd.prog.mk>
This is going to run every build and touch the file each time. It should
be done as part of the link target like CTFMERGE. elfctl should also
probably be taught not to write to the file if nothing changes.
-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/dev-commits-src-main/attachments/20210521/a5aa46ff/attachment.sig>
More information about the dev-commits-src-main
mailing list