netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vlad Yasevich <vladislav.yasevich@hp.com>
To: Gerrit Renker <gerrit@erg.abdn.ac.uk>,
	Vlad Yasevich <vladislav.yasevich@hp.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org
Subject: Re: [RFC] sctp/tcp: Question -- ICMPv4 length check (not) redundant?
Date: Mon, 28 Jul 2008 13:27:46 -0400	[thread overview]
Message-ID: <488E0192.9030406@hp.com> (raw)
In-Reply-To: <20080728170846.GB3762@gerrit.erg.abdn.ac.uk>

Gerrit Renker wrote:
> | >  * only TCP/SCTP seem to have a proper per-protocol "payload too short" test;
> | 
> | Hm..  In the standard case, these do seem to be redundant since 8 bytes are required
> | by ICMP spec.
> | 
> | >  * for DCCP, the work is actually doubled since 
> | >    - first the ICMP handler tests for minimally 8 bytes, 
> | >    - then the DCCP error handler tests for required minimum of 12 bytes.
> | 
> | DCCP and any other protocol that requires more error data should check for it in
> | its own handler.  8 bytes should be guaranteed to such handler.
> | 
> | What am I missing?
> | 
> As per last message, please disregard the patch suggestion made at the
> beginning of the thread.
> 
> In TCP, the 8 bytes happen to be enough for doing sequence number checks. Other
> protocols have different header lengths and semantics. Thus doing the checks
> at the transport layer makes more sense than in the ICMP handler.
> 
> RFC 1122 is almost 20 years old, from a time before IPcomp, SCTP, or DCCP.

So the suggestion really is then to remove the length check icmp_unreach()?

Because as it stands right now, the protocol error handler will not be invoked
if we don't have the iphdr + 8 bytes worth of data.  That's is actually a requirement
from the ICMP rfc 792.

Seems that not including those 8 bytes is a violation of that spec.  So, icmp_unreach()
should keep current code and jump to out_err upon failure.

Each upper layer protocol that requires additional space, should validate the existence
of that additional space and handle it appropriately.

It doesn't matter that IPcomp header is only 4 bytes.  ICMP error requires ihlen + 8 bytes and 
at least that much should be provided  Otherwise, it a malformed ICMP packet.

-vlad


  reply	other threads:[~2008-07-28 17:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-25 15:20 [RFC] sctp/tcp: Question -- ICMPv4 length check (not) redundant? Gerrit Renker
2008-07-26  2:15 ` Vlad Yasevich
2008-07-26  4:38   ` David Miller
2008-07-26  7:03     ` Gerrit Renker
2008-07-26  7:36       ` David Miller
2008-07-26  8:10         ` Gerrit Renker
2008-07-27  4:48         ` Herbert Xu
2008-07-27  4:51           ` Herbert Xu
2008-07-28 11:25             ` Gerrit Renker
2008-07-28 13:08               ` Herbert Xu
2008-07-28 13:14               ` Vlad Yasevich
2008-07-28 17:08                 ` Gerrit Renker
2008-07-28 17:27                   ` Vlad Yasevich [this message]
2008-07-28 17:44                     ` Gerrit Renker
2008-07-28 18:09                       ` Vlad Yasevich
2008-07-30 10:19                         ` David Miller
2008-07-30 12:49                           ` Vlad Yasevich
2008-07-29  1:56                     ` Herbert Xu

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=488E0192.9030406@hp.com \
    --to=vladislav.yasevich@hp.com \
    --cc=davem@davemloft.net \
    --cc=gerrit@erg.abdn.ac.uk \
    --cc=herbert@gondor.apana.org.au \
    --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;
as well as URLs for NNTP newsgroup(s).