From: Florian Westphal <fw@strlen.de>
To: Sander Eikelenboom <linux@eikelenboom.it>
Cc: netdev@vger.kernel.org, netfilter@vger.kernel.org,
Pablo Neira Ayuso <pablo@netfilter.org>
Subject: Re: Netfilter: BUG: unable to handle kernel paging request, RIP: physdev_mt+0xd6/0x160
Date: Sun, 13 Sep 2015 20:06:20 +0200 [thread overview]
Message-ID: <20150913180620.GK24810@breakpoint.cc> (raw)
In-Reply-To: <1620a50057d1e8aadafe27c74ee42d93@eikelenboom.it>
Sander Eikelenboom <linux@eikelenboom.it> wrote:
> Using a linux-4.3-rc1 kernel i encountered the splat below:
Thanks for reporting this bug.
> [ 290.200642] BUG: unable to handle kernel paging request at
> 000000000484195d
> [ 290.211702] IP: [<ffffffff819bc3e6>] physdev_mt+0xd6/0x160
[..]
> [ 290.444088] [<ffffffff81a4e6c0>] ipt_do_table+0x210/0x390
> [ 290.461951] [<ffffffff81a510ae>] iptable_filter_hook+0x2e/0x70
> [ 290.470756] [<ffffffff8199279c>] nf_iterate+0x4c/0x80
> [ 290.479587] [<ffffffff81992834>] nf_hook_slow+0x64/0xc0
> [ 290.488341] [<ffffffff81a06779>] ip_forward+0x369/0x3c0
> [ 290.496927] [<ffffffff81a06380>] ? ip_frag_mem+0x40/0x40
> [ 290.505365] [<ffffffff81a04961>] ip_rcv_finish+0x101/0x330
> [ 290.513480] [<ffffffff81a05001>] ip_rcv+0x291/0x390
> [ 290.521562] [<ffffffff81a04860>] ?
Aye, ip forwarding of bridged packets with call-iptables=1 is broken.
Please, could you try this patch? It fixes this bug for me.
diff --git a/net/bridge/br_netfilter_hooks.c b/net/bridge/br_netfilter_hooks.c
--- a/net/bridge/br_netfilter_hooks.c
+++ b/net/bridge/br_netfilter_hooks.c
@@ -355,6 +355,7 @@ static int br_nf_pre_routing_finish(struct sock *sk, struct sk_buff *skb)
struct iphdr *iph = ip_hdr(skb);
struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
struct rtable *rt;
+ bool daddr_changed;
int err;
nf_bridge->frag_max_size = IPCB(skb)->frag_max_size;
@@ -363,8 +364,15 @@ static int br_nf_pre_routing_finish(struct sock *sk, struct sk_buff *skb)
skb->pkt_type = PACKET_OTHERHOST;
nf_bridge->pkt_otherhost = false;
}
+
+ /* set physoutdev to NULL, its set by the bridge forward hook but
+ * frame might be routed instead of bridged.
+ */
+ daddr_changed = br_nf_ipv4_daddr_was_changed(skb, nf_bridge);
+ nf_bridge->physoutdev = NULL;
nf_bridge->in_prerouting = 0;
- if (br_nf_ipv4_daddr_was_changed(skb, nf_bridge)) {
+
+ if (daddr_changed) {
if ((err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, dev))) {
struct in_device *in_dev = __in_dev_get_rcu(dev);
diff --git a/net/bridge/br_netfilter_ipv6.c b/net/bridge/br_netfilter_ipv6.c
index 77383bf..772222b 100644
--- a/net/bridge/br_netfilter_ipv6.c
+++ b/net/bridge/br_netfilter_ipv6.c
@@ -167,6 +167,7 @@ static int br_nf_pre_routing_finish_ipv6(struct sock *sk, struct sk_buff *skb)
struct rtable *rt;
struct net_device *dev = skb->dev;
const struct nf_ipv6_ops *v6ops = nf_get_ipv6_ops();
+ bool daddr_changed;
nf_bridge->frag_max_size = IP6CB(skb)->frag_max_size;
@@ -174,8 +175,12 @@ static int br_nf_pre_routing_finish_ipv6(struct sock *sk, struct sk_buff *skb)
skb->pkt_type = PACKET_OTHERHOST;
nf_bridge->pkt_otherhost = false;
}
+
+ daddr_changed = br_nf_ipv6_daddr_was_changed(skb, nf_bridge);
+ nf_bridge->physoutdev = NULL;
nf_bridge->in_prerouting = 0;
- if (br_nf_ipv6_daddr_was_changed(skb, nf_bridge)) {
+
+ if (daddr_changed) {
skb_dst_drop(skb);
v6ops->route_input(skb);
next prev parent reply other threads:[~2015-09-13 18:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-13 11:34 Netfilter: BUG: unable to handle kernel paging request, RIP: physdev_mt+0xd6/0x160 Sander Eikelenboom
2015-09-13 18:06 ` Florian Westphal [this message]
2015-09-14 7:50 ` Sander Eikelenboom
2015-09-14 14:45 ` Florian Westphal
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=20150913180620.GK24810@breakpoint.cc \
--to=fw@strlen.de \
--cc=linux@eikelenboom.it \
--cc=netdev@vger.kernel.org \
--cc=netfilter@vger.kernel.org \
--cc=pablo@netfilter.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).