Bug 205113 - libresolv query ids reused after fork()
Summary: libresolv query ids reused after fork()
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 5
Hardware: i386
OS: Linux
medium
low
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-09-04 09:39 UTC by Wolfgang Breyha
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version: 2.4.90-29
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-09-05 09:01:47 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
PoC Code... (1.22 KB, text/plain)
2006-09-04 09:39 UTC, Wolfgang Breyha
no flags Details

Description Wolfgang Breyha 2006-09-04 09:39:58 UTC
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.

How reproducible:
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
3.
  
Actual results:
timeouts and retries with same nameservers

Expected results:
No timeouts;-) 

Additional info:
I currently use a workarround in the daemon by doing a
_res.id = res_randomid();
after the fork in the child section.

Comment 1 Wolfgang Breyha 2006-09-04 09:39:58 UTC
Created attachment 135485 [details]
PoC Code...

Comment 3 Jakub Jelinek 2006-09-04 20:01:19 UTC
Fixed in CVS, will show up in next rawhide build.

Comment 4 Jakub Jelinek 2006-09-05 09:01:47 UTC
Fixed in glibc-2.4.90-29.


Note You need to log in before you can comment on or make changes to this bug.