From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 7FB9B982A5 for ; Thu, 13 Apr 2023 13:48:42 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 55DA61AD5C for ; Thu, 13 Apr 2023 13:48:12 +0200 (CEST) Received: from bastionodiso.odiso.net (bastionodiso.odiso.net [IPv6:2a0a:1580:2000::2d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Thu, 13 Apr 2023 13:48:11 +0200 (CEST) Received: from kvmformation3.odiso.net (formationkvm3.odiso.net [10.3.94.12]) by bastionodiso.odiso.net (Postfix) with ESMTP id 717BD8178; Thu, 13 Apr 2023 13:48:04 +0200 (CEST) Received: by kvmformation3.odiso.net (Postfix, from userid 0) id 5D16929DDF6; Thu, 13 Apr 2023 13:48:04 +0200 (CEST) From: Alexandre Derumier To: pve-devel@lists.proxmox.com Date: Thu, 13 Apr 2023 13:48:03 +0200 Message-Id: <20230413114803.2435497-1-aderumier@odiso.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.024 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy HEADER_FROM_DIFFERENT_DOMAINS 0.249 From and EnvelopeFrom 2nd level mail domains are different KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Subject: [pve-devel] [PATCH frr] fix #4040 : patch : ospf6d: fix infinite loop when adding ASBR route X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2023 11:48:42 -0000 --- .../frr/ospf6d-fix-infinite-loop.patch | 76 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 77 insertions(+) create mode 100644 debian/patches/frr/ospf6d-fix-infinite-loop.patch diff --git a/debian/patches/frr/ospf6d-fix-infinite-loop.patch b/debian/patches/frr/ospf6d-fix-infinite-loop.patch new file mode 100644 index 0000000..3af86cd --- /dev/null +++ b/debian/patches/frr/ospf6d-fix-infinite-loop.patch @@ -0,0 +1,76 @@ +From 4dfe15200ab1a84a8d77fcbc33085c373d556eae Mon Sep 17 00:00:00 2001 +From: Renato Westphal +Date: Wed, 23 Nov 2022 22:14:51 -0300 +Subject: [PATCH] ospf6d: fix infinite loop when adding ASBR route + +Commit 8f359e1593c414322 removed a check that prevented the same route +from being added twice. In certain topologies, that change resulted in +the following infinite loop when adding an ASBR route: + +ospf6_route_add + ospf6_top_brouter_hook_add + ospf6_abr_examin_brouter + ospf6_abr_examin_summary + ospf6_route_add + (repeat until stack overflow) + +Revert the offending commit and update `ospf6_route_is_identical()` to +not do comparison using `memcmp()`. + +Signed-off-by: Renato Westphal +--- + ospf6d/ospf6_route.c | 21 +++++++++++++++++++++ + ospf6d/ospf6_route.h | 8 ++++++++ + 2 files changed, 29 insertions(+) + +diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c +index db94b85b1b5..1cc1fcb47b3 100644 +--- a/ospf6d/ospf6_route.c ++++ b/ospf6d/ospf6_route.c +@@ -702,6 +702,27 @@ struct ospf6_route *ospf6_route_add(struct ospf6_route *route, + } + + if (old) { ++ /* if route does not actually change, return unchanged */ ++ if (ospf6_route_is_identical(old, route)) { ++ if (IS_OSPF6_DEBUG_ROUTE(MEMORY)) ++ zlog_debug( ++ "%s %p: route add %p: needless update of %p old cost %u", ++ ospf6_route_table_name(table), ++ (void *)table, (void *)route, ++ (void *)old, old->path.cost); ++ else if (IS_OSPF6_DEBUG_ROUTE(TABLE)) ++ zlog_debug("%s: route add: needless update", ++ ospf6_route_table_name(table)); ++ ++ ospf6_route_delete(route); ++ SET_FLAG(old->flag, OSPF6_ROUTE_ADD); ++ ospf6_route_table_assert(table); ++ ++ /* to free the lookup lock */ ++ route_unlock_node(node); ++ return old; ++ } ++ + if (IS_OSPF6_DEBUG_ROUTE(MEMORY)) + zlog_debug( + "%s %p: route add %p cost %u paths %u nh %u: update of %p cost %u paths %u nh %u", +diff --git a/ospf6d/ospf6_route.h b/ospf6d/ospf6_route.h +index bb5827a1766..c8411c015f8 100644 +--- a/ospf6d/ospf6_route.h ++++ b/ospf6d/ospf6_route.h +@@ -297,6 +297,14 @@ extern const char *const ospf6_path_type_substr[OSPF6_PATH_TYPE_MAX]; + && (ra)->path.origin.type == (rb)->path.origin.type \ + && (ra)->path.origin.id == (rb)->path.origin.id \ + && (ra)->path.origin.adv_router == (rb)->path.origin.adv_router) ++#define ospf6_route_is_identical(ra, rb) \ ++ ((ra)->type == (rb)->type && \ ++ prefix_same(&(ra)->prefix, &(rb)->prefix) && \ ++ (ra)->path.type == (rb)->path.type && \ ++ (ra)->path.cost == (rb)->path.cost && \ ++ (ra)->path.u.cost_e2 == (rb)->path.u.cost_e2 && \ ++ listcount(ra->paths) == listcount(rb->paths) && \ ++ ospf6_route_cmp_nexthops(ra, rb) == 0) + + #define ospf6_route_is_best(r) (CHECK_FLAG ((r)->flag, OSPF6_ROUTE_BEST)) + diff --git a/debian/patches/series b/debian/patches/series index c3b3fc0..b24c177 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,3 +3,4 @@ pve/0002-bgpd-add-an-option-for-RT-auto-derivation-to-force-A.patch frr/0001-zebra-buffering.patch frr/0002-zebra-buffering.patch frr/0003-zebra-buffering.patch +frr/ospf6d-fix-infinite-loop.patch \ No newline at end of file -- 2.30.2