From: Tomoki Sekiyama <tomoki.sekiyama.qu@hitachi.com>
To: xiyou.wangcong@gmail.com
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
alan@lxorguk.ukuu.org.uk, davem@davemloft.net,
satoshi.oshima.fk@hitachi.com, hidehiro.kawai.ez@hitachi.com,
hideo.aoki.tk@hitachi.com
Subject: Re: [PATCH] AF_UNIX: Fix deadlock on connecting to shutdown socket
Date: Mon, 19 Oct 2009 17:54:04 +0900 [thread overview]
Message-ID: <4ADC292C.8010608@hitachi.com> (raw)
In-Reply-To: <2375c9f90910190002m372edafq9a4c95d754640487@mail.gmail.com>
Hi, thanks for testing!
Américo Wang wrote:
> On Mon, Oct 19, 2009 at 2:02 PM, Tomoki Sekiyama
> <tomoki.sekiyama.qu@hitachi.com> wrote:
>> Hi,
>> I found a deadlock bug in UNIX domain socket, which makes able to DoS
>> attack against the local machine by non-root users.
>>
>> 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.
>>
>> PoC code: (Run as many times as cores on SMP machines.)
Sorry for my ambiguous explanation ...
> Interesting...
>
> I tried this with the following command:
>
> % for i in `seq 1 $(grep processor -c /proc/cpuinfo)`;
> do ./unix-socket-dos-exploit; echo "=====$i====";done
<snip>
> My system doesn't hang at all.
>
> Am I missing something?
>
> Thanks!
You should run the ./unix-socket-dos-exploit concurrently, like below:
for i in {1..4} ; do ./unix-socket-dos-exploit & done
# For safety reason, the PoC code stops in 15 seconds by alarm(15).
--
Tomoki Sekiyama
Linux Technology Center
Hitachi, Ltd., Systems Development Laboratory
E-mail: tomoki.sekiyama.qu@hitachi.com
next prev parent reply other threads:[~2009-10-19 8:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-19 6:02 [PATCH] AF_UNIX: Fix deadlock on connecting to shutdown socket Tomoki Sekiyama
2009-10-19 6:18 ` David Miller
2009-10-19 7:02 ` Américo Wang
2009-10-19 8:54 ` Tomoki Sekiyama [this message]
2009-10-19 8:58 ` Tomoki Sekiyama
2009-10-19 9:06 ` Américo Wang
2009-10-19 11:57 ` Jarek Poplawski
2009-10-19 13:14 ` David Miller
2009-10-19 18:07 ` Jarek Poplawski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4ADC292C.8010608@hitachi.com \
--to=tomoki.sekiyama.qu@hitachi.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=davem@davemloft.net \
--cc=hidehiro.kawai.ez@hitachi.com \
--cc=hideo.aoki.tk@hitachi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=satoshi.oshima.fk@hitachi.com \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).