update to 4.2.8p14
This commit is contained in:
parent
4b06fb46c2
commit
ee35d3a785
@ -1,80 +0,0 @@
|
||||
Subject: [PATCH] Use-of-uninitialized-value in receive function
|
||||
|
||||
---
|
||||
ntpd/ntp_proto.c | 43 ++++++++++++++++++++++++++++---------------
|
||||
1 file changed, 28 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/ntpd/ntp_proto.c b/ntpd/ntp_proto.c
|
||||
index eb66351..baffe1b 100644
|
||||
--- a/ntpd/ntp_proto.c
|
||||
+++ b/ntpd/ntp_proto.c
|
||||
@@ -640,31 +640,20 @@ receive(
|
||||
*/
|
||||
/*
|
||||
* Bogus port check is before anything, since it probably
|
||||
- * reveals a clogging attack.
|
||||
+ * reveals a clogging attack. Likewise the mimimum packet size
|
||||
+ * of 2 bytes (for mode 6/7) must be checked first.
|
||||
*/
|
||||
sys_received++;
|
||||
- if (0 == SRCPORT(&rbufp->recv_srcadr)) {
|
||||
+ if (0 == SRCPORT(&rbufp->recv_srcadr) || rbufp->recv_length < 2) {
|
||||
sys_badlength++;
|
||||
- return; /* bogus port */
|
||||
+ return; /* bogus port / length */
|
||||
}
|
||||
restrictions(&rbufp->recv_srcadr, &r4a);
|
||||
restrict_mask = r4a.rflags;
|
||||
|
||||
pkt = &rbufp->recv_pkt;
|
||||
hisversion = PKT_VERSION(pkt->li_vn_mode);
|
||||
- hisleap = PKT_LEAP(pkt->li_vn_mode);
|
||||
hismode = (int)PKT_MODE(pkt->li_vn_mode);
|
||||
- hisstratum = PKT_TO_STRATUM(pkt->stratum);
|
||||
- DPRINTF(1, ("receive: at %ld %s<-%s ippeerlimit %d mode %d iflags %s restrict %s org %#010x.%08x xmt %#010x.%08x\n",
|
||||
- current_time, stoa(&rbufp->dstadr->sin),
|
||||
- stoa(&rbufp->recv_srcadr), r4a.ippeerlimit, hismode,
|
||||
- build_iflags(rbufp->dstadr->flags),
|
||||
- build_rflags(restrict_mask),
|
||||
- ntohl(pkt->org.l_ui), ntohl(pkt->org.l_uf),
|
||||
- ntohl(pkt->xmt.l_ui), ntohl(pkt->xmt.l_uf)));
|
||||
-
|
||||
- /* See basic mode and broadcast checks, below */
|
||||
- INSIST(0 != hisstratum);
|
||||
|
||||
if (restrict_mask & RES_IGNORE) {
|
||||
DPRINTF(2, ("receive: drop: RES_IGNORE\n"));
|
||||
@@ -696,6 +685,30 @@ receive(
|
||||
return; /* no time serve */
|
||||
}
|
||||
|
||||
+
|
||||
+ /* If we arrive here, we should have a standard NTP packet. We
|
||||
+ * check that the minimum size is available and fetch some more
|
||||
+ * items from the packet once we can be sure they are indeed
|
||||
+ * there.
|
||||
+ */
|
||||
+ if (rbufp->recv_length < LEN_PKT_NOMAC) {
|
||||
+ sys_badlength++;
|
||||
+ return; /* bogus length */
|
||||
+ }
|
||||
+
|
||||
+ hisleap = PKT_LEAP(pkt->li_vn_mode);
|
||||
+ hisstratum = PKT_TO_STRATUM(pkt->stratum);
|
||||
+ INSIST(0 != hisstratum); /* paranoia check PKT_TO_STRATUM result */
|
||||
+
|
||||
+ DPRINTF(1, ("receive: at %ld %s<-%s ippeerlimit %d mode %d iflags %s "
|
||||
+ "restrict %s org %#010x.%08x xmt %#010x.%08x\n",
|
||||
+ current_time, stoa(&rbufp->dstadr->sin),
|
||||
+ stoa(&rbufp->recv_srcadr), r4a.ippeerlimit, hismode,
|
||||
+ build_iflags(rbufp->dstadr->flags),
|
||||
+ build_rflags(restrict_mask),
|
||||
+ ntohl(pkt->org.l_ui), ntohl(pkt->org.l_uf),
|
||||
+ ntohl(pkt->xmt.l_ui), ntohl(pkt->xmt.l_uf)));
|
||||
+
|
||||
/*
|
||||
* This is for testing. If restricted drop ten percent of
|
||||
* surviving packets.
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -1,47 +0,0 @@
|
||||
Subject: [PATCH] process_control() should bail earlier on short packets
|
||||
|
||||
---
|
||||
ntpd/ntp_control.c | 19 +-
|
||||
1 files changed, 21 insertions(+), 28 deletions(-)
|
||||
create mode 100644 ntpd/ntp_control.c.orig
|
||||
|
||||
diff --git a/ntpd/ntp_control.c b/ntpd/ntp_control.c
|
||||
index 48cd908..5984c8c 100644
|
||||
--- a/ntpd/ntp_control.c
|
||||
+++ b/ntpd/ntp_control.c
|
||||
@@ -1187,15 +1187,21 @@ process_control(
|
||||
pkt = (struct ntp_control *)&rbufp->recv_pkt;
|
||||
|
||||
/*
|
||||
- * If the length is less than required for the header, or
|
||||
- * it is a response or a fragment, ignore this.
|
||||
+ * If the length is less than required for the header,
|
||||
+ * ignore it.
|
||||
*/
|
||||
- if (rbufp->recv_length < (int)CTL_HEADER_LEN
|
||||
- || (CTL_RESPONSE | CTL_MORE | CTL_ERROR) & pkt->r_m_e_op
|
||||
+ if (rbufp->recv_length < (int)CTL_HEADER_LEN) {
|
||||
+ DPRINTF(1, ("Short control packet\n"));
|
||||
+ numctltooshort++;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * If this packet is a response or a fragment, ignore it.
|
||||
+ */
|
||||
+ if ( (CTL_RESPONSE | CTL_MORE | CTL_ERROR) & pkt->r_m_e_op
|
||||
|| pkt->offset != 0) {
|
||||
DPRINTF(1, ("invalid format in control packet\n"));
|
||||
- if (rbufp->recv_length < (int)CTL_HEADER_LEN)
|
||||
- numctltooshort++;
|
||||
if (CTL_RESPONSE & pkt->r_m_e_op)
|
||||
numctlinputresp++;
|
||||
if (CTL_MORE & pkt->r_m_e_op)
|
||||
@@ -1206,6 +1212,7 @@ process_control(
|
||||
numctlbadoffset++;
|
||||
return;
|
||||
}
|
||||
+
|
||||
res_version = PKT_VERSION(pkt->li_vn_mode);
|
||||
if (res_version > NTP_VERSION || res_version < NTP_OLDVERSION) {
|
||||
DPRINTF(1, ("unknown version %d in control packet\n",
|
||||
@ -1,13 +0,0 @@
|
||||
diff -Nur ntp-4.2.8p12.bak/ntpd/ntp_crypto.c ntp-4.2.8p12/ntpd/ntp_crypto.c
|
||||
--- ntp-4.2.8p12.bak/ntpd/ntp_crypto.c 2019-01-22 20:41:39.485000000 -0500
|
||||
+++ ntp-4.2.8p12/ntpd/ntp_crypto.c 2019-01-22 20:42:07.748000000 -0500
|
||||
@@ -3387,9 +3387,6 @@
|
||||
*/
|
||||
peer->crypto |= CRYPTO_FLAG_CERT;
|
||||
peer->grpkey = yp->grpkey;
|
||||
- if (peer->ident == NULL || !(peer->crypto &
|
||||
- CRYPTO_FLAG_MASK))
|
||||
- peer->crypto |= CRYPTO_FLAG_VRFY;
|
||||
}
|
||||
|
||||
/*
|
||||
Binary file not shown.
BIN
ntp-4.2.8p14.tar.gz
Normal file
BIN
ntp-4.2.8p14.tar.gz
Normal file
Binary file not shown.
24
ntp-psl-def.patch
Normal file
24
ntp-psl-def.patch
Normal file
@ -0,0 +1,24 @@
|
||||
diff -up ntp-4.2.8p14/include/ntp_config.h.psl ntp-4.2.8p14/include/ntp_config.h
|
||||
--- ntp-4.2.8p14/include/ntp_config.h.psl 2020-03-04 00:41:29.000000000 +0100
|
||||
+++ ntp-4.2.8p14/include/ntp_config.h 2020-03-10 15:12:48.516539212 +0100
|
||||
@@ -280,7 +280,7 @@ typedef struct settrap_parms_tag {
|
||||
* Poll Skew List
|
||||
*/
|
||||
|
||||
-psl_item psl[17-3+1]; /* values for polls 3-17 */
|
||||
+extern psl_item psl[17-3+1]; /* values for polls 3-17 */
|
||||
/* To simplify the runtime code we */
|
||||
/* don't want to have to special-case */
|
||||
/* dealing with a default */
|
||||
diff -up ntp-4.2.8p14/ntpd/ntp_config.c.psl ntp-4.2.8p14/ntpd/ntp_config.c
|
||||
--- ntp-4.2.8p14/ntpd/ntp_config.c.psl 2020-03-10 15:13:42.575669789 +0100
|
||||
+++ ntp-4.2.8p14/ntpd/ntp_config.c 2020-03-10 15:13:23.028622574 +0100
|
||||
@@ -202,6 +202,8 @@ int cryptosw; /* crypto command called
|
||||
|
||||
extern char *stats_drift_file; /* name of the driftfile */
|
||||
|
||||
+psl_item psl[17-3+1]; /* values for polls 3-17 */
|
||||
+
|
||||
#ifdef BC_LIST_FRAMEWORK_NOT_YET_USED
|
||||
/*
|
||||
* backwards compatibility flags
|
||||
@ -1,14 +0,0 @@
|
||||
diff -up ntp-4.2.8p8/sntp/main.c.orig ntp-4.2.8p8/sntp/main.c
|
||||
--- ntp-4.2.8p8/sntp/main.c.orig 2016-10-19 10:18:41.690800420 +0200
|
||||
+++ ntp-4.2.8p8/sntp/main.c 2016-10-19 10:19:31.900966925 +0200
|
||||
@@ -8,6 +8,10 @@
|
||||
# include <event2/thread.h>
|
||||
#endif
|
||||
|
||||
+#ifdef HAVE_SYSEXITS_H
|
||||
+#include <sysexits.h>
|
||||
+#endif
|
||||
+
|
||||
#include "main.h"
|
||||
#include "ntp_libopts.h"
|
||||
#include "kod_management.h"
|
||||
21
ntp.spec
21
ntp.spec
@ -1,8 +1,8 @@
|
||||
%global _hardened_build 1
|
||||
|
||||
Name: ntp
|
||||
Version: 4.2.8p13
|
||||
Release: 6
|
||||
Version: 4.2.8p14
|
||||
Release: 1
|
||||
Summary: A protocol designed to synchronize the clocks of computers over a network
|
||||
License: MIT and BSD and BSD with advertising
|
||||
URL: https://www.ntp.org/
|
||||
@ -20,16 +20,11 @@ Source13: ntpdate.service
|
||||
Source14: ntp-wait.service
|
||||
Source15: sntp.service
|
||||
Source16: sntp.sysconfig
|
||||
Patch1: ntp-sntp-sysexits.patch
|
||||
Patch2: ntp-ssl-libs.patch
|
||||
Patch1: ntp-ssl-libs.patch
|
||||
Patch2: ntp-psl-def.patch
|
||||
|
||||
Patch9000: bugfix-fix-bind-port-in-debug-mode.patch
|
||||
Patch9001: bugfix-fix-autokey-condition-error.patch
|
||||
Patch9002: bugfix-fix-ifindex-length.patch
|
||||
Patch9003: revert-ntpd-fix-autokey-condition-error.patch
|
||||
|
||||
Patch6001: backport-Use-of-uninitialized-value-in-receive-function.patch
|
||||
Patch6002: backport-process_control-should-bail-earlier-on-short-packets.patch
|
||||
Patch9001: bugfix-fix-ifindex-length.patch
|
||||
|
||||
BuildRequires: libcap-devel openssl-devel libedit-devel libevent-devel pps-tools-devel
|
||||
BuildRequires: autogen autogen-libopts-devel systemd gcc perl-generators perl-HTML-Parser
|
||||
@ -212,6 +207,12 @@ make check
|
||||
%{_mandir}/man8/*.8*
|
||||
|
||||
%changelog
|
||||
* Tue Jun 30 2020 yuboyun<yuboyun@huawei.com> - 4.2.8p14-1
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC: update to 4.2.8p14
|
||||
|
||||
* Tue Apr 14 2020 wangli<wangli221@huawei.com> - 4.2.8p13-6
|
||||
- Type:security
|
||||
- ID:NA
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
From 302cec597f3ab4e522dacc3563953d10c0f7e656 Mon Sep 17 00:00:00 2001
|
||||
From: zhangyao <zhangyao65@huawei.com>
|
||||
Date: Thu, 25 Jul 2019 16:42:51 +0000
|
||||
Subject: [PATCH] revert-ntpd-fix-autokey-condition-error
|
||||
|
||||
|
||||
---
|
||||
ntpd/ntp_crypto.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/ntpd/ntp_crypto.c b/ntpd/ntp_crypto.c
|
||||
index 53f3253..62ea72c 100644
|
||||
--- a/ntpd/ntp_crypto.c
|
||||
+++ b/ntpd/ntp_crypto.c
|
||||
@@ -3387,6 +3387,9 @@ cert_hike(
|
||||
*/
|
||||
peer->crypto |= CRYPTO_FLAG_CERT;
|
||||
peer->grpkey = yp->grpkey;
|
||||
+ if (peer->ident == NULL || !(peer->crypto &
|
||||
+ CRYPTO_FLAG_MASK))
|
||||
+ peer->crypto |= CRYPTO_FLAG_VRFY;
|
||||
}
|
||||
|
||||
/*
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user