Bug 529626 - (CVE-2009-3621) CVE-2009-3621 kernel: AF_UNIX: Fix deadlock on connecting to shutdown socket
CVE-2009-3621 kernel: AF_UNIX: Fix deadlock on connecting to shutdown socket
Status: CLOSED ERRATA
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
impact=moderate,reported=20091019,pub...
: Security
Depends On: 529627 529628 529629 529630 529631 531633 537300
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-19 04:50 EDT by Eugene Teo (Security Response)
Modified: 2012-09-05 23:45 EDT (History)
17 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 531633 (view as bug list)
Environment:
Last Closed: 2012-03-28 04:56:03 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
reproducer (793 bytes, text/plain)
2009-10-20 08:39 EDT, Jiri Pirko
no flags Details

  None (edit)
Description Eugene Teo (Security Response) 2009-10-19 04:50:48 EDT
Quoting from the patch submitted:
"...a deadlock bug in UNIX domain socket, which makes able to DoS
attack against the local machine by non-root users.

...
Why this happens:
 Error checks between unix_socket_connect() and unix_wait_for_peer() are
 inconsistent. The former calls the latter to wait until the backlog is
 processed. Despite the latter returns without doing anything when the
 socket is shutdown, the former doesn't check the shutdown state and
 just retries calling the latter forever."

How to reproduce:
 1. Make a listening AF_UNIX/SOCK_STREAM socket with an abstruct
    namespace(*), and shutdown(2) it.
 2. Repeat connect(2)ing to the listening socket from the other sockets
    until the connection backlog is full-filled.
 3. connect(2) takes the CPU forever. If every core is taken, the
    system hangs.

Reproducer:
http://patchwork.kernel.org/patch/54678/

You will need to add in the missing header files:
#include <string.h>
#include <stdio.h>
#include <sys/un.h>
#include <sys/types.h>
#include <sys/socket.h>
Comment 2 Eugene Teo (Security Response) 2009-10-19 05:14:33 EDT
Reproduced this issue on rhel-5 and fedora-11.
Comment 3 Kyle McMartin 2009-10-19 12:21:43 EDT
Thanks Eugene, I just committed the fix Dave Miller acked to the 3 current Fedora branches.

regards, Kyle
Comment 5 Jiri Pirko 2009-10-20 08:39:15 EDT
Created attachment 365339 [details]
reproducer

$ gcc rep.c -o rep
$ for i in {1..XX} ; do ./rep & done # substitute XX for a number of cpus
Comment 7 errata-xmlrpc 2009-11-03 13:21:43 EST
This issue has been addressed in following products:

  MRG for RHEL-5

Via RHSA-2009:1540 https://rhn.redhat.com/errata/RHSA-2009-1540.html
Comment 8 Fedora Update System 2009-11-05 00:06:01 EST
kernel-2.6.30.9-96.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/kernel-2.6.30.9-96.fc11
Comment 9 Fedora Update System 2009-11-05 00:14:43 EST
kernel-2.6.27.38-170.2.113.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/kernel-2.6.27.38-170.2.113.fc10
Comment 10 Fedora Update System 2009-11-05 19:03:14 EST
kernel-2.6.30.9-96.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 11 Fedora Update System 2009-11-05 19:04:57 EST
kernel-2.6.27.38-170.2.113.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 13 errata-xmlrpc 2009-12-15 12:18:37 EST
This issue has been addressed in following products:

  Red Hat Enterprise Linux 4

Via RHSA-2009:1671 https://rhn.redhat.com/errata/RHSA-2009-1671.html
Comment 14 errata-xmlrpc 2009-12-15 12:19:07 EST
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

Via RHSA-2009:1670 https://rhn.redhat.com/errata/RHSA-2009-1670.html

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