The FRRouting Protocol Suite
Find a file
Carmine Scarpitta 6037ea350c staticd: Fix crash that occurs when modifying an SRv6 SID
When the user modifies an SRv6 SID and then removes all SIDs, staticd
crashes:

```
2025/03/23 08:37:22.691860 STATIC: lib/memory.c:74: mt_count_free(): assertion (mt->n_alloc) failed
STATIC: Received signal 6 at 1742715442 (si_addr 0x8200007cf0); aborting...
STATIC: zlog_signal+0x390                  fcc704a844b8     ffffd7450390 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: core_handler+0x1f8                 fcc704b79990     ffffd7450590 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC:     ---- signal ----
STATIC: ?                                  fcc705c008f8     ffffd74507a0 linux-vdso.so.1 (mapped at 0xfcc705c00000)
STATIC: pthread_key_delete+0x1a0           fcc70458f1f0     ffffd7451a00 /lib/aarch64-linux-gnu/libc.so.6 (mapped at 0xfcc704510000)
STATIC: raise+0x1c                         fcc70454a67c     ffffd7451ad0 /lib/aarch64-linux-gnu/libc.so.6 (mapped at 0xfcc704510000)
STATIC: abort+0xe4                         fcc704537130     ffffd7451af0 /lib/aarch64-linux-gnu/libc.so.6 (mapped at 0xfcc704510000)
STATIC: _zlog_assert_failed+0x3c4          fcc704c407c8     ffffd7451c40 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: mt_count_free+0x12c                fcc704a93c74     ffffd7451dc0 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: qfree+0x28                         fcc704a93fa0     ffffd7451e70 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: static_srv6_sid_free+0x1c          adc1df8fa544     ffffd7451e90 /usr/lib/frr/staticd (mapped at 0xadc1df8a0000)
STATIC: delete_static_srv6_sid+0x14        adc1df8faafc     ffffd7451eb0 /usr/lib/frr/staticd (mapped at 0xadc1df8a0000)
STATIC: list_delete_all_node+0x104         fcc704a60eec     ffffd7451ed0 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: list_delete+0x8c                   fcc704a61054     ffffd7451f00 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: static_srv6_cleanup+0x20           adc1df8fabdc     ffffd7451f20 /usr/lib/frr/staticd (mapped at 0xadc1df8a0000)
STATIC: sigint+0x40                        adc1df8be544     ffffd7451f30 /usr/lib/frr/staticd (mapped at 0xadc1df8a0000)
STATIC: frr_sigevent_process+0x148         fcc704b79460     ffffd7451f40 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: event_fetch+0x1c4                  fcc704bc0834     ffffd7451f60 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: frr_run+0x650                      fcc704a5d230     ffffd7452080 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: main+0x1d0                         adc1df8be75c     ffffd7452270 /usr/lib/frr/staticd (mapped at 0xadc1df8a0000)
STATIC: __libc_init_first+0x7c             fcc7045373fc     ffffd74522b0 /lib/aarch64-linux-gnu/libc.so.6 (mapped at 0xfcc704510000)
STATIC: __libc_start_main+0x98             fcc7045374cc     ffffd74523c0 /lib/aarch64-linux-gnu/libc.so.6 (mapped at 0xfcc704510000)
STATIC: _start+0x30                        adc1df8be0f0     ffffd7452420 /usr/lib/frr/staticd (mapped at 0xadc1df8a0000)
```

Tracking this down, the crash occurs because every time we modify a
SID, staticd executes some callbacks to modify the SID and finally it
calls `apply_finish`, which re-adds the SID to the list `srv6_sids`.

This leads to having the same SID multiple times in the `srv6_sids`
list. When we delete all SIDs, staticd attempts to deallocate the same
SID multiple times, which leads to the crash.

