envoyproxy/envoy

dns: use handles to prevent use-after-free problems between dns queries and callback targets

Open

#10 079 ouverte le 17 févr. 2020

Voir sur GitHub
 (0 commentaires) (0 réactions) (0 assignés)C++ (5 373 forks)batch import
area/dnsenhancementhelp wanted

Métriques du dépôt

Stars
 (27 997 stars)
Métriques de merge PR
 (Merge moyen 8j) (378 PRs mergées en 30 j)

Description

Description: ActiveDnsQueries have independent lifetimes from their callback targets (strict/logical dns cluster, dns cache). Right now there is an implicit contract where the callback target sets their query pointer to null once the query is resolved, and the query only fires callbacks if it has not been cancelled. However, this implicit contract can create problems when it's not adhered to (e.g #10006).

An enhancement would be to use handles with RAII constraints similar to how the init manager does with watchers and targets.

Guide contributeur