java-topology/tools/tickets/scans/frrouting-ospfd.md
russell@unturf.com db29a08762 undefect. CWE-407 — 92 sites, 42 ecosystems
B&W print-friendly diagrams + tinkerpop-0001 + wave-3 proof sections.
Squash of 94 local commits onto remote master.
2026-03-26 19:48:18 -04:00

2.3 KiB

id priority status created
scan-frrouting-ospfd critical unscanned 2026-03-23

Target

Repo: https://github.com/FRRouting/frr Language: C Why: Live router SPF convergence — every network failure event triggers Dijkstra re-run, making linear visited-node scan a direct amplifier of convergence latency.

Scan command

# Shallow clone
git clone --depth 1 https://github.com/FRRouting/frr /tmp/frrouting-ospfd

# Submit to unsandbox
cat > /tmp/scan-frrouting-ospfd.sh << 'EOF'
#!/usr/bin/env bash
set -euo pipefail
GRAPH_KW="tarjan|strongly.connected|dfs|scc|topolog|topo.sort|cycle|reachab|postorder|dominator|liveness|digraph|shortest.path|path.find"
MEM="listnode|list_lookup|listnode_lookup|for.*node.*next|linear.*scan|visited\[|in_queue"
find /tmp/frrouting-ospfd/ospfd -name "*.c" -o -name "*.h" | sort | while read f; do
  graph_lines=$(grep -inE "$GRAPH_KW" "$f" 2>/dev/null | cut -d: -f1 | head -5 || true)
  [ -z "$graph_lines" ] && continue
  while IFS= read -r lineno; do
    s=$(( lineno > 20 ? lineno - 20 : 1 )); e=$(( lineno + 20 ))
    hit=$(sed -n "${s},${e}p" "$f" 2>/dev/null | grep -iE "$MEM" | head -1 | sed 's/^\s*//' || true)
    [ -n "$hit" ] && echo "CANDIDATE\t${f}:${lineno}\t${hit}"
  done <<< "$graph_lines"
done
EOF
export UNSANDBOX_PUBLIC_KEY=unsb-pk-russ-test-isth-best
export UNSANDBOX_SECRET_KEY=unsb-sk-rk46c-3zvpg-zjf6z-hjrge
~/git/un-inception/build/un /tmp/scan-frrouting-ospfd.sh

Key files to check

  • ospfd/ospf_spf.c — Dijkstra SPF implementation; look for visited/closed-set membership checks
  • ospfd/ospf_route.c — Route table updates post-SPF; linear route list scans
  • ospfd/ospf_lsa.c — LSA candidate list iteration
  • lib/pqueue.c — Priority queue backing the SPF open set

Expected pattern

A listnode_lookup or manual for (node = ...; node; node = node->next) loop inside ospf_spf_calculate or ospf_vertex_add_parent that checks whether a vertex has already been visited/settled, producing O(V) membership tests inside the main O(V+E) Dijkstra loop — yielding O(V²) overall.

Acceptance criteria

  • Scan run and results saved to tools/scan-results/frrouting-ospfd.txt
  • All CANDIDATE hits triaged (confirmed defect or false positive)
  • If confirmed: defect ticket created in tools/tickets/defects/