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 1886305 - connect AF_UNSPEC on a connecting AF_INET6 socket returns an error
Summary: connect AF_UNSPEC on a connecting AF_INET6 socket returns an error
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: kernel
Version: 7.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Paolo Abeni
QA Contact: Jinghua Wu
URL:
Whiteboard:
Depends On:
Blocks: 1892561
TreeView+ depends on / blocked
 
Reported: 2020-10-08 07:09 UTC by Tom Deseyn
Modified: 2024-03-25 16:40 UTC (History)
9 users (show)

Fixed In Version: kernel-3.10.0-1160.8.1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-12-15 11:13:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:5437 0 None None None 2020-12-15 11:17:52 UTC

Description Tom Deseyn 2020-10-08 07:09:12 UTC
Description of problem:

connect to AF_UNSPEC to cancel an on-going connect does not work for AF_INET6 socket.

How reproducible:

Always

Steps to Reproduce:

```
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <pthread.h>
#include <unistd.h>
#include <stdio.h>
#include <assert.h>

static void* connect_socket(void* arg)
{
    int s = (int)(long)arg;

    struct sockaddr_in6 address;
    address.sin6_family = AF_INET6;
    inet_pton(AF_INET6, "::ffff:1.1.1.1", &address.sin6_addr);
    address.sin6_port = htons(23);

    int rv = connect(s, (struct sockaddr*)&address, sizeof(address));
    assert(rv != 0);

    return NULL;
}

int main()
{
    // create AF_INET6 socket
    int s = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP);

    // on-going connect to 1.1.1.1:23
    pthread_t connect_thread;
    int rv = pthread_create(&connect_thread, NULL, connect_socket, (void*)(long)s);
    assert(rv == 0);
    sleep(1); // sleep to wait until connect is on-going.

    // connect to AF_UNSPEC
    struct sockaddr address;
    address.sa_family = AF_UNSPEC;
    rv = connect(s, &address, sizeof(address));

    // wait for thread
    rv = pthread_join(connect_thread, NULL);
    assert(rv == 0);

    return 0;
}

```

```
$ gcc main.c -lpthread
$ ./a.out
```

Actual results:

On RHEL7 this program hangs.
connect to AF_UNSPEC returns EINVAL.

Expected results:

On other Linux systems the program completes.
connect to AF_UNSPEC returns 0.
connect to AF_INET6 returns ECONNRESET.

Additional info:

This issue was discovered as part of .NET Core CI testing: https://github.com/dotnet/runtime/issues/42686.

Comment 3 Augusto Caringi 2020-11-10 02:56:01 UTC
Patch(es) committed on kernel-3.10.0-1160.8.1.el7

Comment 13 errata-xmlrpc 2020-12-15 11:13:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: kernel security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:5437

Comment 14 errata-xmlrpc 2020-12-15 11:17:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: kernel security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:5437


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