mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Cao <caoco2002@yahoo.com>
To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: bug and question in tcp stack
Date: Fri, 12 Feb 2010 15:22:16 -0800 (PST)	[thread overview]
Message-ID: <157135.69931.qm@web63405.mail.re1.yahoo.com> (raw)

Hi,

I think it is an obvious bug both in the old and latest kernel:

In function net/ipv4/tcp_output.c, tcp_retransmit_skb() returns a NEGTIVE value on failures.  But in net/ipv4/tcp_timer.c, in function tcp_retransmit_timer(), the line

if (tcp_retransmit_skb(sk, tcp_write_queue_head(sk)) > 0) {

checks the return value as a positive number, which will never be true.  On failures from tcp_retransmit_skb(), the code will follow the wrong path.

My second question is regarding the function tcp_retransmit_skb().  The first check in the function is copied here:

 	/* Do not sent more than we queued. 1/4 is reserved for possible
	 * copying overhead: fragmentation, tunneling, mangling etc.
	 */
	if (atomic_read(&sk->sk_wmem_alloc) >
	    min(sk->sk_wmem_queued + (sk->sk_wmem_queued >> 2), sk->sk_sndbuf))
		return -EAGAIN;


My question is if that turns out to be true, which I saw happend, how could the stack get out of the state?  Because all TCP retransmission may fail, no buffer will be released.  The connection is virtually dead.  Is that true?

Thanks,
Joe


      

             reply	other threads:[~2010-02-12 23:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-12 23:22 Joe Cao [this message]
2010-02-12 23:39 ` David Miller

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=157135.69931.qm@web63405.mail.re1.yahoo.com \
    --to=caoco2002@yahoo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@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®