[packages/ntp] Rel 4. Fix refclock overflows, bind-fail crash and glibc 2.43 build
arekm
arekm at pld-linux.org
Thu Oct 29 08:52:17 CET 2026
commit efa1d801406149e36f47f951b6e6ac2474b33ea0
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Thu Oct 29 01:16:34 2026 +0100
Rel 4. Fix refclock overflows, bind-fail crash and glibc 2.43 build
Fixes CVE-2026-102485, CVE-2026-102484, CVE-2026-18321.
ntp-CVE-2026-102484.patch | 23 +++++++++++++++++++++++
ntp-CVE-2026-102485.patch | 15 +++++++++++++++
ntp-CVE-2026-18321.patch | 19 +++++++++++++++++++
ntp-bug3928-bind-fail-crash.patch | 35 +++++++++++++++++++++++++++++++++++
ntp-glibc-2.43.patch | 17 +++++++++++++++++
ntp.spec | 19 ++++++++++++++-----
6 files changed, 123 insertions(+), 5 deletions(-)
---
diff --git a/ntp.spec b/ntp.spec
index 6adba8c..8ed1c91 100644
--- a/ntp.spec
+++ b/ntp.spec
@@ -14,7 +14,7 @@ Summary(pl.UTF-8): Narzędzia do synchronizacji czasu (Network Time Protocol)
Summary(pt_BR.UTF-8): Network Time Protocol versão 4
Name: ntp
Version: 4.2.8p18
-Release: 3
+Release: 4
License: distributable
Group: Networking/Daemons
# also https://downloads.nwtime.org/ntp/
@@ -31,14 +31,19 @@ Source7: %{name}-manpages.tar.gz
Source10: %{name}date-wrapper
Source11: %{name}d.service
Source12: %{name}date.service
-Source13: https://www.ietf.org/timezones/data/leap-seconds.list
-# Source13-md5: 961f9b603309f2d12dcb420c054eff5f
+Source13: https://data.iana.org/time-zones/data/leap-seconds.list
+# Source13-md5: 026074d5bb81bb0932bf3be9e01a58cc
Patch0: %{name}-build.patch
Patch1: %{name}-no_libelf.patch
Patch2: %{name}-ipv6.patch
Patch3: %{name}-nano.patch
Patch4: %{name}-openssl.patch
Patch5: pthread-detect.patch
+Patch6: %{name}-bug3928-bind-fail-crash.patch
+Patch7: %{name}-CVE-2026-102485.patch
+Patch8: %{name}-CVE-2026-102484.patch
+Patch9: %{name}-CVE-2026-18321.patch
+Patch10: %{name}-glibc-2.43.patch
# FC patches + 100
Patch102: %{name}-4.2.6p1-droproot.patch
Patch107: %{name}-4.2.6p1-retcode.patch
@@ -51,12 +56,10 @@ BuildRequires: automake >= 1:1.10
%{?with_avahi:BuildRequires: avahi-compat-libdns_sd-devel}
BuildRequires: libcap-devel
%{?with_sntp:BuildRequires: libevent-devel >= 2.0}
-BuildRequires: libnl-devel
%{?with_seccomp:BuildRequires: libseccomp-devel}
BuildRequires: libtool
BuildRequires: net-snmp-devel
BuildRequires: openssl-devel >= 0.9.7d
-BuildRequires: pciutils-devel
# AUTO: -- checking for pkg-config... no
BuildRequires: pkgconfig
BuildRequires: readline-devel >= 4.2
@@ -244,6 +247,11 @@ Este pacote contém documentação adicional sobre o NTP versão 4.
%patch -P3 -p1
%patch -P4 -p1
%patch -P5 -p1
+%patch -P6 -p1
+%patch -P7 -p1
+%patch -P8 -p1
+%patch -P9 -p1
+%patch -P10 -p1
## FC patches
%patch -P102 -p1
@@ -275,6 +283,7 @@ cd ../..
CPPFLAGS="%{rpmcppflags} -I/usr/include/readline -I/usr/include/openssl"
%configure \
+ %{!?with_avahi:ac_cv_header_dns_sd_h=no} \
--enable-getifaddrs \
--enable-ipv6 \
%{?with_seccomp:--enable-libseccomp} \
diff --git a/ntp-CVE-2026-102484.patch b/ntp-CVE-2026-102484.patch
new file mode 100644
index 0000000..7f265e2
--- /dev/null
+++ b/ntp-CVE-2026-102484.patch
@@ -0,0 +1,23 @@
+CVE-2026-102484: Telephone JJY replies beyond the sixth TIME answer write
+past iTimestamp[MAX_TIMESTAMP] in teljjy_conn_data(). Port of NTPsec
+62a454f6fcb6f2dcc8d5866f6558905ebdb7dd69, https://gitlab.com/NTPsec/ntpsec/-/work_items/895
+
+--- a/ntpd/refclock_jjy.c
++++ b/ntpd/refclock_jjy.c
+@@ -3519,9 +3519,14 @@ teljjy_conn_data ( struct peer *peer, st
+ jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ;
+ up->bLineError = TRUE ;
+ }
+- up->iTimestamp[up->iTimestampCount] = ( up->hour * 60 + up->minute ) * 60 + up->second ;
+
+- up->iTimestampCount++ ;
++ if ( up->iTimestampCount >= MAX_TIMESTAMP ) {
++ /* More time replies than the command sequence asks for */
++ up->bLineError = TRUE ;
++ } else {
++ up->iTimestamp[up->iTimestampCount] = ( up->hour * 60 + up->minute ) * 60 + up->second ;
++ up->iTimestampCount++ ;
++ }
+
+ if ( up->iTimestampCount == 6 && ! up->bLineError ) {
+ #if DEBUG
diff --git a/ntp-CVE-2026-102485.patch b/ntp-CVE-2026-102485.patch
new file mode 100644
index 0000000..8f6b27f
--- /dev/null
+++ b/ntp-CVE-2026-102485.patch
@@ -0,0 +1,15 @@
+CVE-2026-102485: a PPS Control (@@Gc) reply with a mode byte above 3 indexes
+past tbl[] in oncore_msg_Gc(). Port of NTPsec 22a09b3aec58831a9e4a008f3f22caa155f969c2
+https://gitlab.com/NTPsec/ntpsec/-/work_items/895
+
+--- a/ntpd/refclock_oncore.c
++++ b/ntpd/refclock_oncore.c
+@@ -3190,7 +3190,7 @@ oncore_msg_Gc(
+
+ instance->pps_control_msg_seen = 1;
+ oncore_log_f(instance, LOG_INFO, "PPS Control set to %s",
+- tbl[buf[4]]);
++ buf[4] < COUNTOF(tbl) ? tbl[buf[4]] : "unknown");
+ }
+
+
diff --git a/ntp-CVE-2026-18321.patch b/ntp-CVE-2026-18321.patch
new file mode 100644
index 0000000..ae8b7a4
--- /dev/null
+++ b/ntp-CVE-2026-18321.patch
@@ -0,0 +1,19 @@
+CVE-2026-18321: an oversized Zyfer continuation chunk overflows a_lastcode[BMAX]
+in zyfer_receive(). Port of NTPsec 28255fe0, https://gitlab.com/NTPsec/ntpsec/-/work_items/890
+
+--- a/ntpd/refclock_zyfer.c
++++ b/ntpd/refclock_zyfer.c
+@@ -245,6 +245,13 @@ zyfer_receive(
+ else
+ return;
+ } else {
++ /* lencode < LENZYFER here; the chunk must fit with the NUL */
++ if ((size_t)rbufp->recv_length >=
++ sizeof(pp->a_lastcode) - (size_t)pp->lencode) {
++ pp->lencode = 0;
++ refclock_report(peer, CEVNT_BADREPLY);
++ return;
++ }
+ memcpy(pp->a_lastcode + pp->lencode, p, rbufp->recv_length);
+ pp->lencode += rbufp->recv_length;
+ pp->a_lastcode[pp->lencode] = '\0';
diff --git a/ntp-bug3928-bind-fail-crash.patch b/ntp-bug3928-bind-fail-crash.patch
new file mode 100644
index 0000000..63a0aac
--- /dev/null
+++ b/ntp-bug3928-bind-fail-crash.patch
@@ -0,0 +1,35 @@
+From 7ff249015e94bd761b81f6a4efcb98358a239c74 Mon Sep 17 00:00:00 2001
+From: Dave Hart <hart at ntp.org>
+Date: Wed, 24 Jul 2024 01:29:44 +0000
+Subject: [PATCH] [Bug 3928] ntpd 4.2.8p18 crash when bringing up net interface
+ fails.
+
+bk: 66a05908VAEUbPES33k8_ZsJoNaQDw
+---
+ ntpd/ntp_io.c | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c
+index 9d79fe493d..c9b1822763 100644
+--- a/ntpd/ntp_io.c
++++ b/ntpd/ntp_io.c
+@@ -1917,15 +1917,14 @@ update_interfaces(
+ }
+ new_interface_found = TRUE;
+ DPRINT_INTERFACE(3,
+- (ep, "updating ", " new - created\n"));
+- }
+- else {
++ (ep2, "updating ", " new - created\n"));
++ } else {
+ DPRINT_INTERFACE(3,
+- (ep, "updating ", " new - FAILED"));
++ (ep2, "updating ", " new - FAILED"));
+
+ msyslog(LOG_ERR,
+ "cannot bind address %s",
+- stoa(&ep->sin));
++ stoa(&ep2->sin));
+ }
+ free(ep2);
+ }
diff --git a/ntp-glibc-2.43.patch b/ntp-glibc-2.43.patch
new file mode 100644
index 0000000..50d61a5
--- /dev/null
+++ b/ntp-glibc-2.43.patch
@@ -0,0 +1,17 @@
+glibc 2.43 turns memchr() into a _Generic macro, so sntp's own prototype in
+l_stdlib.h (used when HAVE_MEMCHR is not defined) no longer compiles.
+From openSUSE: https://build.opensuse.org/package/show/openSUSE:Factory/ntp
+
+Index: ntp-4.2.8p18/sntp/configure.ac
+===================================================================
+--- ntp-4.2.8p18.orig/sntp/configure.ac
++++ ntp-4.2.8p18/sntp/configure.ac
+@@ -130,7 +130,7 @@ AC_DEFINE([HAVE_NO_NICE], 1, [sntp does
+ AC_DEFINE([HAVE_TERMIOS], 1, [sntp does not care about TTY stuff])
+
+ # Checks for library functions.
+-AC_CHECK_FUNCS([socket])
++AC_CHECK_FUNCS([socket memchr strnlen])
+
+ NTP_UNITYBUILD
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/ntp.git/commitdiff/efa1d801406149e36f47f951b6e6ac2474b33ea0
More information about the pld-cvs-commit
mailing list