Bug 1210739
Summary: | JNDI: DNS Naming service does not handle platform IPv6 addresses correctly | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Severin Gehwolf <sgehwolf> | ||||||||
Component: | java-1.8.0-openjdk | Assignee: | Severin Gehwolf <sgehwolf> | ||||||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||||
Severity: | unspecified | Docs Contact: | |||||||||
Priority: | unspecified | ||||||||||
Version: | 21 | CC: | ahughes, alonbl, dbhole, jerboaa, jvanek, lzachar, omajid, sbaiduzh | ||||||||
Target Milestone: | --- | ||||||||||
Target Release: | --- | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Whiteboard: | |||||||||||
Fixed In Version: | java-1.8.0-openjdk-1.8.0.45-36.b13.fc22 | Doc Type: | Bug Fix | ||||||||
Doc Text: | Story Points: | --- | |||||||||
Clone Of: | Environment: | ||||||||||
Last Closed: | 2015-05-03 17:23:19 UTC | Type: | Bug | ||||||||
Regression: | --- | Mount Type: | --- | ||||||||
Documentation: | --- | CRM: | |||||||||
Verified Versions: | Category: | --- | |||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||
Embargoed: | |||||||||||
Bug Depends On: | |||||||||||
Bug Blocks: | 1203666 | ||||||||||
Attachments: |
|
Created attachment 1013194 [details]
Proposed fix for upstream JDK 9
Assigning to Severin as he already has a patch ready :) Hi, If attachment#1013194 [details] is to be sent to upstream, it should be applied to linux only, as in *bsd the [] is legal[1], or at least do not add double []. Alon [1] http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man5/resolv.conf.5?query=resolv.conf&sec=5 (In reply to Alon Bar-Lev from comment #6) > Hi, > > If attachment#1013194 [details] is to be sent to upstream, it should be > applied to linux only, as in *bsd the [] is legal[1], or at least do not add > double []. Understood, thanks! AFAIKS, there is only a distinction between Windows and Solaris+Linux in the JDK as far as platform resolvers are concerned. The attachment in comment 2 was only the first shot. Once I have more cycles I'll improve it and then propose it upstream. So yes at the very least we'll have to make sure no double [] get introduced. Upstream review thread: http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-April/032912.html Relevant JDK 9 upstream commits: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/4be070b8aaba http://hg.openjdk.java.net/jdk9/dev/jdk/rev/8000249dcb2a I'll ask for an 8 backport, next. 8 backport request: http://mail.openjdk.java.net/pipermail/jdk8u-dev/2015-April/003458.html Is this applicable to 6 & 7 too? (In reply to Andrew John Hughes from comment #13) > Is this applicable to 6 & 7 too? Yes, latest icedtea 7 and openjdk 6 forests have the same bug. This fix was pushed to 8: http://hg.openjdk.java.net/jdk8u/jdk8u-dev/jdk/rev/b02550d62bdb Builds with the upstream 8 fix: rawhide: http://koji.fedoraproject.org/koji/taskinfo?taskID=9599391 f22: http://koji.fedoraproject.org/koji/taskinfo?taskID=9599395 Created attachment 1020289 [details]
spec file patch for f21's java-1.8.0-openjdk
java-1.8.0-openjdk-1.8.0.45-36.b13.fc22 has been submitted as an update for Fedora 22. https://admin.fedoraproject.org/updates/java-1.8.0-openjdk-1.8.0.45-36.b13.fc22 Package java-1.8.0-openjdk-1.8.0.45-36.b13.fc22: * should fix your issue, * was pushed to the Fedora 22 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing java-1.8.0-openjdk-1.8.0.45-36.b13.fc22' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2015-7301/java-1.8.0-openjdk-1.8.0.45-36.b13.fc22 then log in and leave karma (feedback). java-1.8.0-openjdk-1.8.0.45-36.b13.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report. *** Bug 1203666 has been marked as a duplicate of this bug. *** |
Created attachment 1013140 [details] Simple Java reproducer. Description of problem: OpenJDK uses DNS lookup for various internal purposes. For example if a KDC is looked up via DNS. This service does not work if /etc/resolv.conf contains IPv6 addresses as per rfc2373. Version-Release number of selected component (if applicable): java-1.8.0-openjdk-1.8.0.40-21.b25.fc21.x86_64 How reproducible: Always. Steps to Reproduce: 1. Add an IPv6 address as "nameserver" in /etc/resolv.conf 2. javac DNSClientTest.java 3. java DNSClientTest Actual results: FAIL: Tried to parse non-[]-encapsulated IPv6 address. java.lang.NumberFormatException: For input string: "52:0:2258:42f2:e9ff:fef0:8d33" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:580) at java.lang.Integer.parseInt(Integer.java:615) at com.sun.jndi.dns.DnsClient.<init>(DnsClient.java:127) at DNSClientTest.main(DNSClientTest.java:38) Expected results: PASS: Found IPv6 address and DnsClient parsed it correctly. Additional info: The problem is that class com.sun.jndi.dns.DnsClient expects the string list of servers to be [] encapsulated for literal IPv6 addresses. However, when the list of nameservers is retrieved from the platform via sun.net.dns.ResolverConfigurationImpl.loadConfig() the list of nameservers isn't correctly encapsulated, in '[' and ']' respectively. This breaks the contract for DnsClient since the nameservers list is passed on verbatim to DnsClient's constructor. Also note that tools (such as network manager) that generate /etc/resolv.conf aren't expected to wrap IPv6 addresses for "nameserver" entries.