[PATCH] Don't bind to registered ports in bindresvport
Florian Weimer
fw@deneb.enyo.de
Sun Jan 27 20:06:00 GMT 2013
* Dan Nicholson:
> Let's just fix the problem at the source. On the first pass, avoid ports
> that are registered in services. If no unregistered ports can be found,
> fall back to taking the first randomly open port. On my fedora system,
> 295 of the 541 ports between 512 and 1023 are unregistered. This should
> avoid registered ports on most typical systems.
BIND uses 921 and 953. 953 is also used by Unbound. 921 doesn't seem
to be listed in /etc/services anywhere. Fedora has 953, but Debian
doesn't. So the /etc/services approach does not seem particularly
reliable.
There's a patch for another blacklist file,
/etc/bindresvport.blacklist, which we use in Debian, but it does not
work for some reason:
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=687210>
I haven't yet found the cause of this bug. (In the bug, "eglibc"
refers to the Debian source package. I don't think the patch was
upstreamed.)
More information about the Libc-alpha
mailing list