mirror_frr/bgpd
Louis Scalbert 5e3edba385 bgpd: fix as-path exclude modify crash
Fix a crash when modifying a route-map with set as-path exclude without
as-path-access-list:

> router(config)# route-map routemaptest deny 1
> router(config-route-map)# set as-path exclude 33 34 35
> router(config-route-map)# set as-path exclude as-path-access-list test

> #0  raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:50
> #1  0x00007fb3959327de in core_handler (signo=11, siginfo=0x7ffd122da530, context=0x7ffd122da400) at lib/sigevent.c:258
> #2  <signal handler called>
> #3  0x000055ab2762a1bd in as_list_list_del (h=0x55ab27897680 <as_exclude_list_orphan>, item=0x55ab28204e20) at ./bgpd/bgp_aspath.h:77
> #4  0x000055ab2762d1a8 in as_exclude_remove_orphan (ase=0x55ab28204e20) at bgpd/bgp_aspath.c:1574
> #5  0x000055ab27550538 in route_aspath_exclude_free (rule=0x55ab28204e20) at bgpd/bgp_routemap.c:2366
> #6  0x00007fb39591f00c in route_map_rule_delete (list=0x55ab28203498, rule=0x55ab28204170) at lib/routemap.c:1357
> #7  0x00007fb39591f87c in route_map_add_set (index=0x55ab28203460, set_name=0x55ab276ad2aa "as-path exclude", set_arg=0x55ab281e4f70 "as-path-access-list test") at lib/routemap.c:1674
> #8  0x00007fb39591d3f3 in generic_set_add (index=0x55ab28203460, command=0x55ab276ad2aa "as-path exclude", arg=0x55ab281e4f70 "as-path-access-list test", errmsg=0x7ffd122db870 "",
>     errmsg_len=8192) at lib/routemap.c:533
> #9  0x000055ab2755e78e in lib_route_map_entry_set_action_rmap_set_action_exclude_as_path_modify (args=0x7ffd122db290) at bgpd/bgp_routemap_nb_config.c:2427
> #10 0x00007fb3958fe417 in nb_callback_modify (context=0x55ab28205aa0, nb_node=0x55ab27cb31e0, event=NB_EV_APPLY, dnode=0x55ab28202690, resource=0x55ab27c32148, errmsg=0x7ffd122db870 "",
>     errmsg_len=8192) at lib/northbound.c:1538
> #11 0x00007fb3958ff0ab in nb_callback_configuration (context=0x55ab28205aa0, event=NB_EV_APPLY, change=0x55ab27c32110, errmsg=0x7ffd122db870 "", errmsg_len=8192) at lib/northbound.c:1888
> #12 0x00007fb3958ff5e4 in nb_transaction_process (event=NB_EV_APPLY, transaction=0x55ab28205aa0, errmsg=0x7ffd122db870 "", errmsg_len=8192) at lib/northbound.c:2016
> #13 0x00007fb3958fddba in nb_candidate_commit_apply (transaction=0x55ab28205aa0, save_transaction=true, transaction_id=0x0, errmsg=0x7ffd122db870 "", errmsg_len=8192)
>     at lib/northbound.c:1356
> #14 0x00007fb3958fdef0 in nb_candidate_commit (context=..., candidate=0x55ab27c2c9a0, save_transaction=true, comment=0x0, transaction_id=0x0, errmsg=0x7ffd122db870 "", errmsg_len=8192)
>     at lib/northbound.c:1389
> #15 0x00007fb3959045ba in nb_cli_classic_commit (vty=0x55ab281f6680) at lib/northbound_cli.c:57
> #16 0x00007fb395904b5a in nb_cli_apply_changes_internal (vty=0x55ab281f6680, xpath_base=0x7ffd122dfd10 "/frr-route-map:lib/route-map[name='routemaptest']/entry[sequence='1']",
>     clear_pending=false) at lib/northbound_cli.c:184
> #17 0x00007fb395904ebf in nb_cli_apply_changes (vty=0x55ab281f6680, xpath_base_fmt=0x0) at lib/northbound_cli.c:240
> --Type <RET> for more, q to quit, c to continue without paging--
> #18 0x000055ab27557d2e in set_aspath_exclude_access_list_magic (self=0x55ab2775c300 <set_aspath_exclude_access_list_cmd>, vty=0x55ab281f6680, argc=5, argv=0x55ab28204c80,
>     as_path_filter_name=0x55ab28202040 "test") at bgpd/bgp_routemap.c:6397
> #19 0x000055ab2754bdea in set_aspath_exclude_access_list (self=0x55ab2775c300 <set_aspath_exclude_access_list_cmd>, vty=0x55ab281f6680, argc=5, argv=0x55ab28204c80)
>     at ./bgpd/bgp_routemap_clippy.c:856
> #20 0x00007fb39589435d in cmd_execute_command_real (vline=0x55ab281e61f0, vty=0x55ab281f6680, cmd=0x0, up_level=0) at lib/command.c:1003
> #21 0x00007fb3958944be in cmd_execute_command (vline=0x55ab281e61f0, vty=0x55ab281f6680, cmd=0x0, vtysh=0) at lib/command.c:1062
> #22 0x00007fb395894a0c in cmd_execute (vty=0x55ab281f6680, cmd=0x55ab28200f20 "set as-path exclude as-path-access-list test", matched=0x0, vtysh=0) at lib/command.c:1228
> #23 0x00007fb39595242c in vty_command (vty=0x55ab281f6680, buf=0x55ab28200f20 "set as-path exclude as-path-access-list test") at lib/vty.c:625
> #24 0x00007fb3959541c5 in vty_execute (vty=0x55ab281f6680) at lib/vty.c:1388
> #25 0x00007fb3959563db in vtysh_read (thread=0x7ffd122e2bb0) at lib/vty.c:2400
> #26 0x00007fb39594b785 in event_call (thread=0x7ffd122e2bb0) at lib/event.c:1996
> #27 0x00007fb3958d1365 in frr_run (master=0x55ab27b56d70) at lib/libfrr.c:1231
> #28 0x000055ab2747f1cc in main (argc=3, argv=0x7ffd122e2e08) at bgpd/bgp_main.c:555

