|
|
6e16f6 |
diff -up ntp-4.2.6p5/ntpd/ntp_proto.c.cve-2016-7426 ntp-4.2.6p5/ntpd/ntp_proto.c
|
|
|
6e16f6 |
--- ntp-4.2.6p5/ntpd/ntp_proto.c.cve-2016-7426 2016-11-21 16:14:42.804048665 +0100
|
|
|
6e16f6 |
+++ ntp-4.2.6p5/ntpd/ntp_proto.c 2016-11-21 17:32:45.619107824 +0100
|
|
|
6e16f6 |
@@ -473,30 +473,7 @@ receive(
|
|
|
6e16f6 |
}
|
|
|
6e16f6 |
|
|
|
6e16f6 |
/*
|
|
|
6e16f6 |
- * Update the MRU list and finger the cloggers. It can be a
|
|
|
6e16f6 |
- * little expensive, so turn it off for production use.
|
|
|
6e16f6 |
- */
|
|
|
6e16f6 |
- restrict_mask = ntp_monitor(rbufp, restrict_mask);
|
|
|
6e16f6 |
- if (restrict_mask & RES_LIMITED) {
|
|
|
6e16f6 |
- sys_limitrejected++;
|
|
|
6e16f6 |
- if (!(restrict_mask & RES_KOD) || MODE_BROADCAST ==
|
|
|
6e16f6 |
- hismode || MODE_SERVER == hismode)
|
|
|
6e16f6 |
- return; /* rate exceeded */
|
|
|
6e16f6 |
-
|
|
|
6e16f6 |
- if (hismode == MODE_CLIENT)
|
|
|
6e16f6 |
- fast_xmit(rbufp, MODE_SERVER, skeyid,
|
|
|
6e16f6 |
- restrict_mask);
|
|
|
6e16f6 |
- else
|
|
|
6e16f6 |
- fast_xmit(rbufp, MODE_ACTIVE, skeyid,
|
|
|
6e16f6 |
- restrict_mask);
|
|
|
6e16f6 |
- return; /* rate exceeded */
|
|
|
6e16f6 |
- }
|
|
|
6e16f6 |
- restrict_mask &= ~RES_KOD;
|
|
|
6e16f6 |
-
|
|
|
6e16f6 |
- /*
|
|
|
6e16f6 |
- * We have tossed out as many buggy packets as possible early in
|
|
|
6e16f6 |
- * the game to reduce the exposure to a clogging attack. now we
|
|
|
6e16f6 |
- * have to burn some cycles to find the association and
|
|
|
6e16f6 |
+ * now we have to burn some cycles to find the association and
|
|
|
6e16f6 |
* authenticate the packet if required. Note that we burn only
|
|
|
6e16f6 |
* MD5 cycles, again to reduce exposure. There may be no
|
|
|
6e16f6 |
* matching association and that's okay.
|
|
|
6e16f6 |
@@ -519,6 +496,27 @@ receive(
|
|
|
6e16f6 |
NTOHL_FP(&pkt->xmt, &p_xmt);
|
|
|
6e16f6 |
|
|
|
6e16f6 |
/*
|
|
|
6e16f6 |
+ * Update the MRU list and finger the cloggers. It can be a
|
|
|
6e16f6 |
+ * little expensive, so turn it off for production use.
|
|
|
6e16f6 |
+ */
|
|
|
6e16f6 |
+ restrict_mask = ntp_monitor(rbufp, restrict_mask);
|
|
|
6e16f6 |
+ if (restrict_mask & RES_LIMITED && retcode == AM_FXMIT) {
|
|
|
6e16f6 |
+ sys_limitrejected++;
|
|
|
6e16f6 |
+ if (!(restrict_mask & RES_KOD) || MODE_BROADCAST ==
|
|
|
6e16f6 |
+ hismode || MODE_SERVER == hismode)
|
|
|
6e16f6 |
+ return; /* rate exceeded */
|
|
|
6e16f6 |
+
|
|
|
6e16f6 |
+ if (hismode == MODE_CLIENT)
|
|
|
6e16f6 |
+ fast_xmit(rbufp, MODE_SERVER, skeyid,
|
|
|
6e16f6 |
+ restrict_mask);
|
|
|
6e16f6 |
+ else
|
|
|
6e16f6 |
+ fast_xmit(rbufp, MODE_ACTIVE, skeyid,
|
|
|
6e16f6 |
+ restrict_mask);
|
|
|
6e16f6 |
+ return; /* rate exceeded */
|
|
|
6e16f6 |
+ }
|
|
|
6e16f6 |
+ restrict_mask &= ~RES_KOD;
|
|
|
6e16f6 |
+
|
|
|
6e16f6 |
+ /*
|
|
|
6e16f6 |
* Authentication is conditioned by three switches:
|
|
|
6e16f6 |
*
|
|
|
6e16f6 |
* NOPEER (RES_NOPEER) do not mobilize an association unless
|
|
|
6e16f6 |
@@ -940,6 +938,10 @@ receive(
|
|
|
6e16f6 |
case AM_NEWPASS:
|
|
|
6e16f6 |
if (!AUTH(sys_authenticate | (restrict_mask &
|
|
|
6e16f6 |
(RES_NOPEER | RES_DONTTRUST)), is_authentic)) {
|
|
|
6e16f6 |
+ if (restrict_mask & RES_LIMITED) {
|
|
|
6e16f6 |
+ sys_limitrejected++;
|
|
|
6e16f6 |
+ return;
|
|
|
6e16f6 |
+ }
|
|
|
6e16f6 |
|
|
|
6e16f6 |
/*
|
|
|
6e16f6 |
* If authenticated but cannot mobilize an
|