From: David Newall <davidn@davidnewall.com>
To: Lukas Tribus <luky-37@hotmail.com>,
Eric Dumazet <eric.dumazet@gmail.com>,
Bandan Das <bandan.das@stratus.com>
Cc: Netdev <netdev@vger.kernel.org>, "fw@strlen.de" <fw@strlen.de>
Subject: Re: Bad checksum on bridge with IP options
Date: Tue, 13 May 2014 09:16:47 +0930 [thread overview]
Message-ID: <53715D67.8020803@davidnewall.com> (raw)
In-Reply-To: <DUB123-W514EA0A4A29F520778F2FFED350@phx.gbl>
On 13/05/14 04:24, Lukas Tribus wrote:
> Looks like your testcase:
> - works in 2.6.36 and older
> - crashes starting with 2.6.37 (-rc1), likely due to Bandan's commit 462fb2af9788a82 (bridge : Sanitize skb before it enters the IP stack) [1]
> - crash fix is in 2.6.38.4, likely due to Eric's commit f8e9881c2aef1e9 (bridge: reset IPCB in br_parse_ip_options) [2]
> - doesn't work post-crashfix
>
>
>
> [1]http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=462fb2af9788a82a534f8184abfde31574e1cfa0
> [2]http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=f8e9881c2aef1e982e5abc25c046820cd0b7cf64
>
Thanks, Lukas, for researching those changes. It explains why
ip_options_compile() is being called.
Discussion for [1] starts at https://lkml.org/lkml/2010/8/30/391.
Briefly, "if we recieve (sic) a packet greater in size than the
bridge device MTU, we call ip_fragment which in turn will lead to
icmp_send calling ip_options_echo if the DF flag is set."
Eric Dumazet said (in that discussion), "once again, the IP stack ->
bridge -> IP stack flow bites us." Such enduring insight. He also said,
"we can correct every bug we find ... or just make bridge not touch IPCB."
Assuming now is not the time to stop bridge from touching IPCB,
recalculating the checksum would seem appropriate, but insufficient as
at least the RR and TS options aren't being set correctly; perhaps
others. I think calling ip_forward_options will fix that, and,
conveniently, will also recalculate the checksum if the options changed.
I'm thinking that the following changes might do the trick (but haven't
yet tested them; the complete kernel needs to be recompiled, and my
machine is still grinding away):
--- br_netfilter.c.orig 2014-05-12 22:10:59.809988125 +0930
+++ br_netfilter.c 2014-05-13 08:08:48.330396347 +0930
@@ -312,6 +312,9 @@
goto drop;
}
+ if (unlikely(opt->is_changed && opt->optlen))
+ ip_forward_options(skb);
+
return 0;
inhdr_error:
--- ../ipv4/ip_options.c.orig 2014-05-13 05:40:10.408914495 +0930
+++ ../ipv4/ip_options.c 2014-05-13 08:29:01.482130038 +0930
@@ -601,6 +601,7 @@
ip_send_check(ip_hdr(skb));
}
}
+EXPORT_SYMBOL(ip_forward_options);
int ip_options_rcv_srr(struct sk_buff *skb)
{
next prev parent reply other threads:[~2014-05-12 23:54 UTC|newest]
Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-11 14:41 Bad checksum on bridge with IP options David Newall
2014-05-11 19:42 ` Lukas Tribus
2014-05-12 8:14 ` David Newall
2014-05-12 10:15 ` Lukas Tribus
2014-05-12 10:25 ` David Newall
2014-05-12 10:31 ` Lukas Tribus
2014-05-12 10:48 ` David Newall
2014-05-12 13:23 ` David Newall
2014-05-12 13:51 ` Florian Westphal
2014-05-12 14:19 ` David Newall
2014-05-12 18:54 ` Lukas Tribus
2014-05-12 23:46 ` David Newall [this message]
2014-05-14 13:08 ` David Newall
2014-05-16 14:33 ` Revert 462fb2af9788a82a534f8184abfde31574e1cfa0 (bridge : Sanitize skb before it enters the IP stack) David Newall
2014-05-16 15:19 ` Eric Dumazet
2014-05-16 15:23 ` David Newall
2014-05-16 15:24 ` David Newall
2014-05-19 12:58 ` [Bridge] " David Newall
2014-05-19 12:58 ` David Newall
2014-05-19 14:01 ` [Bridge] " Florian Westphal
2014-05-19 14:01 ` Florian Westphal
2014-05-19 14:19 ` [Bridge] " David Newall
2014-05-19 14:19 ` David Newall
2014-05-19 17:09 ` [Bridge] " Florian Westphal
2014-05-19 17:09 ` Florian Westphal
2014-05-19 20:49 ` [Bridge] " Bart De Schuymer
2014-05-19 20:49 ` Bart De Schuymer
2014-05-21 7:49 ` [Bridge] " David Newall
2014-05-21 7:49 ` David Newall
2014-05-21 18:51 ` [Bridge] " Bart De Schuymer
2014-05-21 18:51 ` Bart De Schuymer
2014-05-21 20:18 ` [Bridge] " David Miller
2014-05-21 20:18 ` David Miller
2014-05-22 18:57 ` [Bridge] " Bart De Schuymer
2014-05-22 18:57 ` Bart De Schuymer
2014-05-24 18:00 ` [Bridge] " David Miller
2014-05-24 18:00 ` David Miller
2014-05-24 5:56 ` [Bridge] " David Newall
2014-05-24 5:56 ` David Newall
2014-05-24 17:43 ` [Bridge] " David Miller
2014-05-24 17:43 ` David Miller
2014-05-25 2:32 ` [Bridge] " David Newall
2014-05-25 2:32 ` David Newall
2014-05-25 3:02 ` [Bridge] " David Miller
2014-05-25 3:02 ` David Miller
2014-05-25 6:37 ` [Bridge] " David Newall
2014-05-25 6:37 ` David Newall
2014-05-27 8:55 ` [Bridge] " David Laight
2014-05-27 8:55 ` David Laight
2014-05-29 22:34 ` [Bridge] " David Miller
2014-05-29 22:34 ` David Miller
2014-05-30 9:17 ` [Bridge] " David Newall
2014-05-30 9:17 ` David Newall
2014-05-31 0:46 ` [Bridge] " David Miller
2014-05-31 0:46 ` David Miller
2014-05-31 6:13 ` [Bridge] " David Newall
2014-05-31 6:13 ` David Newall
2014-05-31 6:37 ` [Bridge] " David Miller
2014-05-31 6:37 ` David Miller
2014-05-22 3:50 ` [Bridge] " David Newall
2014-05-22 3:50 ` David Newall
2014-05-22 18:57 ` [Bridge] " Bart De Schuymer
2014-05-22 18:57 ` Bart De Schuymer
2014-05-20 3:57 ` [Bridge] " David Newall
2014-05-20 3:57 ` David Newall
2014-05-20 4:55 ` [Bridge] " Valdis.Kletnieks
2014-05-20 4:55 ` Valdis.Kletnieks
2014-05-20 16:05 ` [Bridge] " Vlad Yasevich
2014-05-20 16:05 ` Vlad Yasevich
2014-05-20 16:05 ` Vlad Yasevich
2014-05-21 8:10 ` [Bridge] " David Newall
2014-05-21 8:10 ` David Newall
2014-05-21 20:14 ` [Bridge] " David Miller
2014-05-21 20:14 ` David Miller
2014-05-21 20:14 ` David Miller
2014-05-22 20:06 ` Bandan Das
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=53715D67.8020803@davidnewall.com \
--to=davidn@davidnewall.com \
--cc=bandan.das@stratus.com \
--cc=eric.dumazet@gmail.com \
--cc=fw@strlen.de \
--cc=luky-37@hotmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.