Skip to content

Commit 52e54ef

Browse files
CBL-Mariner-BotbfjeldsPawelWMS
authored
[AUTO-CHERRYPICK] frr: CVE-2024-44070 (mariner 2) - branch main (#10235)
Co-authored-by: bfjelds <[email protected]> Co-authored-by: Pawel Winogrodzki <[email protected]>
1 parent 959bf5a commit 52e54ef

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed

SPECS/frr/CVE-2024-44070.patch

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
From 0998b38e4d61179441f90dd7e7fd6a3a8b7bd8c5 Mon Sep 17 00:00:00 2001
2+
From: Donatas Abraitis <[email protected]>
3+
Date: Wed, 31 Jul 2024 08:35:14 +0300
4+
Subject: [PATCH] bgpd: Check the actual remaining stream length before taking
5+
TLV value
6+
7+
```
8+
0 0xb50b9f898028 in __sanitizer_print_stack_trace (/home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/.libs/bgpd+0x368028) (BuildId: 3292703ed7958b20076550c967f879db8dc27ca7)
9+
1 0xb50b9f7ed8e4 in fuzzer::PrintStackTrace() (/home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/.libs/bgpd+0x2bd8e4) (BuildId: 3292703ed7958b20076550c967f879db8dc27ca7)
10+
2 0xb50b9f7d4d9c in fuzzer::Fuzzer::CrashCallback() (/home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/.libs/bgpd+0x2a4d9c) (BuildId: 3292703ed7958b20076550c967f879db8dc27ca7)
11+
3 0xe0d12d7469cc (linux-vdso.so.1+0x9cc) (BuildId: 1a77697e9d723fe22246cfd7641b140c427b7e11)
12+
4 0xe0d12c88f1fc in __pthread_kill_implementation nptl/pthread_kill.c:43:17
13+
5 0xe0d12c84a678 in gsignal signal/../sysdeps/posix/raise.c:26:13
14+
6 0xe0d12c83712c in abort stdlib/abort.c:79:7
15+
7 0xe0d12d214724 in _zlog_assert_failed /home/ubuntu/frr-public/frr_public_private-libfuzzer/lib/zlog.c:789:2
16+
8 0xe0d12d1285e4 in stream_get /home/ubuntu/frr-public/frr_public_private-libfuzzer/lib/stream.c:324:3
17+
9 0xb50b9f8e47c4 in bgp_attr_encap /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_attr.c:2758:3
18+
10 0xb50b9f8dcd38 in bgp_attr_parse /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_attr.c:3783:10
19+
11 0xb50b9faf74b4 in bgp_update_receive /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_packet.c:2383:20
20+
12 0xb50b9faf1dcc in bgp_process_packet /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_packet.c:4075:11
21+
13 0xb50b9f8c90d0 in LLVMFuzzerTestOneInput /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_main.c:582:3
22+
```
23+
24+
Reported-by: Iggy Frankovic <[email protected]>
25+
Signed-off-by: Donatas Abraitis <[email protected]>
26+
---
27+
bgpd/bgp_attr.c | 8 ++++++++
28+
1 file changed, 8 insertions(+)
29+
30+
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
31+
index 2ed49935e52b..ac5d08b6fe6e 100644
32+
--- a/bgpd/bgp_attr.c
33+
+++ b/bgpd/bgp_attr.c
34+
@@ -2749,6 +2749,14 @@ static int bgp_attr_encap(struct bgp_attr_parser_args *args)
35+
args->total);
36+
}
37+
38+
+ if (STREAM_READABLE(BGP_INPUT(peer)) < sublength) {
39+
+ zlog_err("Tunnel Encap attribute sub-tlv length %d exceeds remaining stream length %zu",
40+
+ sublength, STREAM_READABLE(BGP_INPUT(peer)));
41+
+ return bgp_attr_malformed(args,
42+
+ BGP_NOTIFY_UPDATE_OPT_ATTR_ERR,
43+
+ args->total);
44+
+ }
45+
+
46+
/* alloc and copy sub-tlv */
47+
/* TBD make sure these are freed when attributes are released */
48+
tlv = XCALLOC(MTYPE_ENCAP_TLV,

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: 8.5.5
6-
Release: 1%{?dist}
6+
Release: 2%{?dist}
77
License: GPL-2.0-or-later
88
Vendor: Microsoft Corporation
99
Distribution: Mariner
@@ -16,6 +16,7 @@ Patch1: 0001-enable-openssl.patch
1616
Patch2: 0002-disable-eigrp-crypto.patch
1717
Patch3: 0003-fips-mode.patch
1818
Patch4: 0004-remove-grpc-test.patch
19+
Patch5: CVE-2024-44070.patch
1920
BuildRequires: autoconf
2021
BuildRequires: automake
2122
BuildRequires: bison
@@ -197,6 +198,9 @@ rm tests/lib/*grpc*
197198
%{_sysusersdir}/%{name}.conf
198199

199200
%changelog
201+
* Wed Aug 21 2024 Brian Fjeldstad <[email protected]> - 8.5.5-2
202+
- Patch CVE-2024-44070
203+
200204
* Tue Aug 06 2024 Sumedh Sharma <[email protected]> - 8.5.5-1
201205
- Bump version to fix CVE-2024-31950 & CVE-2024-31951
202206
- Remove patches present in sources

0 commit comments

Comments
 (0)