netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McManus <mcmanus@ducksong.com>
To: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Cc: Eric Sesterhenn <snakebyte@gmx.de>,
	netdev@vger.kernel.org, davem@davemloft.net,
	ilpo.jarvinen@helsinki.fi
Subject: Re: Slab Corruption with ipv6 and tcp6fuzz
Date: Sun, 27 Apr 2008 12:48:26 -0400	[thread overview]
Message-ID: <1209314906.29301.148.camel@tng> (raw)
In-Reply-To: <20080426160519.GA5697@2ka.mipt.ru>

On Sat, 2008-04-26 at 20:05 +0400, Evgeniy Polyakov wrote:

> > tcp_v6_do_rcv()->tcp_rcv_established(), the latter goes to step5, where
> > eventually skb can be freed via tcp_data_queue() (drop: label), then if
> > check for tcp_defer_accept_check() returns true and thus
> > tcp_rcv_established() returns -1, which forces tcp_v6_do_rcv() to jump
> > to reset: label, which in turn will pass through discard: label and free
> > the same skb again.
> >  

yep. That buggy test was logic from a different strategy long
discarded.. the skb is always queued/dropped independently of
defer_accept_check() and as such it shouldn't impact the return value of
rcv_established.

I was able to reproduce by forcing the fuzzer to play with DEFER_ACCEPT
100% of the time, and with the patch tests out fine as do the original
defer_accept tests.

Sorry for the bug, and thanks Evgeniy for fixing it and Eric for finding
it.

Acked-By: Patrick McManus <mcmanus@ducksong.com>

> 
> Please test. This bug affects both ipv6 and ipv4 code actually.
> 
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index ac9b848..0298f80 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -4925,8 +4925,7 @@ step5:
>  	tcp_data_snd_check(sk);
>  	tcp_ack_snd_check(sk);
>  
> -	if (tcp_defer_accept_check(sk))
> -		return -1;
> +	tcp_defer_accept_check(sk);
>  	return 0;
>  
>  csum_error:
> 
> 


  parent reply	other threads:[~2008-04-27 16:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-24 14:27 Slab Corruption with ipv6 and tcp6fuzz Eric Sesterhenn
2008-04-24 19:48 ` Ilpo Järvinen
2008-04-24 21:13 ` Evgeniy Polyakov
2008-04-25 12:52   ` Eric Sesterhenn
2008-04-25 13:09     ` Evgeniy Polyakov
2008-04-26 16:05       ` Evgeniy Polyakov
2008-04-27  6:05         ` David Miller
2008-04-27 13:25           ` Patrick McManus
2008-04-27 15:32             ` Eric Sesterhenn
2008-04-27 16:48         ` Patrick McManus [this message]
2008-04-27 22:27           ` 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=1209314906.29301.148.camel@tng \
    --to=mcmanus@ducksong.com \
    --cc=davem@davemloft.net \
    --cc=ilpo.jarvinen@helsinki.fi \
    --cc=johnpol@2ka.mipt.ru \
    --cc=netdev@vger.kernel.org \
    --cc=snakebyte@gmx.de \
    /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).