Bug 5379 - sunrpc: Fix hangs in UDP RPC calls
Summary: sunrpc: Fix hangs in UDP RPC calls
Alias: None
Product: glibc
Classification: Unclassified
Component: network (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2007-11-21 03:29 UTC by Petr Baudis
Modified: 2014-07-03 12:22 UTC (History)
3 users (show)

See Also:
Last reconfirmed:
fweimer: security-

Proposed patch (600 bytes, patch)
2007-11-21 03:29 UTC, Petr Baudis
Details | Diff
Proposed patch (953 bytes, text/plain)
2008-10-10 19:19 UTC, Mike Heffner
Proposed patch (1007 bytes, text/plain)
2008-10-10 20:29 UTC, Mike Heffner

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Baudis 2007-11-21 03:29:12 UTC
clntudp_call() does not properly implement re-poll()ing in case the poll() has
been interrupted.
Comment 1 Petr Baudis 2007-11-21 03:29:28 UTC
Created attachment 2102 [details]
Proposed patch
Comment 2 Ulrich Drepper 2007-11-23 01:32:46 UTC
The patch is not correct.  It goes to the extreme other side.  Now a few signals
sent in short succession can cause the total timeout time to be far too short.

To fix this it will be necessary to measure how long the poll calls slept and
adjust the total time to this.
Comment 3 Mike Heffner 2008-10-10 19:19:25 UTC
Created attachment 2993 [details]
Proposed patch

Here's a different patch for the same bug. This deducts time spent in poll(2)
for each EINTR and reduces the timeout for the subsequent calls to poll(2).
Warning: This patch should compile but I don't have the ability to test it.

Caveats: No way to distinguish the time spent in the signal handler that
interrupted poll(2) from time actually spent polling.
Comment 4 Mike Heffner 2008-10-10 20:29:50 UTC
Created attachment 2994 [details]
Proposed patch

Updated patch to use larger integer type to store milliseconds.
Comment 5 Ondrej Bilka 2013-10-08 16:36:32 UTC
Now last hunk of patch does not apply. Could you sent updated patch to libc-alpha?