netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: xiaosuo@gmail.com, kaber@trash.net, pablo@netfilter.org,
	netfilter-devel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] net: check the length of the data before dereferencing it
Date: Sun, 01 Apr 2012 23:57:24 -0400 (EDT)	[thread overview]
Message-ID: <20120401.235724.1615627410446519543.davem@davemloft.net> (raw)
In-Reply-To: <1333338797.2325.6610.camel@edumazet-glaptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 02 Apr 2012 05:53:17 +0200

> On Mon, 2012-04-02 at 11:45 +0800, Changli Gao wrote:
> 
>> Thinking about a malformed tcp segment, which has no data but silly
>> options, and whose last byte is neither TCPOPT_EOL or TCPOPT_NOP, we
>> will try to dereference one byte over the boundary when parsing the
>> options. I know we have skb_shared_info at the end and it won't cause
>> any crash, but should we rely on this fact?
>> 
> 
> No we cant rely on this, kmemcheck might barf on us.

Give me a break.

The code does the right thing, in every possible case, and
in every possible valid state of an SKB.

If we can't make kmemcheck handle that, tough, I'm not adding useless
tests to a function, specifically tests which are always there and
that don't fix anything.

  reply	other threads:[~2012-04-02  3:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-02  3:10 [PATCH] net: check the length of the data before dereferencing it Changli Gao
2012-04-02  3:19 ` Eric Dumazet
2012-04-02  3:29   ` David Miller
2012-04-02  3:45     ` Changli Gao
2012-04-02  3:53       ` Eric Dumazet
2012-04-02  3:57         ` David Miller [this message]
2012-04-02  3:59           ` Eric Dumazet
2012-04-02  4:47         ` Changli Gao
2012-04-02  4:54           ` Eric Dumazet
2012-04-02  6:27             ` Changli Gao
2012-04-02  6:43               ` Eric Dumazet
2012-04-02  3:45     ` Eric Dumazet
2012-04-02  3:55       ` David Miller
2012-04-02  3:58         ` Eric Dumazet
2012-04-02  4:14           ` David Miller
2012-04-02  3:19 ` 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=20120401.235724.1615627410446519543.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=xiaosuo@gmail.com \
    /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).