This commit fixes the issue by moving the code that adds the SID to the
list from the `apply_finish` callback to the `create` callback.
This ensures that the SID is inserted into the list only once, when it
is created. For all subsequent modifications, the SID is modified but
not added to the list.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-03-23 18:46:45 +01:00
.github tests: ci: add ARM to docker based CI test 2025-01-18 01:59:47 +00:00
alpine docker: Set ABUILD_APK_INDEX_OPTS for frr build 2024-06-14 16:33:32 +03:00
babeld babled: set wired/wireless internal only when wired/wireless status changes 2025-03-18 10:38:12 +08:00
bfdd bfdd: Add BFD "log-session-changes" feature. 2025-03-03 22:46:01 +00:00
bgpd Merge pull request #18378 from Tuetuopay/fix-route-map-gateway-ip 2025-03-23 12:38:38 +02:00
debian Merge pull request #17375 from opensourcerouting/fix/use_pcre2 2024-11-18 12:34:18 -05:00
doc doc: Modify typesafe documentation 2025-03-18 13:56:28 -04:00
docker docker: add ubuntu24-ci docker image support 2025-01-12 02:48:29 +00:00
eigrpd *: Modify agentx to be allowed to be called 2024-05-10 10:16:29 -04:00
fpm fpm: guard against garbage in unused address bytes 2025-01-29 16:48:37 +01:00
gdb lib: add simplified native msg support 2023-12-26 08:34:56 -05:00
grpc build: throw in a few more XREF_SETUP 2024-05-09 18:02:49 +02:00
include isisd: vlan-subif isis neighbor 2024-08-01 09:09:35 +08:00
isisd isisd: fix bit flag collision in options field 2025-03-13 16:51:04 +01:00
ldpd ldpd: free previous config if it wasn't applied 2024-10-16 13:30:25 +02:00
lib Merge pull request #18359 from soumyar-roy/soumya/streamsize 2025-03-21 11:30:16 -04:00
m4 m4: Update ax_lua to support Lua 5.4 2025-01-13 14:13:36 +02:00
mgmtd mgmtd: Prevent use after free 2025-02-26 12:34:05 -05:00
mlag build: throw in a few more XREF_SETUP 2024-05-09 18:02:49 +02:00
nhrpd nhrpd: fix dont consider incomplete L2 entry 2025-02-11 11:50:52 +01:00
ospf6d ospf6d: Disable and delete OSPFv3 areas that no longer have interfaces or configuration. 2025-03-14 16:02:28 +00:00
ospfclient ospfclient: fix crash due to streamwriter garbage collect 2024-12-20 14:41:20 -05:00
ospfd ospfd: cosmetic change for one command 2025-03-03 10:12:01 +08:00
pathd pathd: Replace ctime_r() with time_to_string() 2024-12-20 17:58:49 +02:00
pbrd pbr: Add tableid to some debugs 2025-02-13 10:40:17 -05:00
pceplib Merge pull request #15215 from donaldsharp/pceplib_fixup 2024-01-25 09:59:59 +02:00
pimd pimd:Skip RPF check for SA message received from the MSDP mesh group peers 2025-03-20 16:18:02 +00:00
pkgsrc build: homologize path handling 2024-01-27 19:02:52 +01:00
python tools: Fix syntax raw parsing for make-foobar helper 2024-11-18 11:04:27 +02:00
qpb *: add XREF_SETUP() to libraries and utilites 2024-05-02 23:03:08 +02:00
redhat redhat: Make sure zeromq is always disabled 2025-03-19 13:51:54 +01:00
ripd ripd: fix no ip rip split-horizon poisoned-reverse command 2025-02-25 16:07:49 +08:00
ripngd ripngd: Access and Prefix lists are being leaked on shutdown 2025-03-18 13:40:32 -04:00
sharpd sharpd: add crashme commands 2025-02-14 17:31:18 +01:00
snapcraft bfdd: remove control socket obsolete code 2024-07-25 10:37:11 -03:00
staticd staticd: Fix crash that occurs when modifying an SRv6 SID 2025-03-23 18:46:45 +01:00
tests Merge pull request #18378 from Tuetuopay/fix-route-map-gateway-ip 2025-03-23 12:38:38 +02:00
tools tools: Fix frr-reload.py error related to static-sids 2025-03-02 00:02:57 +01:00
vrrpd fix(vrrp): display vrrp version by default 2025-03-17 03:46:26 +00:00
vtysh vtysh: Add no static-sids command 2025-02-27 12:17:26 +01:00
watchfrr watchfrr: increase restart timer 20s -> 90s 2024-12-09 12:35:42 -05:00
yang yang: Code inline with RFC 8407 rules 2025-03-20 12:11:46 +05:30
zebra Merge pull request #18359 from soumyar-roy/soumya/streamsize 2025-03-21 11:30:16 -04:00
.clang-format *: Modify clang-format column limit to 100 2024-09-26 09:58:32 -04:00
.dockerignore docker: Make docker image on CentOS 7 2019-11-26 19:29:30 +00:00
.flake8 style: add format checker config that matches FRR style standards 2023-04-18 05:18:26 -04:00
.git-blame-ignore-revs tools: Add black formatting commit to .git-blame-ignore-revs 2024-04-28 12:50:51 +03:00
.gitignore python: add tool to expand typesafe definitions 2024-04-29 17:37:49 +02:00
.isort.cfg style: add format checker config that matches FRR style standards 2023-04-18 05:18:26 -04:00
.pylintrc style: add format checker config that matches FRR style standards 2023-04-18 05:18:26 -04:00
.travis.yml lib: libyang2 add missed conversion 2021-05-17 22:13:59 -04:00
bootstrap.sh build: turn on automake warnings (& symlinks) 2021-04-21 15:42:37 +02:00
buildtest.sh build: update packaging & docs for dir changes 2024-01-27 19:01:19 +01:00
config.version.in build: carry --with-pkg-extra-version into tarballs 2018-10-24 15:11:50 +02:00
configure.ac tests: deal with configure overridden timestamp prec in unit test 2025-03-15 04:11:48 +00:00
COPYING *: sort out & explain licenses used in FRR 2023-02-09 12:46:13 +01:00
Makefile.am build: homologize path handling 2024-01-27 19:02:52 +01:00
README.md doc: Fix the link that points to Slack invitation in README 2022-03-24 13:13:37 +02:00
stamp-h.in Initial revision 2002-12-13 20:15:29 +00:00
version.h build: make builddir include path consistent 2021-04-21 15:42:33 +02:00

