Bug 210892 - whois(1): infinite loop
Summary: whois(1): infinite loop
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.0-RC1
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch, regression
Depends on:
Blocks:
 
Reported: 2016-07-07 13:20 UTC by Piotr Kubaj
Modified: 2019-05-21 21:45 UTC (History)
4 users (show)

See Also:


Attachments
whois 163.172.135.172 (34.70 KB, text/plain)
2016-07-07 13:20 UTC, Piotr Kubaj
no flags Details
Patch for 210892 (1.05 KB, patch)
2016-07-29 03:47 UTC, rday
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer freebsd_triage 2016-07-07 13:20:17 UTC
Created attachment 172196 [details]
whois 163.172.135.172

whois goes in an infinite loop when executing 'whois 163.172.135.172'. Checking other IP's seems to go fine. This happens on head (11.0-ALPHA6), while 10.3-RELEASE is fine.
Comment 1 rday 2016-07-29 03:47:45 UTC
Created attachment 173085 [details]
Patch for 210892

It looks like this is a side effect from a fix for a redirect bug. The fix was introduced in commit 3389187e4b646b62f4754a92855389d967de816f (in the github repo).

The original problem was whois didn't follow certain redirects correctly, and wouldn't give accurate information (the U of M example).

There was a possible loop with APNIC however. The response from APNIC for the IP in this bug report would match the ERX-NETBLOCK, be redirected to ARIN, which would then redirect back to APNIC.

I've proposed a patch which fixes the problem. But I'm not too familiar with the intricacies of the whois system. The original author probably has much more insight as to whether this solution is acceptable.
Comment 2 Piotr Kubaj freebsd_committer freebsd_triage 2017-07-20 17:35:49 UTC
(In reply to rday from comment #1)
Looks fine, fixes the problem.
Comment 3 ali@mashtizadeh.com 2019-05-21 21:41:30 UTC
Appears to be fixed in #aec30d9b

More robust handling of whois referrals from RIRs.

An example problem case is 163.1.0.0 (University of Oxford)
which is in an APNIC ERX address range. Previously we assumed
that ARIN has the correct information for all ERX allocations,
but in this case ARIN refers back to APNIC, rather than referring
to RIPE. This caused whois to loop.

Whois will no longer loop back and forth forever between two RIRs
that don't have an answer, but instead try the other RIRs in turn.
...
Comment 4 Ed Maste freebsd_committer freebsd_triage 2019-05-21 21:45:44 UTC
Reported fixed by r308762 / https://reviews.freebsd.org/rS308762