FreeBSD Bugzilla – Attachment 208585 Details for
Bug 241421
net/ntp segfaults with stack_gap!=0
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
This should fix this PR.
base-ntpd.diff (text/plain), 1.05 KB, created by
Cy Schubert
on 2019-10-24 20:35:45 UTC
(
hide
)
Description:
This should fix this PR.
Filename:
MIME Type:
Creator:
Cy Schubert
Created:
2019-10-24 20:35:45 UTC
Size:
1.05 KB
patch
obsolete
>diff --git a/contrib/ntp/ntpd/ntpd.c b/contrib/ntp/ntpd/ntpd.c >index bcfca27a535..2ed3046c264 100644 >--- a/contrib/ntp/ntpd/ntpd.c >+++ b/contrib/ntp/ntpd/ntpd.c >@@ -790,6 +790,13 @@ ntpdmain( > int fd; > int zero; > # endif >+ int aslr = 0; >+ int aslr_len = sizeof(aslr); >+#ifdef __LP64__ >+ char *aslr_var = "kern.elf64.aslr.enable"; >+#else >+ char *aslr_var = "kern.elf32.aslr.enable"; >+#endif > > # ifdef NEED_PTHREAD_WARMUP > my_pthread_warmup(); >@@ -998,7 +1005,15 @@ ntpdmain( > /* Setup stack size in preparation for locking pages in memory. */ > # if defined(HAVE_MLOCKALL) > # ifdef HAVE_SETRLIMIT >- ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k"); >+ >+ if ((rc = sysctlbyname(aslr_var, aslr, &aslr_len, NULL, 0)) != 0)) >+ msyslog(LOG_ERR, >+ "sysctlbyname: %s: %s", >+ aslr_var, >+ strerror(rc)); >+ >+ if (aslr == 0) >+ ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k"); > # if defined(RLIMIT_MEMLOCK) && defined(DFLT_RLIMIT_MEMLOCK) && DFLT_RLIMIT_MEMLOCK != -1 > /* > * The default RLIMIT_MEMLOCK is very low on Linux systems.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 241421
:
208549
|
208585
|
208592