Fixes: 094dcc3cda ("bgpd: fix "bgp as-pah access-list" with "set aspath exclude" set/unset issues")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-09-11 10:24:19 +03:00
..
rfapi bgpd: fix labels static-analyser 2024-08-27 22:23:39 +03:00
rfp-example *: Convert struct event_master to struct event_loop 2023-03-24 08:32:17 -04:00
.gitignore
bgp_addpath_types.h bgpd: Implement neighbor X addpath-tx-best-selected command 2023-06-07 22:27:29 +03:00
bgp_addpath.c bgpd: Handle Addpath capability using dynamic capabilities 2023-10-03 17:44:19 +03:00
bgp_addpath.h bgpd: Avoid padding for bgp_paths_limit_capability struct 2024-03-14 09:50:49 +02:00
bgp_advertise.c bgpd: fix labels in adj-rib-in 2024-06-05 13:11:29 +02:00
bgp_advertise.h bgpd: fix label in adj-rib-out 2024-06-05 13:11:29 +02:00
bgp_aspath.c bgpd: fix "bgp as-pah access-list" with "set aspath exclude" set/unset issues 2024-06-25 05:12:09 +00:00
bgp_aspath.h bgpd: fix "bgp as-pah access-list" with "set aspath exclude" set/unset issues 2024-06-25 05:12:09 +00: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 bgpd: Check the actual remaining stream length before taking TLV value 2024-07-31 12:17:41 +00:00
bgp_attr.h bgpd: store number of labels with 8 bits 2024-06-05 13:11:29 +02:00
bgp_bfd.c bgpd: fix disable bfd profile for neighbors. 2024-03-13 01:15:16 +03:00
bgp_bfd.h *: Convert struct event_master to struct event_loop 2023-03-24 08:32:17 -04:00
bgp_bmp.c bgpd: fix labels static-analyser 2024-08-27 22:23:39 +03:00
bgp_bmp.h bgpd: add 'bmp stat send-experimental' command 2024-04-26 08:12:38 +02:00
bgp_btoa.c *: zebra.h should not have fcntl.h 2024-01-09 12:50:40 -05:00
bgp_clist.c bgpd: Return success if lcomm/comm/extcomm name or entry is not found 2024-05-24 11:25:00 -07:00
bgp_clist.h bgpd: Removed unused COMMUNITY_LIST_ERR_CANT_FIND_LIST 2024-05-24 11:25:16 -07:00
bgp_community_alias.c *: Add a hash_clean_and_free() function 2023-03-21 08:54:21 -04:00
bgp_community_alias.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_community.c bgpd: Remove deprecated COMMUNITY_INTERNET community 2023-08-03 17:12:19 +03:00
bgp_community.h bgpd: Remove deprecated COMMUNITY_INTERNET community 2023-08-03 17:12:19 +03:00
bgp_conditional_adv.c bgpd: Ensure community data is freed in some cases. 2024-03-13 19:28:11 -04:00
bgp_conditional_adv.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_damp.c bgpd: Put dest into work queue when the path is really withdrawn by dampening 2024-05-03 09:30:33 +03:00
bgp_damp.h bgpd: Pass the right reuse_list when handling it via bgp_reuse_timer thread 2024-05-03 09:30:33 +03:00
bgp_debug.c bgpd: store number of labels with 8 bits 2024-06-05 13:11:29 +02:00
bgp_debug.h bgpd: store number of labels with 8 bits 2024-06-05 13:11:29 +02:00
bgp_dump.c *: remove sys/stat.h from zebra.h 2024-01-09 12:39:23 -05:00
bgp_dump.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_ecommunity.c bgpd: Check against extended community unit size for link bandwidth 2024-06-11 10:03:17 +03:00
bgp_ecommunity.h bgpd: Update IPv6 extended community sub-type for extended link bandwidth 2024-04-23 08:55:00 +03: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 Revert "bgpd: store bgp link-state prefixes" 2023-10-10 16:45:00 -04:00
bgp_errors.h Revert "bgpd: store bgp link-state prefixes" 2023-10-10 16:45:00 -04:00
bgp_evpn_mh.c Merge pull request #15900 from mikemallin/v6-vtep-lib-upstream 2024-06-07 14:34:11 -04:00
bgp_evpn_mh.h bgpd : backpressure - Handle BGP-Zebra(EPVN) Install evt Creation 2024-04-08 10:51:43 -07:00
bgp_evpn_private.h bgpd: bgp_best_selection is inherently pi based 2024-04-01 10:24:14 -04:00
bgp_evpn_vty.c bgpd: MTYPE_BGP was being overused split up 2023-11-21 12:41:18 -05:00
bgp_evpn_vty.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_evpn.c bgpd: fix labels static-analyser 2024-08-27 22:23:39 +03:00
bgp_evpn.h bgpd: fixed failing remove of vrf if there is a stale l3vni 2024-06-20 07:51:56 +00:00
bgp_filter.c bgpd: fix "bgp as-pah access-list" with "set aspath exclude" set/unset issues 2024-06-25 05:12:09 +00:00
bgp_filter.h bgpd: fix "bgp as-pah access-list" with "set aspath exclude" set/unset issues 2024-06-25 05:12:09 +00:00
bgp_flowspec_private.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_flowspec_util.c bgpd: add some flowspec sanity returns 2023-04-28 22:28:16 +02:00
bgp_flowspec_util.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_flowspec_vty.c *: Let's use the native IFNAMSIZ instead of INTERFACE_NAMSIZ 2023-11-21 08:08:29 -05:00
bgp_flowspec.c bgpd: Free temp memory 2023-05-29 13:39:14 +04:00
bgp_flowspec.h bgpd: Treat withdraw variable as a bool 2023-04-06 17:41:32 -04:00
bgp_fsm.c bgpd: avoid clearing routes for peers that were never established 2024-06-26 20:46:36 +00:00
bgp_fsm.h bgpd: Send "Send Hold Timer Expired" on such events notification 2024-02-29 15:37:53 +02:00
bgp_io.c bgpd: bgp_fsm_change_status/BGP_TIMER_ON and BGP_EVENT_ADD 2023-09-10 08:31:25 -04:00
bgp_io.h bgpd: Convert bgp_io.c to take struct peer_connection 2023-08-18 09:29:04 -04:00
bgp_keepalives.c bgpd: make bgp_keepalives_on|off connection oriented 2023-09-10 08:31:25 -04:00
bgp_keepalives.h bgpd: make bgp_keepalives_on|off connection oriented 2023-09-10 08:31:25 -04:00
bgp_label.c bgpd: fix labels static-analyser 2024-08-27 22:23:39 +03:00
bgp_label.h bgpd: move labels from extra to extra->labels 2024-06-05 13:11:29 +02:00
bgp_labelpool.c bgpd: bgp_sync_label_manager failure case 2024-01-06 20:26:14 -05:00
bgp_labelpool.h bgpd: Use synchronous way to get labels from Zebra 2023-06-20 20:50:10 +03:00
bgp_lcommunity.c bgpd: Fix lcom->str string length to correctly cover aliases 2023-04-20 16:51:56 -04:00
bgp_lcommunity.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_mac.c bgpd: fix labels static-analyser 2024-08-27 22:23:39 +03:00
bgp_mac.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_main.c bgpd: add bgp_labels hash 2024-06-05 13:11:29 +02:00
bgp_memory.c bgpd: add bgp_labels hash 2024-06-05 13:11:29 +02:00
bgp_memory.h bgpd: add bgp_labels hash 2024-06-05 13:11:29 +02:00
bgp_mpath.c bgpd: Include IPv6 extended community into multipath considerations 2024-04-22 17:50:08 +03:00
bgp_mpath.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_mplsvpn_snmp.c bgpd: MTYPE_BGP was being overused split up 2023-11-21 12:41:18 -05:00
bgp_mplsvpn_snmp.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_mplsvpn.c bgpd: fix labels static-analyser 2024-08-27 22:23:39 +03:00
bgp_mplsvpn.h bgpd: do allocate vrf label only when necessary 2024-04-18 14:55:25 +02:00
bgp_network.c bgpd: Adjust terminology related to DSCP 2024-06-02 06:44:59 -04:00
bgp_network.h bgpd: Set TCP min MSS per listener 2023-09-18 22:34:45 +03:00
bgp_nexthop.c bgpd: add resolved_prefix visibility on nht 2024-03-29 17:20:31 +01:00
bgp_nexthop.h bgpd: add resolved_prefix visibility on nht 2024-03-29 17:20:31 +01:00
bgp_nhg.c bgpd: move l3nhg functions in separate bgp_nhg.[ch] file 2023-12-11 21:03:33 +01:00
bgp_nhg.h bgpd: move l3nhg functions in separate bgp_nhg.[ch] file 2023-12-11 21:03:33 +01:00
bgp_nht.c Merge pull request #16587 from opensourcerouting/fix/revert_ipv4_mapped_ipv6_stuff_10.1 2024-08-29 11:42:10 -04:00
bgp_nht.h bgpd: move l3nhg functions in separate bgp_nhg.[ch] file 2023-12-11 21:03:33 +01:00
bgp_open.c bgpd: Add sanity check for capability lengths before processing them 2024-05-24 10:35:42 +03:00
bgp_open.h bgpd: Add sanity check for capability lengths before processing them 2024-05-24 10:35:42 +03:00
bgp_packet.c Merge pull request #16281 from FRRouting/mergify/bp/dev/10.1/pr-16213 2024-06-25 13:48:18 +03:00
bgp_packet.h bgpd: First pass of BGP_EVENT_ADD 2023-09-10 08:31:25 -04:00
bgp_pbr.c bgpd: bgp_path_info_extra memory optimization 2023-08-08 10:48:07 +00:00
bgp_pbr.h *: Let's use the native IFNAMSIZ instead of INTERFACE_NAMSIZ 2023-11-21 08:08:29 -05:00
bgp_rd.c Merge pull request #12248 from pguibert6WIND/bgpasdot 2023-02-21 08:01:03 -05:00
bgp_rd.h bgpd: Optimize memory for rd_ip struct 2024-01-31 11:29:30 +02: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 #16587 from opensourcerouting/fix/revert_ipv4_mapped_ipv6_stuff_10.1 2024-08-29 11:42:10 -04:00
bgp_route.h bgpd: fix labels static-analyser 2024-08-27 22:23:39 +03:00
bgp_routemap_nb_config.c bgpd: Implement draft-li-idr-link-bandwidth-ext-01 2024-04-22 17:50:08 +03:00
bgp_routemap_nb.c bgpd, yang: fix missing mandatory/default statements on some leafs 2024-02-26 01:03:27 +02:00
bgp_routemap_nb.h bgpd, yang: fix missing mandatory/default statements on some leafs 2024-02-26 01:03:27 +02:00
bgp_routemap.c bgpd: fix as-path exclude modify crash 2024-09-11 10:24:19 +03:00
bgp_rpki.c bgpd: fix labels static-analyser 2024-08-27 22:23:39 +03:00
bgp_rpki.h bgpd: create cache server socket in vrf 2024-01-18 13:22:19 +01:00
bgp_script.c bgpd: Convert struct peer_connection to dynamically allocated 2023-08-18 09:29:04 -04:00
bgp_script.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_snmp_bgp4.c Revert "bgpd: fix pointer arithmetic in bgp snmp module" 2024-04-23 11:39:29 +02:00
bgp_snmp_bgp4.h bgpd: add snmp traps for bgp4-mibv2 2023-10-24 17:16:47 +02:00
bgp_snmp_bgp4v2.c bgpd: fix, do not access peer->notify.data when it is null 2024-08-22 05:19:31 +00:00
bgp_snmp_bgp4v2.h bgpd: add snmp traps for bgp4-mibv2 2023-10-24 17:16:47 +02:00
bgp_snmp.c bgpd: fix new Formatting / Styling warning 2023-10-24 17:16:47 +02:00
bgp_snmp.h bgpd: add [no] bgp snmp traps bgp4-mibv2 command 2023-10-24 17:16:47 +02:00
bgp_table.c bgpd: When using dev build add pointer information to %pBD 2024-03-14 09:45:09 +00:00
bgp_table.h bgpd : backpressure - Handle BGP-Zebra(EPVN) Install evt Creation 2024-04-08 10:51:43 -07:00
bgp_trace.c *: Add missing SPDX-License-Identifier for some .c/.h files 2024-03-21 16:46:58 +02:00
bgp_trace.h bgpd: lttng tp add ethtag to macip zebra send 2023-12-27 18:01:50 -08:00
bgp_updgrp_adv.c bgpd: fix label in adj-rib-out 2024-06-05 13:11:29 +02:00
bgp_updgrp_packet.c Merge pull request #16587 from opensourcerouting/fix/revert_ipv4_mapped_ipv6_stuff_10.1 2024-08-29 11:42:10 -04:00
bgp_updgrp.c bgpd: Drop periodic merge check functions 2024-03-20 16:44:13 +02:00
bgp_updgrp.h bgpd: Drop periodic merge check functions 2024-03-20 16:44:13 +02:00
bgp_vnc_types.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_vpn.c bgpd: Fix display when using missing-as-worst 2024-04-15 12:33:53 -04:00
bgp_vpn.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
bgp_vty.c bgpd: Do not process VRF import/export to/from auto created VRF instances 2024-07-29 09:20:17 +00:00
bgp_vty.h lib,bgpd,vtysh: move bgp vty defines to lib 2024-04-24 08:23:12 -04:00
bgp_zebra.c Merge pull request #16587 from opensourcerouting/fix/revert_ipv4_mapped_ipv6_stuff_10.1 2024-08-29 11:42:10 -04:00
bgp_zebra.h bgpd: store number of labels with 8 bits 2024-06-05 13:11:29 +02:00
bgpd.c bgpd: backpressure - Avoid use after free 2024-07-23 14:47:38 +00:00
bgpd.h bgpd: Adjust terminology related to DSCP 2024-06-02 06:44:59 -04:00
Makefile
subdir.am bgpd: move l3nhg functions in separate bgp_nhg.[ch] file 2023-12-11 21:03:33 +01:00