netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gerrit Renker <gerrit@erg.abdn.ac.uk>
To: davem@davemloft.net, dccp@vger.kernel.org, netdev@vger.kernel.org
Subject: v2 [PATCH 7/7] dccp: Add check for truncated ICMPv6 DCCP error packets
Date: Fri, 25 Jul 2008 15:31:07 +0100	[thread overview]
Message-ID: <20080725143107.GD7422@gerrit.erg.abdn.ac.uk> (raw)
In-Reply-To: <20080725143033.GC7422@gerrit.erg.abdn.ac.uk>

This patch adds a minimum-length check for ICMPv6 packets, to allow meaningful
DCCP sequence number checks, as per the previous patch for ICMPv4 payloads.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
---
 net/dccp/ipv6.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -96,6 +96,11 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
 	__u64 seq;
 	struct net *net = dev_net(skb->dev);
 
+	if (dccp_skb_too_short(skb, offset)) {
+		ICMP6_INC_STATS_BH(__in6_dev_get(skb->dev), ICMP6_MIB_INERRORS);
+		return;
+	}
+
 	sk = inet6_lookup(net, &dccp_hashinfo,
 			&hdr->daddr, dh->dccph_dport,
 			&hdr->saddr, dh->dccph_sport, inet6_iif(skb));

  reply	other threads:[~2008-07-25 14:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <dccp_icmp_payload_bug_fixes>
2008-07-25  9:02 ` [net-2.6 PATCH 0/6] dccp: ICMP bug fixes by Wei Yongjun Gerrit Renker
2008-07-25  9:02   ` [PATCH 1/6] dccp: Allow to distinguish original and retransmitted packets Gerrit Renker
2008-07-25  9:02     ` [PATCH 2/6] dccp: Bug-Fix - AWL was never updated Gerrit Renker
2008-07-25  9:02       ` [PATCH 3/6] dccp: Fix sequence number check for ICMPv4 packets Gerrit Renker
2008-07-25  9:02         ` [PATCH 4/6] dccp: Add check for sequence number in ICMPv6 message Gerrit Renker
2008-07-25  9:02           ` [PATCH 5/6] dccp: Fix incorrect length check for ICMPv4 packets Gerrit Renker
2008-07-25  9:02             ` [PATCH 6/6] dccp: Add check for truncated ICMPv6 DCCP error packets Gerrit Renker
2008-07-25  9:51             ` [PATCH 5/6] dccp: Fix incorrect length check for ICMPv4 packets David Miller
2008-07-25 10:25               ` Gerrit Renker
2008-07-25  9:52   ` [net-2.6 PATCH 0/6] dccp: ICMP bug fixes by Wei Yongjun David Miller
2008-07-25 14:28   ` v2 [net-2.6 PATCH 0-4/7] dccp: Revised ICMP bug fixes Gerrit Renker
2008-07-25 14:29     ` [PATCH 5/7] dccp: Pulling 12 bytes is necessary but not sufficient Gerrit Renker
2008-07-25 14:30       ` v2 [PATCH 6/7] dccp: Fix incorrect length check for ICMPv4 packets Gerrit Renker
2008-07-25 14:31         ` Gerrit Renker [this message]
2008-07-26 11:22     ` [pull-request] [net-2.6 PATCH 0/6] dccp: Revised ICMP / length fixes Gerrit Renker
2008-07-27 12:03       ` 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=20080725143107.GD7422@gerrit.erg.abdn.ac.uk \
    --to=gerrit@erg.abdn.ac.uk \
    --cc=davem@davemloft.net \
    --cc=dccp@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;
as well as URLs for NNTP newsgroup(s).