Bug 70681
Summary: | broadcast gre causes oops | ||
---|---|---|---|
Product: | Networking | Reporter: | Andreas Steinmetz (ast) |
Component: | IPV4 | Assignee: | Stephen Hemminger (stephen) |
Status: | NEW --- | ||
Severity: | normal | CC: | alex.zeffertt, lucien.xin |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 3.13.2 | Subsystem: | |
Regression: | No | Bisected commit-id: |
Description
Andreas Steinmetz
2014-02-16 22:17:34 UTC
From b4ddc591e46a884e77092788ec25c36e42ac3304 Mon Sep 17 00:00:00 2001 From: Xin Long <lucien.xin@gmail.com> Date: Mon, 3 Mar 2014 20:04:33 +0800 Subject: [PATCH] ip_tunnel:multicast process cause panic due to skb->_skb_refdst NULL pointer when ip_tunnel process multicast packets, it may check if the packet is looped back packet though 'rt_is_output_route(skb_rtable(skb))' in ip_tunnel_rcv(), but before that , skb->_skb_refdst has been dropped in iptunnel_pull_header(), so which leads to a panic. fix the bug: https://bugzilla.kernel.org/show_bug.cgi?id=70681 Signed-off-by: Xin Long <lucien.xin@gmail.com> --- net/ipv4/ip_tunnel_core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c index 6156f4e..88b08aa 100644 --- a/net/ipv4/ip_tunnel_core.c +++ b/net/ipv4/ip_tunnel_core.c @@ -108,7 +108,6 @@ int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto) nf_reset(skb); secpath_reset(skb); skb_clear_hash_if_not_l4(skb); - skb_dst_drop(skb); skb->vlan_tci = 0; skb_set_queue_mapping(skb, 0); skb->pkt_type = PACKET_HOST; -- 1.8.3.1 I've been seeing exactly the same kernel oops on my Ubuntu 13.10 system. I can reproduce the crash by creating multiple LXC containers (each of which has a bridge of gretap interfaces) and then forcibly destroying the containers. I tried applying the above patch (to linux-source-3.11.0 version 3.11.0-18.32) but now I get a crash when the containers (and therefore the gretap interfaces) are being created. Apologies if I am supposed to be using a different kernel! Here is the new oops: [ 15.448092] BUG: unable to handle kernel paging request at fffffffc [ 15.448958] IP: [<c15c190d>] ipv6_rcv+0x13d/0x500 [ 15.449524] *pdpt = 0000000001a1a001 *pde = 0000000001a21067 *pte = 0000000000000000 [ 15.450455] Oops: 0000 [#1] SMP [ 15.450906] Modules linked in: ebt_mark_m ebtable_filter ip_gre gre ip_tunnel dummy macvlan overlayfs xt_conntrack ipt_REJECT xt_CHECKSUM iptable_mangle xt_tcpudp ip6table_filter ip6_tables iptable_filter ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack ip_tables x_tables bridge stp llc nfsd auth_rpcgss nfs_acl nfs lockd dm_multipath sunrpc scsi_dh psmouse microcode fscache virtio_balloon serio_raw lp parport ext2 floppy [ 15.453411] CPU: 1 PID: 1 Comm: init Not tainted 3.11.10.4 #1 [ 15.453411] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007 [ 15.453411] task: f6058000 ti: f60f0000 task.ti: f6036000 [ 15.453411] EIP: 0060:[<c15c190d>] EFLAGS: 00010286 CPU: 1 [ 15.453411] EIP is at ipv6_rcv+0x13d/0x500 [ 15.453411] EAX: fffffffc EBX: eb4ed3c0 ECX: 00000000 EDX: eb4ed3f0 [ 15.453411] ESI: eb486200 EDI: 00000018 EBP: f60f1ef8 ESP: f60f1ecc [ 15.453411] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 [ 15.453411] CR0: 80050033 CR2: fffffffc CR3: 36253000 CR4: 000006f0 [ 15.453411] Stack: [ 15.453411] eb4ed3c0 f60f1ef0 c156f5d2 00000000 00000024 ec7b5800 00000001 f3a04380 [ 15.453411] c1937340 eb4ed3c0 c1935e74 f60f1f30 c1544e33 ec7b5800 80000000 00000076 [ 15.453411] 00000000 c1937340 ec7b5800 c1935e88 eb4ed3c0 c1935e88 eb4ed3c0 eb664410 [ 15.453411] Call Trace: [ 15.453411] [<c156f5d2>] ? ip_rcv_finish+0x62/0x320 [ 15.453411] [<c1544e33>] __netif_receive_skb_core+0x4a3/0x630 [ 15.453411] [<c1544fd6>] __netif_receive_skb+0x16/0x60 [ 15.453411] [<c154503f>] netif_receive_skb+0x1f/0x80 [ 15.453411] [<c1545817>] napi_gro_receive+0x67/0x90 [ 15.453411] [<f8681aff>] gro_cell_poll+0x5f/0xa0 [ip_tunnel] [ 15.453411] [<c15452a2>] net_rx_action+0xa2/0x180 [ 15.453411] [<c1057531>] __do_softirq+0xc1/0x1d0 [ 15.453411] [<c1057470>] ? remote_softirq_receive+0xb0/0xb0 [ 15.453411] <IRQ> [ 15.453411] [<c10577a5>] ? irq_exit+0x95/0xa0 [ 15.453411] [<c1617758>] ? smp_apic_timer_interrupt+0x38/0x50 [ 15.453411] [<c16100dc>] ? apic_timer_interrupt+0x34/0x3c [ 15.453411] Code: f2 01 c2 f6 c1 02 74 09 31 ff 83 c2 02 66 89 7a fe 83 e1 01 74 03 c6 02 00 8b 43 48 83 e0 fe 0f 84 66 01 00 00 8b 80 c4 00 00 00 <8b> 00 8b 80 80 00 00 00 8b 53 4c 89 43 18 89 d0 2b 43 50 83 f8[ 15.477172] device ext1 entered promiscuous mode [ 15.453411] EIP: [<c15c190d>] ipv6_rcv+0x13d/0x500 SS:ESP 0068:f60f1ecc [ 15.453411] CR2: 00000000fffffffc [ 15.453411] ---[ end trace c7339aadbfd8dab1 ]--- [ 15.453411] Kernel panic - not syncing: Fatal exception in interrupt I've decided that my bug is actually different and so I've opened a new ticket (https://bugzilla.kernel.org/show_bug.cgi?id=72081). However, it's still the case that the patch above caused my system to crash. Regards, (In reply to Alex Zeffertt from comment #2) > > [ 15.453411] EIP: [<c15c190d>] ipv6_rcv+0x13d/0x500 SS:ESP 0068:f60f1ecc > [ 15.453411] CR2: 00000000fffffffc > [ 15.453411] ---[ end trace c7339aadbfd8dab1 ]--- > [ 15.453411] Kernel panic - not syncing: Fatal exception in interrupt hi, Alex, that patch actually cause this panic. a new patch may fix it perfectly. Commit 10ddceb22ba (ip_tunnel:multicast process cause panic due to skb->_skb_refdst NULL pointer) removed dst-drop call from ip-tunnel-recv. Following commit reintroduce dst-drop and fix the original bug by checking loopback packet before releasing dst. Original bug: https://bugzilla.kernel.org/show_bug.cgi?id=70681 CC: Xin Long <lucien.xin@gmail.com> Signed-off-by: Pravin B Shelar <pshelar@nicira.com> --- net/ipv4/gre_demux.c | 8 ++++++++ net/ipv4/ip_tunnel.c | 3 --- net/ipv4/ip_tunnel_core.c | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/net/ipv4/gre_demux.c b/net/ipv4/gre_demux.c index 1863422f..250be74 100644 --- a/net/ipv4/gre_demux.c +++ b/net/ipv4/gre_demux.c @@ -182,6 +182,14 @@ static int gre_cisco_rcv(struct sk_buff *skb) int i; bool csum_err = false; +#ifdef CONFIG_NET_IPGRE_BROADCAST + if (ipv4_is_multicast(ip_hdr(skb)->daddr)) { + /* Looped back packet, drop it! */ + if (rt_is_output_route(skb_rtable(skb))) + goto drop; + } +#endif + if (parse_gre_header(skb, &tpi, &csum_err) < 0) goto drop; diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index 78a89e6..a82a22d 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c @@ -416,9 +416,6 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb, #ifdef CONFIG_NET_IPGRE_BROADCAST if (ipv4_is_multicast(iph->daddr)) { - /* Looped back packet, drop it! */ - if (rt_is_output_route(skb_rtable(skb))) - goto drop; tunnel->dev->stats.multicast++; skb->pkt_type = PACKET_BROADCAST; } diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c index 6f847dd..8d69626 100644 --- a/net/ipv4/ip_tunnel_core.c +++ b/net/ipv4/ip_tunnel_core.c @@ -108,6 +108,7 @@ int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto) nf_reset(skb); secpath_reset(skb); skb_clear_hash_if_not_l4(skb); + skb_dst_drop(skb); skb->vlan_tci = 0; skb_set_queue_mapping(skb, 0); skb->pkt_type = PACKET_HOST; |