mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: kernel@linuxace.com
Cc: linux-kernel@vger.kernel.org, linux-netdev@vger.kernel.org
Subject: Re: Linux 2.6.19
Date: Wed, 29 Nov 2006 18:15:37 -0800 (PST)	[thread overview]
Message-ID: <20061129.181537.38322733.davem@davemloft.net> (raw)
In-Reply-To: <20061130014904.GA1405@linuxace.com>

From: Phil Oester <kernel@linuxace.com>
Date: Wed, 29 Nov 2006 17:49:04 -0800

> Getting an oops on boot here, caused by commit
> e81c73596704793e73e6dbb478f41686f15a4b34 titled
> "[NET]: Fix MAX_HEADER setting".
> 
> Reverting that patch fixes things up for me.  Dave?

I suspect that it might be because I removed the IPV6
ifdef from the list,  but I can't imagine why that would
matter other than due to a bug in the IPV6 stack....

Indeed.

Looking at ndisc_send_rs() I wonder if it miscalculates
'len' or similar and the old MAX_HEADER setting was
merely papering around this bug....

In fact it does, the NDISC code is using MAX_HEADER incorrectly.  It
needs to explicitly allocate space for the struct ipv6hdr in 'len'.
Luckily the TCP ipv6 code was doing it right.

What a horrible bug, this patch should fix it.  Let me know
if it doesn't, thanks:

commit c28728decc37fe52c8cdf48b3e0c0cf9b0c2fefb
Author: David S. Miller <davem@sunset.davemloft.net>
Date:   Wed Nov 29 18:14:47 2006 -0800

    [IPV6] NDISC: Calculate packet length correctly for allocation.
    
    MAX_HEADER does not include the ipv6 header length in it,
    so we need to add it in explicitly.
    
    Signed-off-by: David S. Miller <davem@davemloft.net>

diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 73eb8c3..c42d4c2 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -441,7 +441,8 @@ static void ndisc_send_na(struct net_dev
         struct sk_buff *skb;
 	int err;
 
-	len = sizeof(struct icmp6hdr) + sizeof(struct in6_addr);
+	len = sizeof(struct ipv6hdr) + sizeof(struct icmp6hdr) +
+		sizeof(struct in6_addr);
 
 	/* for anycast or proxy, solicited_addr != src_addr */
 	ifp = ipv6_get_ifaddr(solicited_addr, dev, 1);
@@ -556,7 +557,8 @@ void ndisc_send_ns(struct net_device *de
 	if (err < 0)
 		return;
 
-	len = sizeof(struct icmp6hdr) + sizeof(struct in6_addr);
+	len = sizeof(struct ipv6hdr) + sizeof(struct icmp6hdr) +
+		sizeof(struct in6_addr);
 	send_llinfo = dev->addr_len && !ipv6_addr_any(saddr);
 	if (send_llinfo)
 		len += ndisc_opt_addr_space(dev);
@@ -632,7 +634,7 @@ void ndisc_send_rs(struct net_device *de
 	if (err < 0)
 		return;
 
-	len = sizeof(struct icmp6hdr);
+	len = sizeof(struct ipv6hdr) + sizeof(struct icmp6hdr);
 	if (dev->addr_len)
 		len += ndisc_opt_addr_space(dev);
 
@@ -1381,7 +1383,8 @@ void ndisc_send_redirect(struct sk_buff 
 			 struct in6_addr *target)
 {
 	struct sock *sk = ndisc_socket->sk;
-	int len = sizeof(struct icmp6hdr) + 2 * sizeof(struct in6_addr);
+	int len = sizeof(struct ipv6hdr) + sizeof(struct icmp6hdr) +
+		2 * sizeof(struct in6_addr);
 	struct sk_buff *buff;
 	struct icmp6hdr *icmph;
 	struct in6_addr saddr_buf;

  reply	other threads:[~2006-11-30  2:15 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-29 22:21 Linus Torvalds
2006-11-29 22:55 ` Romano Giannetti
2006-11-29 23:11 ` Randy Dunlap
2006-11-29 23:21   ` Alan
2006-11-29 23:15     ` Randy Dunlap
2006-11-29 23:25       ` Geraldo Netto
2006-11-29 23:32         ` Randy Dunlap
2006-11-29 23:31       ` Geraldo Netto
2006-11-29 23:52       ` Linus Torvalds
2006-11-30  0:56   ` Greg Norris
2006-11-30  1:08     ` Randy Dunlap
2006-11-30  2:20       ` Greg Norris
2006-11-30  1:49     ` Phil Oester
2006-11-30  2:15       ` David Miller [this message]
2006-11-30  2:22         ` Phil Oester
2006-11-30 20:30         ` Malte Schröder
2006-12-02  9:48           ` Malte Schröder
2006-11-30  0:26 ` Udo A. Steinberg
2006-11-30 21:15   ` Herbert Xu
2006-11-30 22:32     ` Udo A. Steinberg
2006-11-30 23:51       ` Herbert Xu
2006-11-30  8:01 ` Jindrich Makovicka
2006-12-02 19:54 ` Matthijs
2006-12-08 18:56 ` [PATCH] fs/jfs: fix error due to PF_* undeclared Richard Knutsson
2006-12-08 19:23   ` Randy Dunlap
2006-12-08 21:29     ` Richard Knutsson
2006-12-08 21:59       ` Dave Kleikamp
2006-12-11 14:47 ` Linux 2.6.19 Romano Giannetti
2006-12-11 20:38   ` Dominik Brodowski

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=20061129.181537.38322733.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=kernel@linuxace.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-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

Powered by JetHome