All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: stable@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	Pravin B Shelar <pshelar@nicira.com>,
	Xin Long <lucien.xin@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jiri Slaby <jslaby@suse.cz>
Subject: [PATCH 3.12 56/72] ip_tunnel: Fix dst ref-count.
Date: Fri, 18 Apr 2014 11:22:29 +0200	[thread overview]
Message-ID: <71986b40bf31e6d726846409722b1ec91ada162c.1397812482.git.jslaby@suse.cz> (raw)
In-Reply-To: <3389f243c528afc7c7300c83b8f296290cd3656d.1397812482.git.jslaby@suse.cz>
In-Reply-To: <cover.1397812482.git.jslaby@suse.cz>

From: Pravin B Shelar <pshelar@nicira.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

[ Upstream commit fbd02dd405d0724a0f25897ed4a6813297c9b96f ]

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 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 736c9fc3ef93..0c0c1f09fd17 100644
--- a/net/ipv4/gre_demux.c
+++ b/net/ipv4/gre_demux.c
@@ -211,6 +211,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 995a0bb33a65..3bedb26cfb53 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -411,9 +411,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 ba22cc3a5a53..c31e3ad98ef2 100644
--- a/net/ipv4/ip_tunnel_core.c
+++ b/net/ipv4/ip_tunnel_core.c
@@ -109,6 +109,7 @@ int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto)
 	secpath_reset(skb);
 	if (!skb->l4_rxhash)
 		skb->rxhash = 0;
+	skb_dst_drop(skb);
 	skb->vlan_tci = 0;
 	skb_set_queue_mapping(skb, 0);
 	skb->pkt_type = PACKET_HOST;
-- 
1.9.2


  parent reply	other threads:[~2014-04-18  9:31 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-18  9:21 [PATCH 3.12 00/72] 3.12.18-stable review Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 01/72] powernow-k6: disable cache when changing frequency Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 02/72] powernow-k6: correctly initialize default parameters Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 03/72] powernow-k6: reorder frequencies Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 04/72] PCI: mvebu: move clock enable before register access Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 05/72] selinux: correctly label /proc inodes in use before the policy is loaded Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 06/72] futex: Allow architectures to skip futex_atomic_cmpxchg_inatomic() test Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 07/72] m68k: Skip " Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 08/72] Char: ipmi_bt_sm, fix infinite loop Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 09/72] nfs: initialize the ACL support bits to zero Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 10/72] NFSv3: Fix return value of nfs3_proc_setacls Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 11/72] SUNRPC: Fix potential memory scribble in xprt_free_bc_request() Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 12/72] ext4: Speedup WB_SYNC_ALL pass called from sync(2) Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 13/72] floppy: bail out in open() if drive is not responding to block0 read Jiri Slaby
2014-07-03 10:12   ` Olaf Hering
2014-07-04 21:22     ` Jiri Kosina
2014-04-18  9:21 ` [PATCH 3.12 14/72] drm/i915: Undo the PIPEA quirk for i845 Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 15/72] drm/cirrus: Fix cirrus drm driver for fbdev + qemu Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 16/72] drm/radeon: change audio enable logic Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 17/72] drm/radeon: enable speaker allocation setup on dce3.2 Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 18/72] drm: Prefer noninterlace cmdline mode unless explicitly specified Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 19/72] fb: reorder the lock sequence to fix potential dead lock Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 20/72] video/fb: Propagate error code from failing to unregister conflicting fb Jiri Slaby
2014-04-18  9:21   ` Jiri Slaby
2014-04-18  9:21   ` Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 21/72] fbdev: Make the switch from generic to native driver less alarming Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 22/72] drm: add drm_set_preferred_mode Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 23/72] drm/cirrus: use drm_set_preferred_mode Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 24/72] net: fix for a race condition in the inet frag code Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 25/72] net: sctp: fix skb leakage in COOKIE ECHO path of chunk->auth_chunk Jiri Slaby
2014-04-18  9:21 ` [PATCH 3.12 26/72] bridge: multicast: add sanity check for query source addresses Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 27/72] tipc: allow connection shutdown callback to be invoked in advance Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 28/72] tipc: fix connection refcount leak Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 29/72] tipc: drop subscriber connection id invalidation Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 30/72] tipc: fix memory leak during module removal Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 31/72] tipc: don't log disabled tasklet handler errors Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 32/72] inet: frag: make sure forced eviction removes all frags Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 33/72] net: unix: non blocking recvmsg() should not return -EINTR Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 34/72] ipv6: Fix exthdrs offload registration Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 35/72] ipv6: don't set DST_NOCOUNT for remotely added routes Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 36/72] bnx2: Fix shutdown sequence Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 37/72] pkt_sched: fq: do not hold qdisc lock while allocating memory Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 38/72] vlan: Set correct source MAC address with TX VLAN offload enabled Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 39/72] tcp: tcp_release_cb() should release socket ownership Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 40/72] bridge: multicast: add sanity check for general query destination Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 41/72] bridge: multicast: enable snooping on general queries only Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 42/72] net: socket: error on a negative msg_namelen Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 43/72] bonding: set correct vlan id for alb xmit path Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 44/72] eth: fec: Fix lost promiscuous mode after reconnecting cable Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 45/72] ipv6: Avoid unnecessary temporary addresses being generated Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 46/72] ipv6: ip6_append_data_mtu do not handle the mtu of the second fragment properly Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 47/72] vxlan: fix potential NULL dereference in arp_reduce() Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 48/72] vxlan: fix nonfunctional neigh_reduce() Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 49/72] tcp: syncookies: do not use getnstimeofday() Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 50/72] rtnetlink: fix fdb notification flags Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 51/72] ipmr: fix mfc " Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 52/72] ip6mr: " Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 53/72] net: micrel : ks8851-ml: add vdd-supply support Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 54/72] netpoll: fix the skb check in pkt_is_ns Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 55/72] tipc: fix spinlock recursion bug for failed subscriptions Jiri Slaby
2014-04-18  9:22 ` Jiri Slaby [this message]
2014-04-18  9:22 ` [PATCH 3.12 57/72] tg3: Do not include vlan acceleration features in vlan_features Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 58/72] usbnet: include wait queue head in device structure Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 59/72] vlan: Set hard_header_len according to available acceleration Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 60/72] vhost: fix total length when packets are too short Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 61/72] vhost: validate vhost_get_vq_desc return value Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 62/72] xen-netback: remove pointless clause from if statement Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 63/72] ipv6: some ipv6 statistic counters failed to disable bh Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 64/72] netlink: don't compare the nul-termination in nla_strcmp Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 65/72] xen-netback: disable rogue vif in kthread context Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 66/72] net: vxlan: fix crash when interface is created with no group Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 67/72] isdnloop: Validate NUL-terminated strings from user Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 68/72] isdnloop: several buffer overflows Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 69/72] rds: prevent dereference of a NULL device in rds_iw_laddr_check Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 70/72] ARC: [nsimosci] Change .dts to use generic 8250 UART Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 71/72] ARC: [nsimosci] Unbork console Jiri Slaby
2014-04-18  9:22 ` [PATCH 3.12 72/72] crypto: ghash-clmulni-intel - use C implementation for setkey() Jiri Slaby
2014-04-18 19:18 ` [PATCH 3.12 00/72] 3.12.18-stable review Guenter Roeck
2014-04-18 22:12 ` Shuah Khan
2014-04-24  7:46   ` Jiri Slaby

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=71986b40bf31e6d726846409722b1ec91ada162c.1397812482.git.jslaby@suse.cz \
    --to=jslaby@suse.cz \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=pshelar@nicira.com \
    --cc=stable@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.