mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Raghu Angadi <raghuangadi@yahoo.com>
To: kuznet@ms2.inr.ac.ru, "David S. Miller" <davem@redhat.com>
Cc: raghuangadi@yahoo.com, linux-kernel@vger.kernel.org
Subject: Re: Fw: memory corruption in tcp bind hash buckets on SMP?
Date: Wed, 27 Feb 2002 11:46:20 -0800 (PST)	[thread overview]
Message-ID: <20020227194620.69620.qmail@web12308.mail.yahoo.com> (raw)
In-Reply-To: <200202271904.WAA09439@ms2.inr.ac.ru>


--- kuznet@ms2.inr.ac.ru wrote:
> Hello!
> 
> > I think his analysis is alright but he patch is questionable.
> 
> Yes. "if (tb) tcp_tw_put(tw)" cannot be right, no doubts.

In timewait_kill(), tb is set only _after_ it has been removed from the
established (if it exist there). In _hashdance() tw is inserted into
established _before_ it is inserted into bindhash. So the above is one way of
saying do tw_put() when it has been deleted from _both_ the lists.
Also note that patch removes "if (!tw->pprev) return;" thingy. Infact this
return sort of implied you never thought tw could be deleted from ehash and
not from bind hash.

> Seems, it is enough to remove from bind hash _before_ established.
> 
> The idea was that bind hash is pure slave of another state, so that
> it need not refcounting at all. Note that adding the second increment
> does not help: when we verify that leakage (the situation, when
> bucket is in bind hash, but has no timer running) is impossible
> we immediately arrive to elimination of the refcount.
> 
> Raghu, could you check the variant with inverted order of removal?
> Do you see holes? From my side... I need to think more. :-)

Just the inteverted order of removal will fix _this_ perticular case.
But we still end up doing tw_put() in timewait_kill() even though tw is still
in the bind list (just got inserted on the other processor). This seems
conceptually incorrect or confusing. The refcnt increment in tw_hashdance()
is for these two lists and tw_put() in timewait_kill() should correspond to
the deletion from _both_ the lists. 
 
If you want to avoid timewait_kill() getting called twice altogether.. then
its a different issue.

Raghu.

> Alexey


__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com

  reply	other threads:[~2002-02-27 19:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20020226.231934.116353439.davem@redhat.com>
2002-02-27 19:04 ` kuznet
2002-02-27 19:46   ` Raghu Angadi [this message]
2002-02-27 20:05     ` Raghu Angadi
2002-02-27 20:12       ` kuznet
2002-02-27 20:31         ` Raghu Angadi
2002-03-01 19:07           ` kuznet
2002-03-04 20:48             ` Raghu Angadi
2002-03-04 23:26             ` David S. Miller
2002-03-05  0:54               ` Raghu Angadi
2002-03-05  4:30               ` David S. Miller
2002-02-27 20:08     ` Fw: " kuznet
2002-02-27 20:26       ` Raghu Angadi
2002-02-28  5:53       ` Raghu Angadi

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=20020227194620.69620.qmail@web12308.mail.yahoo.com \
    --to=raghuangadi@yahoo.com \
    --cc=davem@redhat.com \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®