Red Hat Bugzilla – Bug 205113
libresolv query ids reused after fork()
Last modified: 2007-11-30 17:11:42 EST
Description of problem:
If a parent process initialises the resolver structure with res_init() and forks
childs afterwards every child uses the last query id the parent had in _res.id
for the first request. This can lead to a lot of requests with the same id if
done by a daemon (eg. PTR lookup for the connecting client). If the nameserver
uses "use-id-pool" you will get lots of timeouts and retries.
Version-Release number of selected component (if applicable):
Tried on latest packeges for FC4(2.3.6-3), FC5(2.4-8). Same result.
I've written PoC Code... attached.
Steps to Reproduce:
1. start "tcpdump port 53"
2. call my PoC Code several times and watch the query IDs
timeouts and retries with same nameservers
I currently use a workarround in the daemon by doing a
_res.id = res_randomid();
after the fork in the child section.
Created attachment 135485 [details]
Fixed in CVS, will show up in next rawhide build.
Fixed in glibc-2.4.90-29.