envoyproxy / envoyproxy/envoy

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

Open
#10,079 0 comments 0 reactions 0 assignees View on GitHub
area/dns enhancement help wanted
Dominant language
C++
Stars
28.9k
Forks
5.6k
Avg merge
1d 22h
Merged PRs (30d)
430

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.