Compare commits

1 Commits
main ... 1.1

5 changed files with 64 additions and 39 deletions

View File

@@ -0,0 +1,51 @@
From 605485a7c470f6e49c3f5712f2c4692fea3019e7 Mon Sep 17 00:00:00 2001
From: Donatas Abraitis <donatas@opensourcerouting.org>
Date: Wed, 31 Jul 2024 08:35:14 +0300
Subject: [PATCH] bgpd: Check the actual remaining stream length before taking
TLV value
Upstream: yes
References: CVE-2024-44070,bsc#1229438,gh#FRRouting/frr#16502
```
0 0xb50b9f898028 in __sanitizer_print_stack_trace (/home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/.libs/bgpd+0x368028) (BuildId: 3292703ed7958b20076550c967f879db8dc27ca7)
1 0xb50b9f7ed8e4 in fuzzer::PrintStackTrace() (/home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/.libs/bgpd+0x2bd8e4) (BuildId: 3292703ed7958b20076550c967f879db8dc27ca7)
2 0xb50b9f7d4d9c in fuzzer::Fuzzer::CrashCallback() (/home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/.libs/bgpd+0x2a4d9c) (BuildId: 3292703ed7958b20076550c967f879db8dc27ca7)
3 0xe0d12d7469cc (linux-vdso.so.1+0x9cc) (BuildId: 1a77697e9d723fe22246cfd7641b140c427b7e11)
4 0xe0d12c88f1fc in __pthread_kill_implementation nptl/pthread_kill.c:43:17
5 0xe0d12c84a678 in gsignal signal/../sysdeps/posix/raise.c:26:13
6 0xe0d12c83712c in abort stdlib/abort.c:79:7
7 0xe0d12d214724 in _zlog_assert_failed /home/ubuntu/frr-public/frr_public_private-libfuzzer/lib/zlog.c:789:2
8 0xe0d12d1285e4 in stream_get /home/ubuntu/frr-public/frr_public_private-libfuzzer/lib/stream.c:324:3
9 0xb50b9f8e47c4 in bgp_attr_encap /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_attr.c:2758:3
10 0xb50b9f8dcd38 in bgp_attr_parse /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_attr.c:3783:10
11 0xb50b9faf74b4 in bgp_update_receive /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_packet.c:2383:20
12 0xb50b9faf1dcc in bgp_process_packet /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_packet.c:4075:11
13 0xb50b9f8c90d0 in LLVMFuzzerTestOneInput /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_main.c:582:3
```
Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 0998b38e4d61179441f90dd7e7fd6a3a8b7bd8c5)
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index 40e074d058..4ebb45e3de 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -2727,6 +2727,14 @@ static int bgp_attr_encap(struct bgp_attr_parser_args *args)
args->total);
}
+ if (STREAM_READABLE(BGP_INPUT(peer)) < sublength) {
+ zlog_err("Tunnel Encap attribute sub-tlv length %d exceeds remaining stream length %zu",
+ sublength, STREAM_READABLE(BGP_INPUT(peer)));
+ return bgp_attr_malformed(args,
+ BGP_NOTIFY_UPDATE_OPT_ATTR_ERR,
+ args->total);
+ }
+
/* alloc and copy sub-tlv */
/* TBD make sure these are freed when attributes are released */
tlv = XCALLOC(MTYPE_ENCAP_TLV,
--
2.43.0

BIN
frr-10.0.1.tar.gz LFS Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -1,26 +1,3 @@
-------------------------------------------------------------------
Thu Jan 9 11:04:40 UTC 2025 - Marius Tomaschewski <mt@suse.com>
- Update to frr 10.2.1 release providing fix for a Denial of Service
scenario due to RIB revalidation (CVE-2024-55553,bsc#1235237) and
other fixes, see https://frrouting.org/release/10.2.1/
The 10.2 version provides new features and many enhancements, see
https://frrouting.org/release/10.2/
- Add new fpm_listener daemon binary to rpm file lists.
- Remove --localstatedir configure parameter causing to use /run/lib
instead of /var/lib prefix for the northbound databases and added
the /var/lib/frr directory to the rpm file list.
- Adjust to set permissions in rpm attr macros (rpmlint suggestion)
and use frr_group instead of frr_user in group parameter.
-------------------------------------------------------------------
Mon Sep 30 09:49:59 UTC 2024 - Marius Tomaschewski <mt@suse.com>
- Update to frr 10.0.2 release providing fix for CVE-2024-44070
and other issues, see https://frrouting.org/release/10.0.2/
- Removed patch included in the sources:
[- 0002-bgpd-Check-the-actual-remaining-stream-length-before.patch]
-------------------------------------------------------------------
Mon Sep 16 16:36:31 UTC 2024 - Marius Tomaschewski <mt@suse.com>

View File

@@ -25,14 +25,12 @@
%define frr_user frr
%define frr_group frr
%define frrvty_group frrvty
# see configure: frr_libstatedir=/var/lib/frr
%define frr_home %{_localstatedir}/lib/%{name}
# see configure: frr_runstatedir=[/var]/run/frr
%define frr_statedir %{_rundir}/%{name}
%define frr_daemondir %{_prefix}/lib/frr
Name: frr
Version: 10.2.1
Version: 10.0.1
Release: 0
Summary: The FRRouting Protocol Suite
License: GPL-2.0-or-later AND LGPL-2.1-or-later
@@ -43,6 +41,7 @@ Source: https://github.com/FRRouting/frr/archive/refs/tags/%{name}-%{ver
Source1: %{name}-tmpfiles.d
Patch0: harden_frr.service.patch
Patch1: 0001-disable-zmq-test.patch
Patch2: 0002-bgpd-Check-the-actual-remaining-stream-length-before.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: bison >= 2.7
@@ -209,6 +208,7 @@ autoreconf -fiv
%configure \
--disable-silent-rules \
--sysconfdir=%{_sysconfdir}\
--localstatedir=%{_rundir} \
--sbindir=%{frr_daemondir} \
--with-moduledir=%{_libdir}/frr/modules \
--disable-static \
@@ -299,8 +299,7 @@ install -D -m 0644 redhat/frr.logrotate %{buildroot}%{_distconfdir}/logrotate.d/
install -D -m 0644 redhat/frr.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/frr
%endif
install -d -m 0750 %{buildroot}%{frr_home}
install -d -m 0751 %{buildroot}%{frr_statedir}
install -d -m 0750 %{buildroot}%{rundir}
install -d -m 0750 %{buildroot}%{_localstatedir}/log/frr
install -D -m 0644 %{SOURCE1} %{buildroot}/%{_tmpfilesdir}/%{name}.conf
sed -e "s|@frr_statedir@|%{frr_statedir}|g" -i %{buildroot}/%{_tmpfilesdir}/%{name}.conf
@@ -389,10 +388,10 @@ done
%license COPYING
%doc README.md
%doc doc/mpls
%dir %attr(0750,%{frr_user},%{frr_group}) %{_sysconfdir}/%{name}
%config(noreplace) %attr(0640,%{frr_user},%{frr_group}) %{_sysconfdir}/%{name}/[!v]*.conf*
%config(noreplace) %attr(0640,%{frr_user},%{frrvty_group}) %{_sysconfdir}/%{name}/vtysh.conf
%config(noreplace) %attr(0640,%{frr_user},%{frr_group}) %{_sysconfdir}/%{name}/daemons
%dir %attr(750,%{frr_user},%{frr_user}) %{_sysconfdir}/%{name}
%config(noreplace) %attr(640,%{frr_user},%{frr_group}) %{_sysconfdir}/%{name}/[!v]*.conf*
%config(noreplace) %attr(640,%{frr_user},%{frrvty_group}) %{_sysconfdir}/%{name}/vtysh.conf
%config(noreplace) %%attr(640,%{frr_user},%{frr_group}) %{_sysconfdir}/%{name}/daemons
%if 0%{?suse_version} > 1500
%{_pam_vendordir}/frr
%else
@@ -409,10 +408,9 @@ done
%{_unitdir}/%{name}.service
%dir %{_tmpfilesdir}
%{_tmpfilesdir}/%{name}.conf
%dir %attr(0750,%{frr_user},%{frr_group}) %{_localstatedir}/log/frr
%dir %attr(0751,%{frr_user},%{frr_group}) %ghost %{frr_statedir}
%dir %attr(-,%{frr_user},%{frr_group}) %{_localstatedir}/log/frr
%dir %attr(-,%{frr_user},%{frr_group}) %ghost %{frr_statedir}
%{_sbindir}/rc%{name}
%dir %attr(0750,%{frr_user},%{frr_group}) %{frr_home}
%dir %{_prefix}/lib/frr
%{_prefix}/lib/frr/fabricd
%{_prefix}/lib/frr/vrrpd
@@ -447,7 +445,6 @@ done
%{frr_daemondir}/watchfrr
%{frr_daemondir}/watchfrr.sh
%{frr_daemondir}/zebra
%{frr_daemondir}/fpm_listener
%dir %{_libdir}/frr
%dir %{_libdir}/frr/modules
%{_libdir}/frr/modules/zebra_cumulus_mlag.so