public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Wolfpaw - Dale Corse" <admin@wolfpaw.net>
To: <willy@w.ods.org>
Cc: <peter@mysql.com>, <linux-kernel@vger.kernel.org>
Subject: RE: Linux 2.4.27 SECURITY BUG - TCP Local (probable Remote) Denial of Service
Date: Sun, 12 Sep 2004 03:24:11 -0600	[thread overview]
Message-ID: <001201c498aa$43b16ce0$0200a8c0@wolf> (raw)
In-Reply-To: <026001c4989c$e2bddbb0$0300a8c0@s>

Hi Willy,

> TIME_WAIT status does not eat much resource, since they're in 
> a separate list. I've already had several *millions* of while 
> stressing some equipment, and I can assure you that it's 
> really not a problem as long as you increase your 
> tcp_max_tw_buckets accordingly. There is even no performance 
> impact (I could still get 40000 hits/s with this number of 
> time-waits). As David said, the connection has been closed 
> when it enters TIME_WAIT, so it has been detached from apache.

This is the odd part, try the exploit, they are detached in
the list, but it appears apache isn't aware of that. If you
run the code, and do multiple telnets from another window,
you will see that there are occurrences where a connection
can't be established, and this is where the problem is. I
used a stock version of Mysql 3 (latest stable), stock
apache, on an unmoded Linux box (except it had GrSecurity)
and I was able to see a noticeable slowdown in web transactions
with a browser. I was also the only person hitting the machine.

I am not saying you are incorrect, I'm simply clarifying what
seems to be occurring with the issue I found.

Do you happen to know of any solution for sockets stuck in
CLOSE_WAIT, they seem to stick around forever.

This bug may be more Mysql then kernel, I don't know - I still
would tend to think these connections should not be clogging up
the applications connection queue, and that CLOSE_WAIT should
have a settable timeout, regardless of what the RFC says about it.

I did experience more CLOSE_WAIT's stuck at one point with Mysql..
we had an issue wherein after calling mysql_close with the C API
it was still leaving the sessions established, so I had moved the
timeout on that sql daemon to 20 seconds (its all fast transactions)
.. This caused a lot of CLOSE_WAIT issues for some reason. We then
added something that would go through and use 'close' on the fd of
the Mysql connection, after mysql_close was called. This had the
odd effect of the fd being reused by a connection, before it was
out of CLOSE_WAIT and actually closed, so it would close the new
Connection, and also the old one :P which led us to this discovery
that connect() appears to reuse FD's before they are actually fully
closed.. This is how it appears anyway. Thus my use of specifically
mysql and connect in the PoC code.

Hope that helps some :)

Thanks :)
D.


       reply	other threads:[~2004-09-12  9:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <026001c4989c$e2bddbb0$0300a8c0@s>
2004-09-12  9:24 ` Wolfpaw - Dale Corse [this message]
2004-09-12 10:36   ` Linux 2.4.27 SECURITY BUG - TCP Local (probable Remote) Denial of Service Willy Tarreau
     [not found] <025e01c4989c$ba5f62b0$0300a8c0@s>
2004-09-12  9:10 ` Wolfpaw - Dale Corse
     [not found] <022601c49866$9e8aa8f0$0300a8c0@s>
2004-09-12  2:45 ` Wolfpaw - Dale Corse
2004-09-12  3:47   ` David S. Miller
2004-09-12  6:27     ` Peter Zaitsev
2004-09-12  6:56       ` Willy Tarreau
2004-09-12  7:11         ` Peter Zaitsev
2004-09-13 17:46   ` Ron DuFresne
2004-09-11 21:41 Wolfpaw - Dale Corse
2004-09-12  1:12 ` David S. Miller
2004-09-14  9:00 ` Ivan Groenewald

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='001201c498aa$43b16ce0$0200a8c0@wolf' \
    --to=admin@wolfpaw.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter@mysql.com \
    --cc=willy@w.ods.org \
    /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