Simon Kelley 295d546705 Fix race in TCP-process to parent pipe.
The pipe from a TCP handler process to the main dnsmasq process
is used to return information back to the main process, normally
RRsets for caching, but other messages too. This all normally happens
synchronously, but there's one situation where this is not true.

If the TCP handler process last for too long, it is reaped by ALARM
signal, and if the TCP handler process is working on DNSSEC
validation which started in UDP mode, but got promoted to TCP,
then a report of that fact gets sent to the main process so that
the blocked UDP query can be released to fail. By it's nature this
happens asynchronously and if the alarm signal interrupts whilst
another message is being send down the pipe, the two messages get
interleaved and garbage results. If this happens by accident
the usual result to a crash, but it could be manipulated by an
attacker to poison the cache or overwrite random memory.

The fix is to block the alarm signals whilst other processes
are sending messages down the pipe.

Thanks to Daniel Wade for finding and analysing this problem.
2026-11-25 20:00:53 +00:00
2012-04-02 20:40:34 +01:00
2025-12-07 13:44:40 +00:00
2012-01-05 17:31:15 +00:00
2026-10-01 15:34:53 +01:00
2018-01-14 17:32:52 +00:00
2022-05-13 21:22:11 +01:00
2012-01-05 17:31:13 +00:00
2025-07-20 15:29:43 +01:00
2021-06-15 23:14:59 +01:00
2026-04-08 12:08:18 +01:00
2025-07-20 15:29:43 +01:00
2012-01-05 22:00:08 +00:00
S
Description
No description provided
GPL-2.0
6.2 MiB
0 Stars 1 Watchers 0 Forks
Languages
C 94.3%
Perl 2.2%
HTML 1.2%
Shell 1%
Makefile 0.6%
Other 0.6%