From: David Miller <davem@davemloft.net>
To: tomoki.sekiyama.qu@hitachi.com
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
alan@lxorguk.ukuu.org.uk, 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: Sun, 18 Oct 2009 23:18:46 -0700 (PDT) [thread overview]
Message-ID: <20091018.231846.205270907.davem@davemloft.net> (raw)
In-Reply-To: <4ADC010C.5070809@hitachi.com>
From: Tomoki Sekiyama <tomoki.sekiyama.qu@hitachi.com>
Date: Mon, 19 Oct 2009 15:02:52 +0900
> I found 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.
>
> Patch:
> The patch below adds shutdown check into unix_socket_connect(), so
> connect(2) to the shutdown socket will return -ECONREFUSED.
>
> Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama.qu@hitachi.com>
> Signed-off-by: Masanori Yoshida <masanori.yoshida.tv@hitachi.com>
Looks good, applied, thank you!
next prev parent reply other threads:[~2009-10-19 6:18 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 [this message]
2009-10-19 7:02 ` Américo Wang
2009-10-19 8:54 ` Tomoki Sekiyama
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=20091018.231846.205270907.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=alan@lxorguk.ukuu.org.uk \
--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=tomoki.sekiyama.qu@hitachi.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).