From: Willy Tarreau <willy@w.ods.org>
To: "David S. Miller" <davem@davemloft.net>
Cc: michal.k.k.piotrowski@gmail.com, torvalds@osdl.org,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
herbert@gondor.apana.org.au
Subject: Re: Linux v2.6.16-rc6
Date: Sun, 12 Mar 2006 09:35:28 +0100 [thread overview]
Message-ID: <20060312083528.GA21493@w.ods.org> (raw)
In-Reply-To: <20060311.183904.71244086.davem@davemloft.net>
On Sat, Mar 11, 2006 at 06:39:04PM -0800, David S. Miller wrote:
> From: "Michal Piotrowski" <michal.k.k.piotrowski@gmail.com>
> Date: Sun, 12 Mar 2006 02:51:40 +0100
>
> > I have noticed this warnings
> > TCP: Treason uncloaked! Peer 82.113.55.2:11759/50967 shrinks window
> > 148470938:148470943. Repaired.
> > TCP: Treason uncloaked! Peer 82.113.55.2:11759/50967 shrinks window
> > 148470938:148470943. Repaired.
> > TCP: Treason uncloaked! Peer 82.113.55.2:11759/59768 shrinks window
> > 1124211698:1124211703. Repaired.
> > TCP: Treason uncloaked! Peer 82.113.55.2:11759/59768 shrinks window
> > 1124211698:1124211703. Repaired.
> >
> > It maybe problem with ktorrent.
>
> It is a problem with the remote TCP implementation, it is
> illegally advertising a smaller window that it previously
> did.
on 2005/10/27, Herbert Xu provided a patch merged in 2.6.14 to fix some
erroneous occurences of this message (some of them appeared with Linux
on the other side). It would be interesting to know whether the peer
above is Linux or not, because it might be possible that Herbert's fix
needs to be applied to other places ?
Here comes his patch with his interesting analysis for reference, in
case it might give ideas to anybody.
Cheers,
Willy
---
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Thu, 27 Oct 2005 08:47:46 +0000 (+1000)
Subject: [TCP]: Clear stale pred_flags when snd_wnd changes
X-Git-Tag: v2.6.14
X-Git-Url: http://kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=2ad41065d9fe518759b695fc2640cf9c07261dd2
[TCP]: Clear stale pred_flags when snd_wnd changes
This bug is responsible for causing the infamous "Treason uncloaked"
messages that's been popping up everywhere since the printk was added.
It has usually been blamed on foreign operating systems. However,
some of those reports implicate Linux as both systems are running
Linux or the TCP connection is going across the loopback interface.
In fact, there really is a bug in the Linux TCP header prediction code
that's been there since at least 2.1.8. This bug was tracked down with
help from Dale Blount.
The effect of this bug ranges from harmless "Treason uncloaked"
messages to hung/aborted TCP connections. The details of the bug
and fix is as follows.
When snd_wnd is updated, we only update pred_flags if
tcp_fast_path_check succeeds. When it fails (for example,
when our rcvbuf is used up), we will leave pred_flags with
an out-of-date snd_wnd value.
When the out-of-date pred_flags happens to match the next incoming
packet we will again hit the fast path and use the current snd_wnd
which will be wrong.
In the case of the treason messages, it just happens that the snd_wnd
cached in pred_flags is zero while tp->snd_wnd is non-zero. Therefore
when a zero-window packet comes in we incorrectly conclude that the
window is non-zero.
In fact if the peer continues to send us zero-window pure ACKs we
will continue making the same mistake. It's only when the peer
transmits a zero-window packet with data attached that we get a
chance to snap out of it. This is what triggers the treason
message at the next retransmit timeout.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
---
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2239,6 +2239,7 @@ static int tcp_ack_update_window(struct
/* Note, it is the only place, where
* fast path is recovered for sending TCP.
*/
+ tp->pred_flags = 0;
tcp_fast_path_check(sk, tp);
if (nwin > tp->max_window) {
----
next prev parent reply other threads:[~2006-03-12 8:35 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-11 23:58 Linux v2.6.16-rc6 Linus Torvalds
2006-03-12 1:51 ` Michal Piotrowski
2006-03-12 2:39 ` David S. Miller
2006-03-12 3:28 ` Chris Adams
2006-03-12 3:35 ` Lee Revell
2006-03-12 10:57 ` Michal Feix
2006-03-12 8:35 ` Willy Tarreau [this message]
2006-03-12 12:04 ` Michal Piotrowski
2006-04-09 12:08 ` Andy Furniss
[not found] ` <44393AB7.3050506@middle.net>
[not found] ` <443A2A46.9050808@dsl.pipex.com>
[not found] ` <443A7195.5070406@middle.net>
[not found] ` <443AA46C.9080708@dsl.pipex.com>
[not found] ` <443ABFE1.6030601@middle.net>
2006-04-12 21:24 ` Window shrinking (was Linux v2.6.16-rc6) Roberto Nibali
2006-04-12 23:34 ` Andy Furniss
2006-03-12 9:03 ` Linux v2.6.16-rc6 Christoph Hellwig
2006-03-13 19:54 ` Bjorn Helgaas
2006-03-13 21:57 ` Christoph Hellwig
2006-03-13 19:07 ` 2.6.16-rc6: all psmouse regressions fixed? Adrian Bunk
2006-03-14 4:59 ` Benoit Boissinot
2006-03-15 3:38 ` Ryan Phillips
2006-03-13 20:05 ` 2.6.16-rc6: known regressions Adrian Bunk
2006-03-13 12:09 ` Greg KH
2006-03-13 12:12 ` Greg KH
2006-03-13 21:06 ` Jiri Slaby
2006-03-13 21:06 ` Jiri Slaby
2006-03-14 9:36 ` Tom Seeley
2006-03-13 21:22 ` [v4l-dvb-maintainer] " Johannes Stezenbach
2006-03-13 22:14 ` Nathan Laredo
2006-03-13 20:09 ` Olaf Hering
2006-03-13 22:42 ` Andrew Morton
2006-03-14 1:06 ` Adrian Bunk
2006-03-14 13:32 ` Takashi Iwai
2006-03-14 13:32 ` [Alsa-devel] " Takashi Iwai
2006-03-14 1:06 ` Adrian Bunk
2006-03-14 22:18 ` Alan Cox
2006-03-14 22:38 ` Paul Fulghum
2006-03-16 1:42 ` Paul Fulghum
2006-03-14 23:01 ` Jeremy Fitzhardinge
2006-03-17 17:30 ` Jiri Slaby
2006-03-16 22:12 ` Linux v2.6.16-rc6 Bill Davidsen
2006-03-17 14:36 ` 2.6.16-rc6: known regressions (v2) Adrian Bunk
2006-03-17 16:28 ` Takashi Iwai
2006-03-17 20:40 ` Takashi Iwai
2006-03-18 19:27 ` Parag Warudkar
2006-03-18 19:27 ` Parag Warudkar
2006-03-18 19:46 ` Parag Warudkar
2006-03-18 19:46 ` Parag Warudkar
2006-03-20 10:25 ` Takashi Iwai
2006-03-20 10:25 ` Takashi Iwai
2006-03-20 10:47 ` Adrian Bunk
2006-03-20 10:57 ` Takashi Iwai
2006-03-20 10:57 ` Takashi Iwai
2006-03-20 10:59 ` Takashi Iwai
2006-03-18 20:57 ` Claudio Martins
2006-03-19 22:49 ` Nathan Scott
-- strict thread matches above, loose matches on Subject: below --
2006-03-12 3:25 Linux v2.6.16-rc6 Paul Blazejowski
2006-03-12 5:07 ` Andrew Morton
2006-03-13 20:14 ` Jan Engelhardt
2006-03-13 22:32 ` Randy.Dunlap
2006-03-12 18:45 Paul Blazejowski
2006-03-12 21:46 ` Lee Revell
2006-03-12 22:21 ` Paul Blazejowski
2006-03-12 22:57 ` Jeff Garzik
2006-03-13 20:17 ` Jan Engelhardt
2006-03-12 22:54 ` Jeff Garzik
2006-03-12 23:19 ` Paul Blazejowski
2006-03-16 21:58 ` Bill Davidsen
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=20060312083528.GA21493@w.ods.org \
--to=willy@w.ods.org \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.k.k.piotrowski@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=torvalds@osdl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.