Bug 263411 - ntpd killed by SIGSEGV while trying to adjust RLIMIT_STACK
Summary: ntpd killed by SIGSEGV while trying to adjust RLIMIT_STACK
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.3-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-19 06:55 UTC by jau
Modified: 2022-04-24 18:30 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jau 2022-04-19 06:55:18 UTC
It seems ntpd dies on SIGSEGV right after start on FreeBSD-12.3.
I am not quite sure when this behavior has started.
Apparently the SIGSEGV gets delivered while calling setrlimit()
to adjust RLIMIT_STACK. (See ntp_config.c.)

The following line appears in dmesg...

pid 80157 (ntpd), jid 0, uid 0: exited on signal 11 (core dumped)

A quick check with gdb applied on ntpd and ntpd.core shows that
the process died on SIGSEGV from within setrlimit().
Comment 1 Ed Maste freebsd_committer freebsd_triage 2022-04-19 14:05:54 UTC
Have you configured any of the aslr-related sysctls to non-default values?

kern.elf32.aslr.*
kern.elf64.aslr.*
Comment 2 jau 2022-04-24 18:30:16 UTC
kern.elf64.aslr.stack_gap: 3
kern.elf64.aslr.honor_sbrk: 1
kern.elf64.aslr.pie_enable: 0
kern.elf64.aslr.enable: 1
kern.elf64.pie_base: 16912384
kern.elf64.nxstack: 1
kern.elf64.fallback_brand: 3

kern.elf32.aslr.stack_gap: 3
kern.elf32.aslr.honor_sbrk: 1
kern.elf32.aslr.pie_enable: 0
kern.elf32.aslr.enable: 1
kern.elf32.pie_base: 16781312
kern.elf32.read_exec: 0
kern.elf32.nxstack: 1
kern.elf32.fallback_brand: 3

kern.stackprot: 7

None of these has ever caused any problems before.

BTW I have never quite understood why kern.stackprot
has to be 7 by default, not 6 which would be a more
intuitive value.