RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1198780 - [IPv6] Java based gears can not use IPv6 connectivity
Summary: [IPv6] Java based gears can not use IPv6 connectivity
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: java-1.7.0-openjdk
Version: 6.6
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Andrew John Hughes
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
: 1160657 (view as bug list)
Depends On:
Blocks: 871569 1172231 1269194 1273542
TreeView+ depends on / blocked
 
Reported: 2015-03-04 19:38 UTC by Josep 'Pep' Turro Mauri
Modified: 2019-10-10 09:39 UTC (History)
18 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-09 18:45:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 1534583 0 None None None Never

Description Josep 'Pep' Turro Mauri 2015-03-04 19:38:35 UTC
Description of problem:

Java applications running inside an OpenShift gear can not use IPv6 connectivity. This includes e.g. trying to connect from an app to an external service that is provided via IPv6; or using Jenkins on an IPv6 based OSE deployment.

This is because the JVM tries to determine if the system has IPv6 enabled by reading /proc/net/if_inet6, which has SELinux type proc_net_t. This access is denied by SELinux by design (CVE-2014-3602).

Version-Release number of selected component (if applicable):
OpenShift 2.2.x, java-1.7.0-openjdk-1.7.0.75-2.5.4.0.el6_6

How reproducible:
Always

Steps to Reproduce:
1. Have an OpenShift environment with IPv6 enabled
2. From within a gear, try to run a Java application that connects to an IPv6 based service

Actual results:

    Exception in thread "main" java.net.SocketException: Protocol family unavailable
	    at java.net.PlainSocketImpl.socketConnect(Native Method)
	    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
	    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
	    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
	    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	    at java.net.Socket.connect(Socket.java:579)
            ...

Expected results:

Ideally it should be possible to use IPv6 from within a gear to access IPv6 services.

Additional info:

It seems that openJDK on Linux uses /proc/net/if_inet6 to decide if the system supports IPv6:

http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/9b8c96f96a0f/src/solaris/native/java/net/net_util_md.c#l308

which fails due to SELinux:

type=AVC msg=audit(1425497336.028:3867): avc:  denied  { read } for  pid=1494 comm="java" name="if_inet6" dev=proc ino=4026532162 scontext=unconfined_u:system_r:openshift_t:s0:c2,c614 tcontext=system_u:object_r:proc_net_t:s0 tclass=file
type=AVC msg=audit(1425497336.028:3867): avc:  denied  { open } for  pid=1494 comm="java" name="if_inet6" dev=proc ino=4026532162 scontext=unconfined_u:system_r:openshift_t:s0:c2,c614 tcontext=system_u:object_r:proc_net_t:s0 tclass=file

Comment 11 Brenton Leanhardt 2015-03-23 14:08:26 UTC
*** Bug 1160657 has been marked as a duplicate of this bug. ***


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