Bug 529626 (CVE-2009-3621) - CVE-2009-3621 kernel: AF_UNIX: Fix deadlock on connecting to shutdown socket
Summary: CVE-2009-3621 kernel: AF_UNIX: Fix deadlock on connecting to shutdown socket
Status: CLOSED ERRATA
Alias: CVE-2009-3621
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard: impact=moderate,reported=20091019,pub...
Keywords: Security
Depends On: 529627 529628 529629 529630 529631 531633 537300
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-10-19 08:50 UTC by Eugene Teo (Security Response)
Modified: 2019-06-08 12:50 UTC (History)
17 users (show)

(edit)
Clone Of:
: 531633 (view as bug list)
(edit)
Last Closed: 2012-03-28 08:56:03 UTC


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


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2009:1540 normal SHIPPED_LIVE Important: kernel-rt security, bug fix, and enhancement update 2009-11-03 18:21:07 UTC
Red Hat Product Errata RHSA-2009:1670 normal SHIPPED_LIVE Important: kernel security and bug fix update 2009-12-15 17:18:47 UTC
Red Hat Product Errata RHSA-2009:1671 normal SHIPPED_LIVE Important: kernel security and bug fix update 2009-12-15 17:18:22 UTC

Description Eugene Teo (Security Response) 2009-10-19 08:50:48 UTC
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 09:14:33 UTC
Reproduced this issue on rhel-5 and fedora-11.

Comment 3 Kyle McMartin 2009-10-19 16:21:43 UTC
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 12:39:15 UTC
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 18:21:43 UTC
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 05:06:01 UTC
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 05:14:43 UTC
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-06 00:03:14 UTC
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-06 00:04:57 UTC
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 17:18:37 UTC
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 17:19:07 UTC
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.