-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bgpd: Fix bgp core with a possible Intf delete (backport #17624) #17625
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Although trigger unknown, based on the backtrace in one of the internal testing, we do see some delete in the Intf where we can have the peer ifp pointer null and we try to dereference it while trying to install the route leading to a crash Skip updating the ifindex in such cases and since the nexthop is not properly updated, BGP skips sending it to zebra. BackTrace: 0 0x00007faef05e7ebc in ?? () from /lib/x86_64-linux-gnu/libc.so.6 1 0x00007faef0598fb2 in raise () from /lib/x86_64-linux-gnu/libc.so.6 2 0x00007faef09900dc in core_handler (signo=11, siginfo=0x7ffdde8cb4b0, context=<optimized out>) at lib/sigevent.c:274 3 <signal handler called> 4 0x00005560aad4b7d8 in update_ipv6nh_for_route_install (api_nh=0x7ffdde8cbe94, is_evpn=false, best_pi=0x5560b21187d0, pi=0x5560b21187d0, ifindex=0, nexthop=0x5560b03cb0dc, nh_bgp=0x5560ace04df0, nh_othervrf=0) at bgpd/bgp_zebra.c:1273 5 bgp_zebra_announce_actual (dest=dest@entry=0x5560afcfa950, info=0x5560b21187d0, bgp=0x5560ace04df0) at bgpd/bgp_zebra.c:1521 6 0x00005560aad4bc85 in bgp_handle_route_announcements_to_zebra (e=<optimized out>) at bgpd/bgp_zebra.c:1896 7 0x00007faef09a1c0d in thread_call (thread=thread@entry=0x7ffdde8d7580) at lib/thread.c:2008 8 0x00007faef095a598 in frr_run (master=0x5560ac7e5190) at lib/libfrr.c:1223 9 0x00005560aac65db6 in main (argc=<optimized out>, argv=<optimized out>) at bgpd/bgp_main.c:557 (gdb) f 4 4 0x00005560aad4b7d8 in update_ipv6nh_for_route_install (api_nh=0x7ffdde8cbe94, is_evpn=false, best_pi=0x5560b21187d0, pi=0x5560b21187d0, ifindex=0, nexthop=0x5560b03cb0dc, nh_bgp=0x5560ace04df0, nh_othervrf=0) at bgpd/bgp_zebra.c:1273 1273 in bgpd/bgp_zebra.c (gdb) p pi->peer->ifp $26 = (struct interface *) 0x0 Ticket :#4203904 Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com> (cherry picked from commit 9b0b928) # Conflicts: # bfdd/bfd.c # bfdd/bfd.h # bfdd/bfdd_cli.c # bgpd/bgp_aspath.c # bgpd/bgp_aspath.h # bgpd/bgp_attr.c # bgpd/bgp_attr.h # bgpd/bgp_bfd.c # bgpd/bgp_bmp.c # bgpd/bgp_bmp.h # bgpd/bgp_clist.c # bgpd/bgp_community_alias.c # bgpd/bgp_community_alias.h # bgpd/bgp_conditional_adv.c # bgpd/bgp_debug.c # bgpd/bgp_ecommunity.c # bgpd/bgp_ecommunity.h # bgpd/bgp_evpn.c # bgpd/bgp_fsm.c # bgpd/bgp_fsm.h # bgpd/bgp_io.c # bgpd/bgp_mplsvpn.c # bgpd/bgp_network.c # bgpd/bgp_network.h # bgpd/bgp_nexthop.c # bgpd/bgp_nexthop.h # bgpd/bgp_nht.c # bgpd/bgp_packet.c # bgpd/bgp_packet.h # bgpd/bgp_route.c # bgpd/bgp_route.h # bgpd/bgp_routemap.c # bgpd/bgp_routemap_nb.c # bgpd/bgp_routemap_nb.h # bgpd/bgp_routemap_nb_config.c # bgpd/bgp_updgrp.c # bgpd/bgp_updgrp_adv.c # bgpd/bgp_vty.c # bgpd/bgp_zebra.c # bgpd/bgpd.c # bgpd/bgpd.h # bgpd/rfapi/bgp_rfapi_cfg.c # bgpd/rfapi/rfapi.c # bgpd/rfapi/rfapi_vty.c # bgpd/rfapi/vnc_export_bgp.c # configure.ac # debian/changelog # debian/control # debian/rules # doc/developer/topotests.rst # doc/user/about.rst # doc/user/bfd.rst # doc/user/bgp.rst # doc/user/evpn.rst # doc/user/filter.rst # doc/user/ospfd.rst # doc/user/pim.rst # doc/user/pimv6.rst # doc/user/routemap.rst # doc/user/vrrp.rst # doc/user/zebra.rst # docker/ubuntu-ci/Dockerfile # fpm/fpm.h # isisd/isis_circuit.c # isisd/isis_lsp.c # isisd/isis_pdu.c # isisd/isis_route.h # isisd/isis_spf.c # isisd/isis_tlvs.c # isisd/isis_vty_fabricd.c # isisd/isisd.c # ldpd/ldpe.c # lib/command.h # lib/csv.c # lib/defun_lex.l # lib/event.c # lib/frrevent.h # lib/if.c # lib/if.h # lib/libfrr.c # lib/libospf.h # lib/log.c # lib/memory.c # lib/memory.h # lib/netns_linux.c # lib/nexthop.c # lib/nexthop.h # lib/ntop.c # lib/ptm_lib.c # lib/routemap.c # lib/routemap.h # lib/routemap_cli.c # lib/routemap_northbound.c # lib/sigevent.c # lib/sockunion.c # lib/sockunion.h # lib/table.c # lib/table.h # lib/wheel.c # lib/wheel.h # lib/zclient.c # lib/zclient.h # lib/zlog_5424_cli.c # nhrpd/nhrp_vty.c # ospf6d/ospf6_intra.c # ospfd/ospf_lsa.c # ospfd/ospf_lsa.h # ospfd/ospf_opaque.c # ospfd/ospf_sr.c # ospfd/ospf_vty.c # pimd/pim6_cmd.c # pimd/pim6_cmd.h # pimd/pim6_mld.c # pimd/pim_autorp.c # pimd/pim_autorp.h # pimd/pim_bsm.c # pimd/pim_bsm.h # pimd/pim_bsr_rpdb.c # pimd/pim_cmd.c # pimd/pim_cmd_common.c # pimd/pim_cmd_common.h # pimd/pim_iface.c # pimd/pim_iface.h # pimd/pim_ifchannel.c # pimd/pim_igmp.c # pimd/pim_igmpv2.c # pimd/pim_igmpv3.c # pimd/pim_instance.c # pimd/pim_instance.h # pimd/pim_join.c # pimd/pim_mroute.c # pimd/pim_msdp.c # pimd/pim_msdp.h # pimd/pim_msdp_packet.c # pimd/pim_msdp_socket.c # pimd/pim_nb.c # pimd/pim_nb.h # pimd/pim_nb_config.c # pimd/pim_rp.c # pimd/pim_rp.h # pimd/pim_tib.c # pimd/pim_util.c # pimd/pim_util.h # pimd/pim_vty.c # pimd/pim_zlookup.c # pimd/pimd.c # python/makefile.py # python/xref2vtysh.py # redhat/frr.spec.in # ripd/ripd.c # sharpd/sharp_vty.c # staticd/static_zebra.c # tests/helpers/c/prng.c # tests/isisd/test_fuzz_isis_tlv.c # tests/isisd/test_fuzz_isis_tlv_tests.h.gz # tests/isisd/test_isis_spf.c # tests/lib/cli/common_cli.c # tests/lib/northbound/test_oper_data.c # tests/lib/test_frrlua.c # tests/lib/test_frrscript.c # tests/lib/test_typelist.c # tests/lib/test_zmq.c # tests/topotests/Dockerfile # tests/topotests/all_protocol_startup/r1/show_route_map.ref # tests/topotests/all_protocol_startup/test_all_protocol_startup.py # tests/topotests/bfd_isis_topo1/rt1/step1/show_ipv6_route.ref # tests/topotests/bfd_isis_topo1/rt1/step3/show_ipv6_route_healthy.ref # tests/topotests/bfd_isis_topo1/rt1/step3/show_ipv6_route_rt2_down.ref # tests/topotests/bfd_isis_topo1/rt1/step3/show_ipv6_route_rt3_down.ref # tests/topotests/bfd_isis_topo1/rt1/zebra.conf # tests/topotests/bfd_isis_topo1/rt2/zebra.conf # tests/topotests/bfd_isis_topo1/rt3/zebra.conf # tests/topotests/bfd_isis_topo1/rt4/zebra.conf # tests/topotests/bfd_isis_topo1/rt5/zebra.conf # tests/topotests/bfd_ospf_topo1/rt1/step1/show_ipv6_route.ref # tests/topotests/bfd_ospf_topo1/rt1/step3/show_ipv6_route_healthy.ref # tests/topotests/bfd_ospf_topo1/rt1/step3/show_ipv6_route_rt2_down.ref # tests/topotests/bfd_ospf_topo1/rt1/step3/show_ipv6_route_rt3_down.ref # tests/topotests/bfd_ospf_topo1/rt1/zebra.conf # tests/topotests/bfd_ospf_topo1/rt2/zebra.conf # tests/topotests/bfd_ospf_topo1/rt3/zebra.conf # tests/topotests/bfd_ospf_topo1/rt4/zebra.conf # tests/topotests/bfd_ospf_topo1/rt5/zebra.conf # tests/topotests/bfd_profiles_topo1/r2/bgpd.conf # tests/topotests/bfd_profiles_topo1/r3/bgpd.conf # tests/topotests/bfd_profiles_topo1/r4/bgpd.conf # tests/topotests/bgp_aggregate_address_topo1/r1/bgpd.conf # tests/topotests/bgp_aggregate_address_topo1/r2/bgpd.conf # tests/topotests/bgp_aggregator_zero/r1/bgpd.conf # tests/topotests/bgp_aigp/r1/bgpd.conf # tests/topotests/bgp_aigp/r1/zebra.conf # tests/topotests/bgp_aigp/test_bgp_aigp.py # tests/topotests/bgp_as_override/test_bgp_as_override.py # tests/topotests/bgp_aspath_zero/r1/bgpd.conf # tests/topotests/bgp_color_extcommunities/r1/bgpd.conf # tests/topotests/bgp_color_extcommunities/test_bgp_color_extcommunities.py # tests/topotests/bgp_ecmp_topo1/r1/bgpd.conf # tests/topotests/bgp_evpn_rt5/r2/bgpd.conf # tests/topotests/bgp_evpn_rt5/test_bgp_evpn.py # tests/topotests/bgp_extended_link_bandwidth/r1/frr.conf # tests/topotests/bgp_extended_link_bandwidth/r2/frr.conf # tests/topotests/bgp_extended_link_bandwidth/test_bgp_extended_link_bandwidth.py # tests/topotests/bgp_flowspec/r1/bgpd.conf # tests/topotests/bgp_ipv4_over_ipv6/test_rfc5549_ebgp_unnumbered_nbr.py # tests/topotests/bgp_lu_topo1/R3/bgpd.conf # tests/topotests/bgp_lu_topo1/R3/zebra.conf # tests/topotests/bgp_lu_topo2/R3/bgpd.conf # tests/topotests/bgp_lu_topo2/R3/staticd.conf # tests/topotests/bgp_lu_topo2/R3/zebra.conf # tests/topotests/bgp_match_peer/r1/frr.conf # tests/topotests/bgp_match_peer/test_bgp_match_peer.py # tests/topotests/bgp_max_med_on_startup/r1/bgpd.conf # tests/topotests/bgp_max_med_on_startup/test_bgp_max_med_on_startup.py # tests/topotests/bgp_multiview_topo1/r1/bgpd.conf # tests/topotests/bgp_nexthop_ipv6/r1/bgpd.conf # tests/topotests/bgp_nexthop_ipv6/r1/show_bgp_ipv6_step1.json # tests/topotests/bgp_nexthop_ipv6/r2/bgpd.conf # tests/topotests/bgp_nexthop_ipv6/r2/show_bgp_ipv6_step1.json # tests/topotests/bgp_nexthop_ipv6/r4/bgpd.conf # tests/topotests/bgp_nexthop_ipv6/r4/show_bgp_ipv6_step2.json # tests/topotests/bgp_nexthop_ipv6/r5/bgpd.conf # tests/topotests/bgp_nexthop_ipv6/r5/show_bgp_ipv6_step1.json # tests/topotests/bgp_nexthop_ipv6/r5/show_bgp_ipv6_step2.json # tests/topotests/bgp_nexthop_ipv6/r6/bgpd.conf # tests/topotests/bgp_nexthop_ipv6/r6/show_bgp_ipv6_step1.json # tests/topotests/bgp_nexthop_ipv6/rr/bgpd.conf # tests/topotests/bgp_nexthop_ipv6/test_bgp_nexthop_ipv6_topo1.py # tests/topotests/bgp_path_attribute_discard/r1/frr.conf # tests/topotests/bgp_path_attribute_discard/r2/frr.conf # tests/topotests/bgp_peer_group/r1/frr.conf # tests/topotests/bgp_peer_group/test_bgp_peer-group.py # tests/topotests/bgp_peer_type_multipath_relax/r1/bgpd.conf # tests/topotests/bgp_peer_type_multipath_relax/r2/bgpd.conf # tests/topotests/bgp_prefix_sid/r1/bgpd.conf # tests/topotests/bgp_prefix_sid2/r1/bgpd.conf # tests/topotests/bgp_route_server_client/r1/bgpd.conf # tests/topotests/bgp_route_server_client/r2/bgpd.conf # tests/topotests/bgp_route_server_client/r3/bgpd.conf # tests/topotests/bgp_route_server_client/test_bgp_route_server_client.py # tests/topotests/bgp_rpki_topo1/r2/bgpd.conf # tests/topotests/bgp_snmp_mplsl3vpn/ce1/bgpd.conf # tests/topotests/bgp_snmp_mplsl3vpn/ce1/zebra.conf # tests/topotests/bgp_snmp_mplsl3vpn/ce2/bgpd.conf # tests/topotests/bgp_snmp_mplsl3vpn/ce2/zebra.conf # tests/topotests/bgp_snmp_mplsl3vpn/ce3/bgpd.conf # tests/topotests/bgp_snmp_mplsl3vpn/ce3/zebra.conf # tests/topotests/bgp_snmp_mplsl3vpn/ce4/bgpd.conf # tests/topotests/bgp_snmp_mplsl3vpn/ce4/zebra.conf # tests/topotests/bgp_snmp_mplsl3vpn/r1/bgpd.conf # tests/topotests/bgp_snmp_mplsl3vpn/r2/zebra.conf # tests/topotests/bgp_snmp_mplsl3vpn/r3/zebra.conf # tests/topotests/bgp_snmp_mplsl3vpn/r4/bgpd.conf # tests/topotests/bgp_snmp_mplsl3vpn/r4/zebra.conf # tests/topotests/bgp_vpnv4_asbr/test_bgp_vpnv4_asbr.py # tests/topotests/bgp_vpnv4_per_nexthop_label/test_bgp_vpnv4_per_nexthop_label.py # tests/topotests/bgp_vpnv6_per_nexthop_label/test_bgp_vpnv6_per_nexthop_label.py # tests/topotests/bgp_vrf_netns/r1/bgpd.conf # tests/topotests/conftest.py # tests/topotests/docker/README.md # tests/topotests/docker/build.sh # tests/topotests/docker/frr-topotests.sh # tests/topotests/docker/inner/compile_frr.sh # tests/topotests/docker/inner/entrypoint.sh # tests/topotests/isis_topo1/test_isis_topo1.py # tests/topotests/lib/bgp.py # tests/topotests/lib/bmp_collector/bgp/update/path_attributes.py # tests/topotests/lib/bmp_collector/bmp.py # tests/topotests/lib/pim.py # tests/topotests/lib/snmptest.py # tests/topotests/lib/topogen.py # tests/topotests/lib/topotest.py # tests/topotests/msdp_topo1/r1/pimd.conf # tests/topotests/msdp_topo1/test_msdp_topo1.py # tests/topotests/ospf_instance_redistribute/test_ospf_instance_redistribute.py # tests/topotests/ospf_metric_propagation/h1/frr.conf # tests/topotests/ospf_metric_propagation/h2/frr.conf # tests/topotests/ospf_metric_propagation/r1/frr.conf # tests/topotests/ospf_metric_propagation/r2/frr.conf # tests/topotests/ospf_metric_propagation/r3/frr.conf # tests/topotests/ospf_metric_propagation/r4/frr.conf # tests/topotests/ospf_metric_propagation/ra/frr.conf # tests/topotests/ospf_metric_propagation/rb/frr.conf # tests/topotests/ospf_metric_propagation/rc/frr.conf # tests/topotests/ospf_multi_vrf_bgp_route_leak/r1/frr.conf # tests/topotests/ospf_multi_vrf_bgp_route_leak/r2/frr.conf # tests/topotests/ospf_multi_vrf_bgp_route_leak/r3/frr.conf # tests/topotests/ospf_multi_vrf_bgp_route_leak/r4/frr.conf # tests/topotests/ospf_netns_vrf/r1/ospfd.conf # tests/topotests/ospf_netns_vrf/r1/zebra.conf # tests/topotests/ospf_netns_vrf/r2/ospfd.conf # tests/topotests/ospf_netns_vrf/r2/zebra.conf # tests/topotests/ospf_netns_vrf/r3/ospfd.conf # tests/topotests/ospf_netns_vrf/r3/zebra.conf # tests/topotests/ospf_p2mp/r1/frr-p2mp-non-broadcast.conf # tests/topotests/ospf_p2mp/r1/frr-p2mp.conf # tests/topotests/ospf_p2mp/r2/frr-p2mp-non-broadcast.conf # tests/topotests/ospf_p2mp/r2/frr-p2mp.conf # tests/topotests/ospf_p2mp/r3/frr-p2mp-non-broadcast.conf # tests/topotests/ospf_p2mp/r3/frr-p2mp.conf # tests/topotests/ospf_p2mp/r4/frr-p2mp-non-broadcast.conf # tests/topotests/ospf_p2mp/r4/frr-p2mp.conf # tests/topotests/ospf_prefix_suppression/r1/frr.conf # tests/topotests/ospf_prefix_suppression/r2/frr.conf # tests/topotests/ospf_prefix_suppression/r3/frr.conf # tests/topotests/ospfapi/test_ospf_clientapi.py # tests/topotests/pim_autorp/r1/frr.conf # tests/topotests/pim_autorp/r2/frr.conf # tests/topotests/pim_autorp/test_pim_autorp.py # tests/topotests/pim_basic/test_pim.py # tests/topotests/pim_cand_rp_bsr/r1/frr.conf # tests/topotests/pim_cand_rp_bsr/r2/frr.conf # tests/topotests/pim_cand_rp_bsr/r3/frr.conf # tests/topotests/pim_cand_rp_bsr/r4/frr.conf # tests/topotests/pim_cand_rp_bsr/r5/frr.conf # tests/topotests/pim_cand_rp_bsr/r6/frr.conf # tests/topotests/pytest.ini # tests/topotests/simple_snmp_test/r1/bgpd.conf # tests/topotests/simple_snmp_test/r1/isisd.conf # tests/topotests/simple_snmp_test/r1/zebra.conf # tests/topotests/simple_snmp_test/test_simple_snmp.py # tests/topotests/zebra_fec_nexthop_resolution/r1/bgpd.conf # tests/topotests/zebra_fec_nexthop_resolution/r2/bgpd.conf # tests/topotests/zebra_fec_nexthop_resolution/r3/bgpd.conf # tests/topotests/zebra_fec_nexthop_resolution/r4/bgpd.conf # tests/topotests/zebra_fec_nexthop_resolution/r5/bgpd.conf # tests/topotests/zebra_fec_nexthop_resolution/r7/bgpd.conf # tests/topotests/zebra_fec_nexthop_resolution/test_zebra_fec_nexthop_resolution.py # tests/topotests/zebra_rib/r1/sharp_rmap.ref # tests/topotests/zebra_rib/r1/static_rmap.ref # tests/topotests/zebra_rib/test_zebra_rib.py # tools/etc/frr/support_bundle_commands.conf # tools/frr-reload.py # tools/frr_babeltrace.py # tools/gcc-plugins/frr-format.c # tools/start-stop-daemon.c # tools/subdir.am # vtysh/vtysh.c # vtysh/vtysh_main.c # yang/frr-bfdd.yang # yang/frr-bgp-route-map.yang # yang/frr-pim-rp.yang # yang/frr-pim.yang # yang/frr-route-map.yang # zebra/connected.c # zebra/debug.c # zebra/debug.h # zebra/dpdk/zebra_dplane_dpdk.c # zebra/dplane_fpm_nl.c # zebra/if_netlink.c # zebra/interface.c # zebra/interface.h # zebra/ioctl.c # zebra/ipforward_proc.c # zebra/kernel_netlink.c # zebra/kernel_socket.c # zebra/main.c # zebra/redistribute.c # zebra/redistribute.h # zebra/rt_netlink.c # zebra/table_manager.h # zebra/zapi_msg.c # zebra/zebra_cli.c # zebra/zebra_dplane.c # zebra/zebra_dplane.h # zebra/zebra_evpn.c # zebra/zebra_evpn.h # zebra/zebra_l2.h # zebra/zebra_mpls.c # zebra/zebra_nb_state.c # zebra/zebra_netns_id.c # zebra/zebra_netns_notify.c # zebra/zebra_ns.c # zebra/zebra_ns.h # zebra/zebra_rib.c # zebra/zebra_rnh.c # zebra/zebra_routemap.c # zebra/zebra_routemap.h # zebra/zebra_router.h # zebra/zebra_script.c # zebra/zebra_srte.c # zebra/zebra_srv6.c # zebra/zebra_vrf.c # zebra/zebra_vty.c # zebra/zebra_vxlan.c # zebra/zebra_vxlan.h # zebra/zebra_vxlan_if.c # zebra/zserv.c # zebra/zserv.h
Cherry-pick of 9b0b928 has failed:
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
Replaced by #17630. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Although trigger unknown, based on the backtrace in one of the internal testing, we do see some delete in the Intf where we can have the peer ifp pointer null and we try to dereference it while trying to install the route leading to a crash
Skip updating the ifindex in such cases and since the nexthop is not properly updated, BGP skips sending it to zebra.
BackTrace:
Ticket :#4203904
This is an automatic backport of pull request #17624 done by Mergify.