Skip to content

Commit 9de16cd

Browse files
[AutoPR- Security] Patch frr for CVE-2026-5107 [LOW] (#16380)
1 parent 89fa17e commit 9de16cd

2 files changed

Lines changed: 108 additions & 1 deletion

File tree

SPECS/frr/CVE-2026-5107.patch

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
From f708d9a5e33c8bcb17c266e8917c90dd2f84b0f9 Mon Sep 17 00:00:00 2001
2+
From: Mark Stapp <mjs@cisco.com>
3+
Date: Wed, 11 Mar 2026 14:52:54 -0400
4+
Subject: [PATCH] bgpd: improve packet parsing for EVPN and ENCAP/VNC
5+
6+
Improve packet validation for EVPN NLRIs and for ENCAP/VNC.
7+
8+
Signed-off-by: Mark Stapp <mjs@cisco.com>
9+
(cherry picked from commit 7676cad65114aa23adde583d91d9d29e2debd045)
10+
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
11+
Upstream-reference: https://github.com/FRRouting/frr/commit/52c72c5ad8ccb491a9bab096002072667089d2d3.patch
12+
---
13+
bgpd/bgp_evpn.c | 17 +++++++++++++++++
14+
bgpd/bgp_evpn_mh.c | 10 +++++++++-
15+
bgpd/rfapi/rfapi_rib.c | 9 +++++++++
16+
3 files changed, 35 insertions(+), 1 deletion(-)
17+
18+
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c
19+
index e33a30b..d061908 100644
20+
--- a/bgpd/bgp_evpn.c
21+
+++ b/bgpd/bgp_evpn.c
22+
@@ -4917,6 +4917,14 @@ static int process_type2_route(struct peer *peer, afi_t afi, safi_t safi,
23+
goto fail;
24+
}
25+
26+
+ /* Validate ipaddr_len against the NLRI length */
27+
+ if ((psize != 33 + (ipaddr_len / 8)) && (psize != 36 + (ipaddr_len / 8))) {
28+
+ flog_err(EC_BGP_EVPN_ROUTE_INVALID,
29+
+ "%u:%s - Rx EVPN Type-2 NLRI with invalid IP address length %d",
30+
+ peer->bgp->vrf_id, peer->host, ipaddr_len);
31+
+ goto fail;
32+
+ }
33+
+
34+
if (ipaddr_len) {
35+
ipaddr_len /= 8; /* Convert to bytes. */
36+
p.prefix.macip_addr.ip.ipa_type = (ipaddr_len == IPV4_MAX_BYTELEN)
37+
@@ -5014,6 +5022,15 @@ static int process_type3_route(struct peer *peer, afi_t afi, safi_t safi,
38+
39+
/* Get the IP. */
40+
ipaddr_len = *pfx++;
41+
+
42+
+ /* Validate */
43+
+ if (psize != 13 + (ipaddr_len / 8)) {
44+
+ flog_err(EC_BGP_EVPN_ROUTE_INVALID,
45+
+ "%u:%s - Rx EVPN Type-3 NLRI with invalid IP address length %d",
46+
+ peer->bgp->vrf_id, peer->host, ipaddr_len);
47+
+ return -1;
48+
+ }
49+
+
50+
if (ipaddr_len == IPV4_MAX_BITLEN) {
51+
p.prefix.imet_addr.ip.ipa_type = IPADDR_V4;
52+
memcpy(&p.prefix.imet_addr.ip.ip.addr, pfx, IPV4_MAX_BYTELEN);
53+
diff --git a/bgpd/bgp_evpn_mh.c b/bgpd/bgp_evpn_mh.c
54+
index 1ce5ef2..5905349 100644
55+
--- a/bgpd/bgp_evpn_mh.c
56+
+++ b/bgpd/bgp_evpn_mh.c
57+
@@ -752,9 +752,17 @@ int bgp_evpn_type4_route_process(struct peer *peer, afi_t afi, safi_t safi,
58+
memcpy(&esi, pfx, ESI_BYTES);
59+
pfx += ESI_BYTES;
60+
61+
-
62+
/* Get the IP. */
63+
ipaddr_len = *pfx++;
64+
+
65+
+ /* Validate */
66+
+ if (psize != 19 + (ipaddr_len / 8)) {
67+
+ flog_err(EC_BGP_EVPN_ROUTE_INVALID,
68+
+ "%u:%s - Rx EVPN Type-4 NLRI with invalid IP address length %d",
69+
+ peer->bgp->vrf_id, peer->host, ipaddr_len);
70+
+ return -1;
71+
+ }
72+
+
73+
if (ipaddr_len == IPV4_MAX_BITLEN) {
74+
memcpy(&vtep_ip, pfx, IPV4_MAX_BYTELEN);
75+
} else {
76+
diff --git a/bgpd/rfapi/rfapi_rib.c b/bgpd/rfapi/rfapi_rib.c
77+
index 9a3d56b..11384b5 100644
78+
--- a/bgpd/rfapi/rfapi_rib.c
79+
+++ b/bgpd/rfapi/rfapi_rib.c
80+
@@ -668,11 +668,20 @@ static void rfapiRibBi2Ri(struct bgp_path_info *bpi, struct rfapi_info *ri,
81+
break;
82+
83+
case BGP_VNC_SUBTLV_TYPE_RFPOPTION:
84+
+ /* Check for short subtlv: drop */
85+
+ if (pEncap->length < 3)
86+
+ break;
87+
+
88+
+ /* Length of zero not valid */
89+
+ if (pEncap->value[1] == 0)
90+
+ break;
91+
+
92+
hop = XCALLOC(MTYPE_BGP_TEA_OPTIONS,
93+
sizeof(struct bgp_tea_options));
94+
assert(hop);
95+
hop->type = pEncap->value[0];
96+
hop->length = pEncap->value[1];
97+
+
98+
hop->value = XCALLOC(MTYPE_BGP_TEA_OPTIONS_VALUE,
99+
pEncap->length - 2);
100+
assert(hop->value);
101+
--
102+
2.45.4
103+

SPECS/frr/frr.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Summary: Routing daemon
44
Name: frr
55
Version: 10.5.0
6-
Release: 1%{?dist}
6+
Release: 2%{?dist}
77
License: GPL-2.0-or-later
88
Vendor: Microsoft Corporation
99
Distribution: Azure Linux
@@ -20,6 +20,7 @@ Patch5: 0001-Fix-frr-c90-complaint-error.patch
2020
# Following CVE-2025-61099 fixes CVE-2025-61100, CVE-2025-61101, CVE-2025-61102,
2121
# CVE-2025-61103, CVE-2025-61104, CVE-2025-61105, CVE-2025-61106 and CVE-2025-61107.
2222
Patch6: CVE-2025-61099.patch
23+
Patch7: CVE-2026-5107.patch
2324
BuildRequires: autoconf
2425
BuildRequires: automake
2526
BuildRequires: bison
@@ -199,6 +200,9 @@ rm tests/lib/*grpc*
199200
%{_sysusersdir}/%{name}.conf
200201

201202
%changelog
203+
* Tue Mar 31 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 10.5.0-2
204+
- Patch for CVE-2026-5107
205+
202206
* Tue Feb 17 2026 Sudipta Pandit <sudpandit@microsoft.com> - 10.5.0-1
203207
- Upgrade to version 10.5.0
204208
- Remove CVE-2024-44070.patch (fixed upstream in 10.5.0)

0 commit comments

Comments
 (0)