summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2019-02-05 17:25:30 +0100
committerGitHub <noreply@github.com>2019-02-05 17:25:30 +0100
commitc9b046addadf1497e997790f0b70c3ae99ff8da3 (patch)
tree87eff879605a7d0f92c85a9de39b0cd6d22d4e4b
parentMerge pull request #3518 from rgirada/routemap_3090 (diff)
parentospfd: address CVE-2017-3224 (diff)
downloadfrr-c9b046addadf1497e997790f0b70c3ae99ff8da3.tar.xz
frr-c9b046addadf1497e997790f0b70c3ae99ff8da3.zip
Merge pull request #3693 from chiragshah6/ospf_vrf_dev
ospfd: address CVE-2017-3224
-rw-r--r--ospfd/ospf_packet.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index 30f5a2a80..ecc55c2ee 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -2098,10 +2098,22 @@ static void ospf_ls_upd(struct ospf *ospf, struct ip *iph,
if (current == NULL
|| (ret = ospf_lsa_more_recent(current, lsa)) < 0) {
+ /* CVE-2017-3224 */
+ if (current && (lsa->data->ls_seqnum ==
+ htonl(OSPF_MAX_SEQUENCE_NUMBER)
+ && !IS_LSA_MAXAGE(lsa))) {
+ zlog_debug(
+ "Link State Update[%s]: has Max Seq but not MaxAge. Dropping it",
+ dump_lsa_key(lsa));
+
+ DISCARD_LSA(lsa, 4);
+ continue;
+ }
+
/* Actual flooding procedure. */
if (ospf_flood(oi->ospf, nbr, current, lsa)
< 0) /* Trap NSSA later. */
- DISCARD_LSA(lsa, 4);
+ DISCARD_LSA(lsa, 5);
continue;
}
@@ -2158,7 +2170,7 @@ static void ospf_ls_upd(struct ospf *ospf, struct ip *iph,
oi->ls_ack,
ospf_lsa_lock(lsa));
- DISCARD_LSA(lsa, 5);
+ DISCARD_LSA(lsa, 6);
} else
/* Acknowledge the receipt of the LSA by sending a
Link State Acknowledgment packet back out the
@@ -2166,7 +2178,7 @@ static void ospf_ls_upd(struct ospf *ospf, struct ip *iph,
interface. */
{
ospf_ls_ack_send(nbr, lsa);
- DISCARD_LSA(lsa, 6);
+ DISCARD_LSA(lsa, 7);
}
}
@@ -2183,7 +2195,7 @@ static void ospf_ls_upd(struct ospf *ospf, struct ip *iph,
if (IS_LSA_MAXAGE(current)
&& current->data->ls_seqnum
== htonl(OSPF_MAX_SEQUENCE_NUMBER)) {
- DISCARD_LSA(lsa, 7);
+ DISCARD_LSA(lsa, 8);
}
/* Otherwise, as long as the database copy has not been
sent in a
@@ -2206,7 +2218,7 @@ static void ospf_ls_upd(struct ospf *ospf, struct ip *iph,
ospf_ls_upd_send_lsa(
nbr, current,
OSPF_SEND_PACKET_DIRECT);
- DISCARD_LSA(lsa, 8);
+ DISCARD_LSA(lsa, 9);
}
}
}