Hi everybody,

This is mostly a note to implementors, but it may also be helpful to
operators.

Periodically, PowerDNS users would tell us about odd errors in their logs
about 'Invalid arguments' from sendmsg or sendto. We spent a lot of time
investigating these messages, as they usually point to subtle memory
corruption. But we didn't find anything.

Yesterday, an AS112 operator reported seeing an increased number of these
issues, and we decided to consult the Linux kernel source code to see under
what conditions UDP sendmsg/sendto generate EINVAL.  One cause jumped out:
trying to send packets to port 0.

On a hunch, we asked the operator to tcpdump for port 0 packets, and lo,
these turned out to be frequent.

43.504115 IP x.y.117.10.0 > 192.175.48.6.53: 6365+ SOA? 168.192.in-addr.arpa. 
(38)
45.504152 IP x.y.117.10.0 > 192.175.48.6.53: 6365+ SOA? 168.192.in-addr.arpa. 
(38)
49.505124 IP x.y.117.10.0 > 192.175.48.6.53: 6365+ SOA? 168.192.in-addr.arpa. 
(38)

PowerDNS now refuses to attempt to answer such packets, which silences the
error messages.

If anyone else was chasing odd errors on UDP sendmsg/sendto, this may have
been the reason. I think it may be wise to drop port 0 packets as soon as
feasible with UDP software, as no good can come from them.

Original ticket:
https://github.com/PowerDNS/pdns/issues/844

Commit in:
https://github.com/PowerDNS/pdns/commit/81859ba591d7de51d45e48b4fe499b08e08c221b

Kind regards,

Bert

-- 
PowerDNS Website: http://www.powerdns.com/
Contact us by phone on +31-15-7850372

_______________________________________________
DNSOP mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/dnsop

Reply via email to