Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1899598

Summary: netcat (nc) listener fails with "Bad file descriptor" after a connection is made
Product: Red Hat Enterprise Linux 8 Reporter: noah davids <ndavids>
Component: nmapAssignee: Pavel Zhukov <pzhukov>
Status: CLOSED WONTFIX QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.2Flags: pm-rhel: mirror+
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-20 06:12:56 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:

Description noah davids 2020-11-19 16:12:57 UTC
Description of problem: netcat (nc) listener fails with "Bad file descriptor" after a connection is made

Version-Release number of selected component (if applicable): 7.70

How reproducible: 100% of the time

Steps to Reproduce:
1. disable IPv6
2. reboot
3. nc -l 12345
4. Make connection from some other location

Actual results:

nc -l 12481
close: Bad file descriptor


Expected results:
nc does not fail

Additional info:
The problem can be avoided by using the "-4" argument to open only the ipv4 socket or using "-k" so as not to close the listening sockets after a connection is made.

I am pretty sure that the problem is that with IPv6 disabled the socket call to create the AFINET6 socket fails and the variable holding the FD for the socket is set to -1.  This is not checked when the listening sockets are closed after the connection so the close fails and nc aborts.

Comment 1 Pavel Zhukov 2020-11-20 06:12:56 UTC
RHEL-7 is already in Maintenance Support 2 phase, which means that only Critical impact Security Advisories and selected Urgent Priority Bug Fix Advisories may be addressed. Please see https://access.redhat.com/support/policy/updates/errata#Maintenance_Support_2_Phase for further information.

Since this bug does not meet the criteria, we'll close it as WONTFIX. Feel free to discuss this Bug with Product Management, if this is a critical issue for the customer. Please provide business justification in such case.

This issue is being tracked in RHEL-8 https://bugzilla.redhat.com/show_bug.cgi?id=1899824.