0d23942aca
- Clean slate: removing all previous patches. - The following patches were obsoleted: - 0001-disable-zmq-test.patch - harden_frr.service.patch - 0003-tools-Run-as-FRR_USER-install-chown-commands-to-avoi.patch - 0004-tools-remove-backslash-from-declare-check-regex.patch - 0005-root-ok-in-account-frr.pam.patch - 0006-bgpd-Check-7-bytes-for-Long-lived-Graceful-Restart-c.patch - 0007-bgpd-Ensure-stream-received-has-enough-data.patch - 0008-bgpd-Don-t-read-the-first-byte-of-ORF-header-if-we-a.patch - 0009-bgpd-Do-not-process-NLRIs-if-the-attribute-length-is.patch - 0010-bgpd-Use-treat-as-withdraw-for-tunnel-encapsulation-.patch - 0011-babeld-fix-11808-to-avoid-infinite-loops.patch - 0012-bgpd-Limit-flowspec-to-no-attribute-means-a-implicit.patch - 0013-bgpd-Check-mandatory-attributes-more-carefully-for-U.patch - 0014-bgpd-Handle-MP_REACH_NLRI-malformed-packets-with-ses.patch - 0015-bgpd-Treat-EOR-as-withdrawn-to-avoid-unwanted-handli.patch - 0016-bgpd-Ignore-handling-NLRIs-if-we-received-MP_UNREACH.patch - 0017-bgpd-Fix-use-beyond-end-of-stream-of-labeled-unicast.patch - 0018-bgpd-Flowspec-overflow-issue.patch - 0019-bgpd-fix-error-handling-when-receiving-BGP-Prefix-SID-attribute.patch - 0020-ospfd-Solved-crash-in-OSPF-TE-parsing.patch - 0021-ospfd-Solved-crash-in-RI-parsing-with-OSPF-TE.patch - 0022-ospfd-Correct-Opaque-LSA-Extended-parser.patch - 0023-ospfd-protect-call-to-get_edge-in-ospf_te.c.patch OBS-URL: https://build.opensuse.org/package/show/network/frr?expand=0&rev=69
68 lines
2.5 KiB
Diff
68 lines
2.5 KiB
Diff
From 298704f1e73221172432e2a4afd79086ffcd4cca Mon Sep 17 00:00:00 2001
|
|
From: Olivier Dugeon <olivier.dugeon@orange.com>
|
|
Date: Wed, 3 Apr 2024 16:28:23 +0200
|
|
Upstream: yes
|
|
References: CVE-2024-31950,bsc#1222526,gh#FRRouting/frr#16088
|
|
Subject: [PATCH 1/3] ospfd: Solved crash in RI parsing with OSPF TE
|
|
|
|
Iggy Frankovic discovered another ospfd crash when performing fuzzing of OSPF
|
|
LSA packets. The crash occurs in ospf_te_parse_ri() function when attemping to
|
|
read Segment Routing subTLVs. The original code doesn't check if the size of
|
|
the SR subTLVs have the correct length. In presence of erronous LSA, this will
|
|
cause a buffer overflow and ospfd crash.
|
|
|
|
This patch introduces new verification of the subTLVs size for Router
|
|
Information TLV.
|
|
|
|
Co-authored-by: Iggy Frankovic <iggyfran@amazon.com>
|
|
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
|
|
(cherry picked from commit f69d1313b19047d3d83fc2b36a518355b861dfc4)
|
|
---
|
|
ospfd/ospf_te.c | 9 +++++++++
|
|
1 file changed, 9 insertions(+)
|
|
|
|
diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c
|
|
index 45eb205759..885b915585 100644
|
|
--- a/ospfd/ospf_te.c
|
|
+++ b/ospfd/ospf_te.c
|
|
@@ -2483,6 +2483,9 @@ static int ospf_te_parse_ri(struct ls_ted *ted, struct ospf_lsa *lsa)
|
|
|
|
switch (ntohs(tlvh->type)) {
|
|
case RI_SR_TLV_SR_ALGORITHM:
|
|
+ if (TLV_BODY_SIZE(tlvh) < 1 ||
|
|
+ TLV_BODY_SIZE(tlvh) > ALGORITHM_COUNT)
|
|
+ break;
|
|
algo = (struct ri_sr_tlv_sr_algorithm *)tlvh;
|
|
|
|
for (int i = 0; i < ntohs(algo->header.length); i++) {
|
|
@@ -2507,6 +2510,8 @@ static int ospf_te_parse_ri(struct ls_ted *ted, struct ospf_lsa *lsa)
|
|
break;
|
|
|
|
case RI_SR_TLV_SRGB_LABEL_RANGE:
|
|
+ if (TLV_BODY_SIZE(tlvh) != RI_SR_TLV_LABEL_RANGE_SIZE)
|
|
+ break;
|
|
range = (struct ri_sr_tlv_sid_label_range *)tlvh;
|
|
size = GET_RANGE_SIZE(ntohl(range->size));
|
|
lower = GET_LABEL(ntohl(range->lower.value));
|
|
@@ -2524,6 +2529,8 @@ static int ospf_te_parse_ri(struct ls_ted *ted, struct ospf_lsa *lsa)
|
|
break;
|
|
|
|
case RI_SR_TLV_SRLB_LABEL_RANGE:
|
|
+ if (TLV_BODY_SIZE(tlvh) != RI_SR_TLV_LABEL_RANGE_SIZE)
|
|
+ break;
|
|
range = (struct ri_sr_tlv_sid_label_range *)tlvh;
|
|
size = GET_RANGE_SIZE(ntohl(range->size));
|
|
lower = GET_LABEL(ntohl(range->lower.value));
|
|
@@ -2541,6 +2548,8 @@ static int ospf_te_parse_ri(struct ls_ted *ted, struct ospf_lsa *lsa)
|
|
break;
|
|
|
|
case RI_SR_TLV_NODE_MSD:
|
|
+ if (TLV_BODY_SIZE(tlvh) < RI_SR_TLV_NODE_MSD_SIZE)
|
|
+ break;
|
|
msd = (struct ri_sr_tlv_node_msd *)tlvh;
|
|
if ((CHECK_FLAG(node->flags, LS_NODE_MSD))
|
|
&& (node->msd == msd->value))
|
|
--
|
|
2.35.3
|
|
|