Blame SOURCES/ntp-4.2.6p5-cve-2016-7429.patch
|
|
5bc849 |
diff -up ntp-4.2.6p5/ntpd/ntp_peer.c.cve-2016-7429 ntp-4.2.6p5/ntpd/ntp_peer.c
|
|
|
5bc849 |
--- ntp-4.2.6p5/ntpd/ntp_peer.c.cve-2016-7429 2016-11-21 16:47:51.738767270 +0100
|
|
|
5bc849 |
+++ ntp-4.2.6p5/ntpd/ntp_peer.c 2016-11-21 16:52:02.434034046 +0100
|
|
|
5bc849 |
@@ -241,7 +241,8 @@ findpeer(
|
|
|
5bc849 |
hash = NTP_HASH_ADDR(srcadr);
|
|
|
5bc849 |
for (p = peer_hash[hash]; p != NULL; p = p->next) {
|
|
|
5bc849 |
if (SOCK_EQ(srcadr, &p->srcadr) &&
|
|
|
5bc849 |
- NSRCPORT(srcadr) == NSRCPORT(&p->srcadr)) {
|
|
|
5bc849 |
+ NSRCPORT(srcadr) == NSRCPORT(&p->srcadr) &&
|
|
|
65a740 |
+ (p->hmode == MODE_BCLIENT || p->dstadr == rbufp->dstadr)) {
|
|
|
5bc849 |
|
|
|
5bc849 |
/*
|
|
|
5bc849 |
* if the association matching rules determine
|
|
|
5bc849 |
@@ -288,13 +289,6 @@ findpeer(
|
|
|
5bc849 |
*/
|
|
|
5bc849 |
if (NULL == p) {
|
|
|
5bc849 |
*action = MATCH_ASSOC(NO_PEER, pkt_mode);
|
|
|
5bc849 |
- } else if (p->dstadr != rbufp->dstadr) {
|
|
|
5bc849 |
- set_peerdstadr(p, rbufp->dstadr);
|
|
|
5bc849 |
- if (p->dstadr == rbufp->dstadr) {
|
|
|
5bc849 |
- DPRINTF(1, ("Changed %s local address to match response\n",
|
|
|
5bc849 |
- stoa(&p->srcadr)));
|
|
|
5bc849 |
- return findpeer(rbufp, pkt_mode, action);
|
|
|
5bc849 |
- }
|
|
|
5bc849 |
}
|
|
|
5bc849 |
return p;
|
|
|
5bc849 |
}
|
|
|
5bc849 |
@@ -548,6 +542,11 @@ set_peerdstadr(
|
|
|
5bc849 |
{
|
|
|
5bc849 |
struct peer * unlinked;
|
|
|
5bc849 |
|
|
|
5bc849 |
+ DEBUG_INSIST(p != NULL);
|
|
|
5bc849 |
+
|
|
|
5bc849 |
+ if (p == NULL)
|
|
|
5bc849 |
+ return;
|
|
|
5bc849 |
+
|
|
|
5bc849 |
if (p->dstadr == dstadr)
|
|
|
5bc849 |
return;
|
|
|
5bc849 |
|