~cdwertmann/cumulus-frr/+git/trunk:stable/8.5

Last commit made on 2024-04-29
Get this branch:
git clone -b stable/8.5 https://git.launchpad.net/~cdwertmann/cumulus-frr/+git/trunk

Branch merges

Branch information

Name:
stable/8.5
Repository:
lp:~cdwertmann/cumulus-frr/+git/trunk

Recent commits

37c40eb... by Donald Sharp <email address hidden>

Merge pull request #15859 from FRRouting/mergify/bp/stable/8.5/pr-15848

pimd: fix crash unconfiguring rp keepalive timer (backport #15848)

758ea0f... by Vijayalaxmi Basavaraj <email address hidden>

pimd: fix crash unconfiguring rp keepalive timer

pimd crashs while unconfigure of rp ka timer as we are trying to access
a yand dnode(suppress timer) which does not exist at the moment.

User just configured rp keepalive timer and not suppress timer,
the yang dnode would not be present. Instead of directly accessing
yang_dnode_get_unit16, first check the yang node exist using
the xpath.

Ticket: #3874971

Testing:

Before:
------
tor-11(config)# no ip pim rp keep-alive-timer 3000
vtysh: error reading from pimd: Success (0)Warning: closing connection to pimd because of an I/O error!

Broadcast message from root@tor-11 (somewhere) (Mon Apr 22 17:29:12 2024):

cumulus-core: Running cl-support for core files "pimd.25467.1713806952.core"

After:
-----
tor-11(config)# no ip pim rp keep-alive-timer 3000
tor-11(config)#

Signed-off-by: Donald Sharp <email address hidden>
Signed-off-by: Vijayalaxmi Basavaraj <email address hidden>
(cherry picked from commit 0c4b7c1f1f359c1d7647fea34f62378af8b640a5)

eee0c9b... by Donald Sharp <email address hidden>

Merge pull request #15418 from opensourcerouting/fix/backport_ee1c3c5518b1fb5b3989b80f8bd71ad2c2bc049a_8.5

lib: Do not convert EVPN prefixes into IPv4/IPv6 if not needed

46f1081... by Donald Sharp <email address hidden>

Merge pull request #15823 from FRRouting/mergify/bp/stable/8.5/pr-15815

lib, zebra: Check for not being a blackhole route (backport #15815)

4cb6f69... by Donald Sharp <email address hidden>

lib, zebra: Check for not being a blackhole route

In zebra_interface_nhg_reinstall zebra is checking that the
nhg is a singleton and not a blackhole nhg. This was originally
done with checking that the nexthop is a NEXTHOP_TYPE_IFINDEX,
NEXTHOP_TYPE_IPV4_IFINDEX and NEXTHOP_TYPE_IPV6_IFINDEX. This
was excluding NEXTHOP_TYPE_IPV4 and NEXTHOP_TYPE_IPV6. These
were both possible to be received and maintained from the upper
level protocol for when a route is being recursively resolved.
If we have gotten to this point in zebra_interface_nhg_reinstall
the nexthop group has already been installed at least once
and we *know* that it is actually a valid nexthop. What the
test is really trying to do is ensure that we are not reinstalling
a blackhole nexthop group( Which is not possible to even be
here by the way, but safety first! ). So let's change
to test for that instead.

Signed-off-by: Donald Sharp <email address hidden>
(cherry picked from commit 29c1ff446e581fc403d155fd1d00b7c944cba56a)

f7c48d4... by Donatas Abraitis <email address hidden>

Merge pull request #15659 from FRRouting/mergify/bp/stable/8.5/pr-15628

bgpd: Fix error handling when receiving BGP Prefix SID attribute (backport #15628)

9240abc... by Donatas Abraitis <email address hidden>

bgpd: Prevent from one more CVE triggering this place

If we receive an attribute that is handled by bgp_attr_malformed(), use
treat-as-withdraw behavior for unknown (or missing to add - if new) attributes.

Signed-off-by: Donatas Abraitis <email address hidden>
(cherry picked from commit babb23b74855e23c987a63f8256d24e28c044d07)

51679e4... by Donatas Abraitis <email address hidden>

bgpd: Fix error handling when receiving BGP Prefix SID attribute

Without this patch, we always set the BGP Prefix SID attribute flag without
checking if it's malformed or not. RFC8669 says that this attribute MUST be discarded.

Also, this fixes the bgpd crash when a malformed Prefix SID attribute is received,
with malformed transitive flags and/or TLVs.

Reported-by: Iggy Frankovic <email address hidden>
Signed-off-by: Donatas Abraitis <email address hidden>
(cherry picked from commit ba6a8f1a31e1a88df2de69ea46068e8bd9b97138)

e95f889... by Russ White <email address hidden>

Merge pull request #15568 from opensourcerouting/fix/backport_bgp_filter_fun_8.5

BGP memory backports

a363a81... by Donald Sharp <email address hidden>

bgpd: Ensure community data is freed in some cases.

Customer has this valgrind trace:

Direct leak of 2829120 byte(s) in 70728 object(s) allocated from:
  0 in community_new ../bgpd/bgp_community.c:39
  1 in community_uniq_sort ../bgpd/bgp_community.c:170
  2 in route_set_community ../bgpd/bgp_routemap.c:2342
  3 in route_map_apply_ext ../lib/routemap.c:2673
  4 in subgroup_announce_check ../bgpd/bgp_route.c:2367
  5 in subgroup_process_announce_selected ../bgpd/bgp_route.c:2914
  6 in group_announce_route_walkcb ../bgpd/bgp_updgrp_adv.c:199
  7 in hash_walk ../lib/hash.c:285
  8 in update_group_af_walk ../bgpd/bgp_updgrp.c:2061
  9 in group_announce_route ../bgpd/bgp_updgrp_adv.c:1059
 10 in bgp_process_main_one ../bgpd/bgp_route.c:3221
 11 in bgp_process_wq ../bgpd/bgp_route.c:3221
 12 in work_queue_run ../lib/workqueue.c:282

The above leak detected by valgrind was from a screenshot so I copied it
by hand. Any mistakes in line numbers are purely from my transcription.
Additionally this is against a slightly modified 8.5.1 version of FRR.
Code inspection of 8.5.1 -vs- latest master shows the same problem
exists. Code should be able to be followed from there to here.

What is happening:

There is a route-map being applied that modifes the outgoing community
to a peer. This is saved in the attr copy created in
subgroup_process_announce_selected. This community pointer is not
interned. So the community->refcount is still 0. Normally when
a prefix is announced, the attr and the prefix are placed on a
adjency out structure where the attribute is interned. This will
cause the community to be saved in the community hash list as well.
In a non-normal operation when the decision to send is aborted after
the route-map application, the attribute is just dropped and the
pointer to the community is just dropped too, leading to situations
where the memory is leaked. The usage of bgp suppress-fib would
would be a case where the community is caused to be leaked.
Additionally the previous commit where an unsuppress-map is used
to modify the outgoing attribute but since unsuppress-map was
not considered part of outgoing policy the attribute would be dropped as
well. This pointer drop also extends to any dynamically allocated
memory saved by the attribute pointer that was not interned yet as well.

So let's modify the return case where the decision is made to
not send the prefix to the peer to always just flush the attribute
to ensure memory is not leaked.

Fixes: #15459
Signed-off-by: Donald Sharp <email address hidden>