mirror_frr/bgpd
Donald Sharp 3059f5c992 bgpd: Prevent Null pointer deref when outputting data
Crash:

(gdb) bt
0  0x00007fee27de15cb in raise () from /lib/x86_64-linux-gnu/libpthread.so.0
1  0x00007fee280ecd9c in core_handler (signo=11, siginfo=0x7ffe56001bb0, context=<optimized out>) at lib/sigevent.c:264
2  <signal handler called>
3  0x0000555e321c41b2 in prefix_rd2str (prd=0x10, buf=buf@entry=0x7ffe56002080 "27.0.0.R\340\373\062\062^U", size=size@entry=28) at bgpd/bgp_rd.c:168
4  0x0000555e321c431a in printfrr_prd (buf=0x7ffe560021a0, ea=<optimized out>, ptr=<optimized out>) at bgpd/bgp_rd.c:224
5  0x00007fee2812069b in vbprintfrr (cb_in=cb_in@entry=0x7ffe56002330, fmt0=fmt0@entry=0x555e3229a3ad " RD: %pRD\n", ap=ap@entry=0x7ffe560023d8) at lib/printf/vfprintf.c:564
6  0x00007fee28122ef7 in vasnprintfrr (mt=mt@entry=0x7fee281cb5e0 <MTYPE_VTY_OUT_BUF>, out=out@entry=0x7ffe560023f0 " RD: : R\n", outsz=outsz@entry=1024, fmt=fmt@entry=0x555e3229a3ad " RD: %pRD\n", ap=ap@entry=0x7ffe560023d8) at lib/printf/glue.c:103
7  0x00007fee28103504 in vty_out (vty=vty@entry=0x555e33f82d10, format=format@entry=0x555e3229a3ad " RD: %pRD\n") at lib/vty.c:190
8  0x0000555e32185156 in bgp_evpn_es_show_entry_detail (vty=0x555e33f82d10, es=0x555e33c38420, json=<optimized out>) at bgpd/bgp_evpn_mh.c:2655
9  0x0000555e32188fe5 in bgp_evpn_es_show (vty=vty@entry=0x555e33f82d10, uj=false, detail=true) at bgpd/bgp_evpn_mh.c:2721
notice prd=0x10 in #3.  This is because in bgp_evpn_mh.c we are sending &es->es_base_frag->prd.

