]> git.ipfire.org Git - thirdparty/bind9.git/commit
Preserve the request buffer across async SIG(0) processing 12189/head
authorMichal Nowak <mnowak@isc.org>
Thu, 4 Jun 2026 12:09:26 +0000 (12:09 +0000)
committerMichal Nowak <mnowak@isc.org>
Mon, 8 Jun 2026 11:30:28 +0000 (11:30 +0000)
commitddfe8a1bdcd170daaedde8eaec3ad88190e24915
treea4a5b09f84064217e56cb575d489346f8ebd0864
parentc8e98231213596e99e845c40d4aac76cd39944d9
Preserve the request buffer across async SIG(0) processing

For SIG(0)-signed requests, view matching is offloaded and the request
is finished asynchronously from ns_client_request_continue(), which
passes client->inner.buffer to dns_dt_send().  That buffer aliases the
network manager's receive buffer, only valid during the read callback,
so it may already be freed and reused, producing garbage dnstap frames
(e.g. the "upforwd" sig0-over-DoT test fails with UQ=0).

When the request is offloaded (ns_client_setup_view() returns
DNS_R_WAIT) and dnstap is enabled, copy the request buffer and point
client->inner.buffer at the copy so it survives the asynchronous hop;
free it in ns__client_reset_cb().  When dnstap is disabled there is no
async consumer of the buffer, so detach it from the receive buffer
instead.

Assisted-by: Claude:claude-opus-4-8
lib/ns/client.c
lib/ns/include/ns/client.h