Icon

FRRouting

FRR is free software that implements and manages various IPv4 and IPv6 routing protocols. It runs on nearly all distributions of Linux and BSD and supports all modern CPU architectures.

FRR currently supports the following protocols:

  • BGP
  • OSPFv2
  • OSPFv3
  • RIPv1
  • RIPv2
  • RIPng
  • IS-IS
  • PIM-SM/MSDP
  • LDP
  • BFD
  • Babel
  • PBR
  • OpenFabric
  • VRRP
  • EIGRP (alpha)
  • NHRP (alpha)

Installation & Use

For source tarballs, see the releases page.

For Debian and its derivatives, use the APT repository at https://deb.frrouting.org/.

Instructions on building and installing from source for supported platforms may be found in the developer docs.

Once installed, please refer to the user guide for instructions on use.

Community

The FRRouting email list server is located here and offers the following public lists:

Topic List
Development dev@lists.frrouting.org
Users & Operators frog@lists.frrouting.org
Announcements announce@lists.frrouting.org

For chat, we currently use Slack. You can join by clicking the "Slack" link under the Participate section of our website.

Contributing

FRR maintains developer's documentation which contains the project workflow and expectations for contributors. Some technical documentation on project internals is also available.

We welcome and appreciate all contributions, no matter how small!

Security

To report security issues, please use our security mailing list:

security [at] lists.frrouting.org