There is one spot in the code where during output the es->es_base_frag is checked for non nullness
Let's just make sure it's right in all the places.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-17 15:44:33 -04:00
..
rfapi Merge pull request #12890 from pguibert6WIND/attr_cleaning_misc 2023-03-07 09:46:24 -05:00
rfp-example *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
.gitignore *: cleanup .gitignore files 2018-09-08 21:30:42 +02:00
bgp_addpath_types.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_addpath.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_addpath.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_advertise.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_advertise.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_aspath.c bgpd: Free previously dup'ed aspath attribute for aggregate routes 2023-03-15 13:34:56 +02:00
bgp_aspath.h Merge pull request #12248 from pguibert6WIND/bgpasdot 2023-02-21 08:01:03 -05:00
bgp_attr_evpn.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_attr_evpn.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_attr.c Merge pull request #12890 from pguibert6WIND/attr_cleaning_misc 2023-03-07 09:46:24 -05:00
bgp_attr.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
bgp_bfd.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_bfd.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_bmp.c bgpd: Rename bgp_afi_node_lookup() to bgp_safi_node_lookup() 2023-03-14 12:01:56 +02:00
bgp_bmp.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_btoa.c Merge pull request #12248 from pguibert6WIND/bgpasdot 2023-02-21 08:01:03 -05:00
bgp_clist.c bgpd: Deprecate BGP internet community 2023-02-17 18:53:01 +02:00
bgp_clist.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_community_alias.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_community_alias.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_community.c bgpd: Deprecate BGP internet community 2023-02-17 18:53:01 +02:00
bgp_community.h bgpd: Deprecate BGP internet community 2023-02-17 18:53:01 +02:00
bgp_conditional_adv.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_conditional_adv.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_damp.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_damp.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_debug.c Merge pull request #12248 from pguibert6WIND/bgpasdot 2023-02-21 08:01:03 -05:00
bgp_debug.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_dump.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_dump.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_ecommunity.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_ecommunity.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_encap_tlv.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_encap_tlv.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_encap_types.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_errors.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_errors.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_evpn_mh.c bgpd: Prevent Null pointer deref when outputting data 2023-03-17 15:44:33 -04:00
bgp_evpn_mh.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_evpn_private.h bgpd: Drop afi_t from bgp_evpn_global_node_lookup() 2023-03-14 12:05:58 +02:00
bgp_evpn_vty.c bgpd: Rename bgp_afi_node_lookup() to bgp_safi_node_lookup() 2023-03-14 12:01:56 +02:00
bgp_evpn_vty.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_evpn.c bgpd: Drop afi_t from bgp_evpn_global_node_lookup() 2023-03-14 12:05:58 +02:00
bgp_evpn.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
bgp_filter.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_filter.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_flowspec_private.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_flowspec_util.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_flowspec_util.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_flowspec_vty.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_flowspec.c bgpd: Flowspec overflow issue 2023-02-23 13:29:32 -05:00
bgp_flowspec.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_fsm.c bgpd: Always restart timer from scratch in OpenConfirm/Established 2023-03-16 19:23:38 -04:00
bgp_fsm.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_io.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_io.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_keepalives.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_keepalives.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_label.c bgpd: Do not send notification twice when parsing NLRI labels 2023-03-05 20:58:26 +02:00
bgp_label.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_labelpool.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_labelpool.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_lcommunity.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_lcommunity.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_mac.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_mac.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_main.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_memory.c Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
bgp_memory.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
bgp_mpath.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_mpath.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_mplsvpn_snmp.c bgpd: Free memory allocated by ecommunity_ecom2str() 2023-03-14 11:07:48 +02:00
bgp_mplsvpn_snmp.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_mplsvpn.c bgpd: Unlock bgp dest node if leak_update() fails 2023-03-15 14:52:21 +02:00
bgp_mplsvpn.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_network.c bgpd: Use interface name instead of pointer value 2023-03-16 10:26:01 -04:00
bgp_network.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_nexthop.c Merge pull request #12248 from pguibert6WIND/bgpasdot 2023-02-21 08:01:03 -05:00
bgp_nexthop.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_nht.c bgpd: Check if the peer is configured as interface when checking NHT 2023-03-07 22:36:15 +02:00
bgp_nht.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_open.c Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
bgp_open.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
bgp_packet.c Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
bgp_packet.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_pbr.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_pbr.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_rd.c Merge pull request #12248 from pguibert6WIND/bgpasdot 2023-02-21 08:01:03 -05:00
bgp_rd.h Merge pull request #12248 from pguibert6WIND/bgpasdot 2023-02-21 08:01:03 -05:00
bgp_regex.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_regex.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_route.c Merge pull request #12999 from opensourcerouting/fix/bgp_leaks_random_stuff 2023-03-16 19:12:55 -04:00
bgp_route.h Merge pull request #12999 from opensourcerouting/fix/bgp_leaks_random_stuff 2023-03-16 19:12:55 -04:00
bgp_routemap_nb_config.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_routemap_nb.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_routemap_nb.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_routemap.c bgpd: Unlock dest if we return earlier for aggregate install 2023-03-15 13:34:55 +02:00
bgp_rpki.c bgpd: Another rpki fix 2023-02-23 10:02:59 -05:00
bgp_rpki.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_script.c Merge pull request #12248 from pguibert6WIND/bgpasdot 2023-02-21 08:01:03 -05:00
bgp_script.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_snmp_bgp4.c Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
bgp_snmp_bgp4.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_snmp_bgp4v2.c Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
bgp_snmp_bgp4v2.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_snmp.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_snmp.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_table.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_table.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_trace.c *: make sure config.h or zebra.h is first 2021-04-23 12:06:35 +02:00
bgp_trace.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_updgrp_adv.c bgpd: Rename bgp_afi_node_lookup() to bgp_safi_node_lookup() 2023-03-14 12:01:56 +02:00
bgp_updgrp_packet.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_updgrp.c bgpd: Add missing items to debug for update group hash key creation 2023-03-07 07:58:27 -05:00
bgp_updgrp.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_vnc_types.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_vpn.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_vpn.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_vty.c bgpd: Simplify the code for show command 2023-03-08 16:10:05 +08:00
bgp_vty.h Merge pull request #12805 from karlquan/kquan_self_orig 2023-02-21 08:38:07 -05:00
bgp_zebra.c Merge pull request #12990 from opensourcerouting/fix/rename_bgp_afi_node_lookup 2023-03-14 10:16:16 -04:00
bgp_zebra.h lib, bgpd: Add more debugs to GR Capability exchange 2023-03-09 08:36:51 -05:00
bgpd.c bgpd: Prevent asn dot memory leak 2023-02-25 07:43:30 -05:00
bgpd.h tests: Check if peer->af_flags can be higher than uint32_t 2023-02-24 00:24:20 +02:00
Makefile build: non-recursive bgpd & rfp 2018-09-08 21:25:59 +02:00
subdir.am Revert "bgpd: optimal router reflection cli and fsm changes" 2023-01-17 18:15:28 +02:00