From f0507f05ce57398e135651896dace4cb68eeed54 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Mon, 27 Sep 2021 16:40:28 +0200 Subject: Route sources have an explicit owner This commit prevents use-after-free of routes belonging to protocols which have been already destroyed, delaying also all the protocols' shutdown until all of their routes have been finally propagated through all the pipes down to the appropriate exports. The use-after-free was somehow hypothetic yet theoretically possible in rare conditions, when one BGP protocol authors a lot of routes and the user deletes that protocol by reconfiguring in the same time as next hop update is requested, causing rte_better() to be called on a not-yet-pruned network prefix while the owner protocol has been already freed. In parallel execution environments, this would happen an inter-thread use-after-free, causing possible heisenbugs or other nasty problems. --- proto/pipe/pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'proto/pipe') diff --git a/proto/pipe/pipe.c b/proto/pipe/pipe.c index bbcd8f0d..a30da0e2 100644 --- a/proto/pipe/pipe.c +++ b/proto/pipe/pipe.c @@ -91,7 +91,7 @@ pipe_preexport(struct channel *c, rte *e) { log_rl(&p->rl_gen, L_ERR "Route overpiped (%u hops of %u configured in %s) in table %s: %N %s/%u:%u", e->generation, max_generation, c->proto->name, - c->table->name, e->net, e->src->proto->name, e->src->private_id, e->src->global_id); + c->table->name, e->net, e->src->owner->name, e->src->private_id, e->src->global_id); return -1; } -- cgit v1.2.3