Files
coredns/core
Omkhar Arasaratnam 9fac0b6e9e core/dnsserver: bound DoQ stream read with the server read timeout (#8231)
serveQUICStream acquires a worker from streamProcessPool and then calls
readDOQMessage with no read deadline. A client that opens a QUIC stream
but never (or only slowly) sends its DoQ query blocks that worker
indefinitely. With enough such streams this starves the worker pool and
stalls DoQ service for other clients, a remotely triggerable denial of
service that needs no authentication.

Set a per-stream read deadline before readDOQMessage, bounded by the
server's existing ReadTimeout (the same deadline used to read a query on
TCP, default 3s), so a stalled stream cannot hold a worker forever. A
deadline hit surfaces as a read error handled by the existing error path,
which closes the connection and frees the worker; the normal fast path is
unchanged.

Adds a regression test proving a stalled stream no longer starves the
single-worker pool while a well-behaved query is still served.

Signed-off-by: Omkhar Arasaratnam <omkhar@linkedin.com>
Co-authored-by: Omkhar Arasaratnam <omkhar@linkedin.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 20:37:57 +03:00
..