All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org,
	Chris Cormier <chriscormier@cumulusnetworks.com>,
	Nikolay Aleksandrov <nikolay@cumulusnetworks.com>,
	David Ahern <dsahern@gmail.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 4.12 11/84] vrf: fix bug_on triggered by rx when destroying a vrf
Date: Wed, 19 Jul 2017 11:43:17 +0200	[thread overview]
Message-ID: <20170719092322.814654222@linuxfoundation.org> (raw)
In-Reply-To: <20170719092322.362625377@linuxfoundation.org>

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

------------------

From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>


[ Upstream commit f630c38ef0d785101363a8992bbd4f302180f86f ]

When destroying a VRF device we cleanup the slaves in its ndo_uninit()
function, but that causes packets to be switched (skb->dev == vrf being
destroyed) even though we're pass the point where the VRF should be
receiving any packets while it is being dismantled. This causes a BUG_ON
to trigger if we have raw sockets (trace below).
The reason is that the inetdev of the VRF has been destroyed but we're
still sending packets up the stack with it, so let's free the slaves in
the dellink callback as David Ahern suggested.

Note that this fix doesn't prevent packets from going up when the VRF
device is admin down.

[   35.631371] ------------[ cut here ]------------
[   35.631603] kernel BUG at net/ipv4/fib_frontend.c:285!
[   35.631854] invalid opcode: 0000 [#1] SMP
[   35.631977] Modules linked in:
[   35.632081] CPU: 2 PID: 22 Comm: ksoftirqd/2 Not tainted 4.12.0-rc7+ #45
[   35.632247] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
[   35.632477] task: ffff88005ad68000 task.stack: ffff88005ad64000
[   35.632632] RIP: 0010:fib_compute_spec_dst+0xfc/0x1ee
[   35.632769] RSP: 0018:ffff88005ad67978 EFLAGS: 00010202
[   35.632910] RAX: 0000000000000001 RBX: ffff880059a7f200 RCX: 0000000000000000
[   35.633084] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffffffff82274af0
[   35.633256] RBP: ffff88005ad679f8 R08: 000000000001ef70 R09: 0000000000000046
[   35.633430] R10: ffff88005ad679f8 R11: ffff880037731cb0 R12: 0000000000000001
[   35.633603] R13: ffff8800599e3000 R14: 0000000000000000 R15: ffff8800599cb852
[   35.634114] FS:  0000000000000000(0000) GS:ffff88005d900000(0000) knlGS:0000000000000000
[   35.634306] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   35.634456] CR2: 00007f3563227095 CR3: 000000000201d000 CR4: 00000000000406e0
[   35.634632] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   35.634865] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[   35.635055] Call Trace:
[   35.635271]  ? __lock_acquire+0xf0d/0x1117
[   35.635522]  ipv4_pktinfo_prepare+0x82/0x151
[   35.635831]  raw_rcv_skb+0x17/0x3c
[   35.636062]  raw_rcv+0xe5/0xf7
[   35.636287]  raw_local_deliver+0x169/0x1d9
[   35.636534]  ip_local_deliver_finish+0x87/0x1c4
[   35.636820]  ip_local_deliver+0x63/0x7f
[   35.637058]  ip_rcv_finish+0x340/0x3a1
[   35.637295]  ip_rcv+0x314/0x34a
[   35.637525]  __netif_receive_skb_core+0x49f/0x7c5
[   35.637780]  ? lock_acquire+0x13f/0x1d7
[   35.638018]  ? lock_acquire+0x15e/0x1d7
[   35.638259]  __netif_receive_skb+0x1e/0x94
[   35.638502]  ? __netif_receive_skb+0x1e/0x94
[   35.638748]  netif_receive_skb_internal+0x74/0x300
[   35.639002]  ? dev_gro_receive+0x2ed/0x411
[   35.639246]  ? lock_is_held_type+0xc4/0xd2
[   35.639491]  napi_gro_receive+0x105/0x1a0
[   35.639736]  receive_buf+0xc32/0xc74
[   35.639965]  ? detach_buf+0x67/0x153
[   35.640201]  ? virtqueue_get_buf_ctx+0x120/0x176
[   35.640453]  virtnet_poll+0x128/0x1c5
[   35.640690]  net_rx_action+0x103/0x343
[   35.640932]  __do_softirq+0x1c7/0x4b7
[   35.641171]  run_ksoftirqd+0x23/0x5c
[   35.641403]  smpboot_thread_fn+0x24f/0x26d
[   35.641646]  ? sort_range+0x22/0x22
[   35.641878]  kthread+0x129/0x131
[   35.642104]  ? __list_add+0x31/0x31
[   35.642335]  ? __list_add+0x31/0x31
[   35.642568]  ret_from_fork+0x2a/0x40
[   35.642804] Code: 05 bd 87 a3 00 01 e8 1f ef 98 ff 4d 85 f6 48 c7 c7 f0 4a 27 82 41 0f 94 c4 31 c9 31 d2 41 0f b6 f4 e8 04 71 a1 ff 45 84 e4 74 02 <0f> 0b 0f b7 93 c4 00 00 00 4d 8b a5 80 05 00 00 48 03 93 d0 00
[   35.644342] RIP: fib_compute_spec_dst+0xfc/0x1ee RSP: ffff88005ad67978

Fixes: 193125dbd8eb ("net: Introduce VRF device driver")
Reported-by: Chris Cormier <chriscormier@cumulusnetworks.com>
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Acked-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/vrf.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -926,15 +926,10 @@ static int vrf_del_slave(struct net_devi
 static void vrf_dev_uninit(struct net_device *dev)
 {
 	struct net_vrf *vrf = netdev_priv(dev);
-	struct net_device *port_dev;
-	struct list_head *iter;
 
 	vrf_rtable_release(dev, vrf);
 	vrf_rt6_release(dev, vrf);
 
-	netdev_for_each_lower_dev(dev, port_dev, iter)
-		vrf_del_slave(dev, port_dev);
-
 	free_percpu(dev->dstats);
 	dev->dstats = NULL;
 }
@@ -1389,6 +1384,12 @@ static int vrf_validate(struct nlattr *t
 
 static void vrf_dellink(struct net_device *dev, struct list_head *head)
 {
+	struct net_device *port_dev;
+	struct list_head *iter;
+
+	netdev_for_each_lower_dev(dev, port_dev, iter)
+		vrf_del_slave(dev, port_dev);
+
 	unregister_netdevice_queue(dev, head);
 }
 

  parent reply	other threads:[~2017-07-19  9:45 UTC|newest]

Thread overview: 106+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-19  9:43 [PATCH 4.12 00/84] 4.12.3-stable review Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 01/84] staging: android: uapi: drop definitions of removed ION_IOC_{FREE,SHARE} ioctls Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 02/84] net/mlx5: Fix driver load error flow when firmware is stuck Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 03/84] net/mlx5: Cancel delayed recovery work when unloading the driver Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 04/84] net/mlx5e: Fix TX carrier errors report in get stats ndo Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 05/84] ipv6: dad: dont remove dynamic addresses if link is down Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 06/84] vxlan: fix hlist corruption Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 08/84] net: core: Fix slab-out-of-bounds in netdev_stats_to_stats64 Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 09/84] liquidio: fix bug in soft reset failure detection Greg Kroah-Hartman
2017-07-19  9:43 ` Greg Kroah-Hartman [this message]
2017-07-19  9:43 ` [PATCH 4.12 12/84] virtio-net: fix leaking of ctx array Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 13/84] rds: tcp: use sock_create_lite() to create the accept socket Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 14/84] net/mlx5e: Initialize CEEs getpermhwaddr address buffer to 0xff Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 15/84] cxgb4: fix BUG() on interrupt deallocating path of ULD Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 16/84] tap: convert a mutex to a spinlock Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 17/84] bridge: mdb: fix leak on complete_info ptr on fail path Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 19/84] sfc: dont read beyond unicast address list Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 20/84] Adding asm-prototypes.h for genksyms to generate crc Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 21/84] sed regex in Makefile.build requires line break between exported symbols Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 22/84] Adding the type of " Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 23/84] sparc64: Fix gup_huge_pmd Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 24/84] brcmfmac: Fix a memory leak in error handling path in brcmf_cfg80211_attach Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 25/84] brcmfmac: Fix glom_skb leak in brcmf_sdiod_recv_chain Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 26/84] x86/xen/efi: Initialize only the EFI struct members used by Xen Greg Kroah-Hartman
2017-07-19  9:43   ` Greg Kroah-Hartman
2017-07-19 10:37   ` Daniel Kiper
2017-07-19 10:37   ` Daniel Kiper
2017-07-19 11:12     ` Greg Kroah-Hartman
2017-07-19 11:19       ` Greg Kroah-Hartman
2017-07-19 11:19       ` Greg Kroah-Hartman
2017-07-19 11:57         ` Daniel Kiper
2017-07-19 11:57         ` Daniel Kiper
2017-07-19 11:28       ` Daniel Kiper
2017-07-19 11:28       ` Daniel Kiper
2017-07-19 11:12     ` Greg Kroah-Hartman
2017-07-20  8:39     ` Ingo Molnar
2017-07-20  8:39       ` Ingo Molnar
2017-07-20  9:16       ` Greg Kroah-Hartman
2017-07-20  9:16       ` Greg Kroah-Hartman
2017-07-20  9:41         ` Ingo Molnar
2017-07-20  9:41           ` Ingo Molnar
2017-07-20  9:41         ` Ingo Molnar
2017-07-20 12:33         ` Daniel Kiper
2017-07-20 12:33         ` Daniel Kiper
2017-07-20 12:33           ` Daniel Kiper
2017-07-21  6:32           ` Juergen Gross
2017-07-21  6:32           ` Juergen Gross
2017-07-21  6:32             ` Juergen Gross
2017-07-19  9:43 ` [PATCH 4.12 27/84] efi: Process the MEMATTR table only if EFI_MEMMAP is enabled Greg Kroah-Hartman
2017-07-19  9:43 ` Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 28/84] cfg80211: Define nla_policy for NL80211_ATTR_LOCAL_MESH_POWER_MODE Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 29/84] cfg80211: Validate frequencies nested in NL80211_ATTR_SCAN_FREQUENCIES Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 30/84] cfg80211: Check if PMKID attribute is of expected size Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 31/84] cfg80211: Check if NAN service ID " Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 32/84] drm/amdgpu/gfx6: properly cache mc_arb_ramcfg Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 33/84] KVM: ARM64: fix phy counter access failure in guest Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 34/84] KVM: PPC: Book3S: Fix typo in XICS-on-XIVE state saving code Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 35/84] kvm-vfio: Decouple only when we match a group Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 36/84] irqchip/gic-v3: Fix out-of-bound access in gic_set_affinity Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 37/84] parisc: Report SIGSEGV instead of SIGBUS when running out of stack Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 38/84] parisc: use compat_sys_keyctl() Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 39/84] parisc: DMA API: return error instead of BUG_ON for dma ops on non dma devs Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 40/84] parisc/mm: Ensure IRQs are off in switch_mm() Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 41/84] tools/lib/lockdep: Reduce MAX_LOCK_DEPTH to avoid overflowing lock_chain/: Depth Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 42/84] compiler, clang: always inline when CONFIG_OPTIMIZE_INLINING is disabled Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 43/84] thp, mm: fix crash due race in MADV_FREE handling Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 44/84] kernel/extable.c: mark core_kernel_text notrace Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 45/84] mm/list_lru.c: fix list_lru_count_node() to be race free Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 46/84] fs/dcache.c: fix spin lockup issue on nlru->lock Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 47/84] checkpatch: silence perl 5.26.0 unescaped left brace warnings Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 48/84] binfmt_elf: use ELF_ET_DYN_BASE only for PIE Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 49/84] arm: move ELF_ET_DYN_BASE to 4MB Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 50/84] arm64: move ELF_ET_DYN_BASE to 4GB / 4MB Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 51/84] powerpc: " Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 52/84] s390: reduce ELF_ET_DYN_BASE Greg Kroah-Hartman
2017-07-19  9:43 ` [PATCH 4.12 53/84] exec: Limit arg stack to at most 75% of _STK_LIM Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 54/84] powerpc/kexec: Fix radix to hash kexec due to IAMR/AMOR Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 55/84] ARM64: dts: marvell: armada37xx: Fix timer interrupt specifiers Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 56/84] arm64: Preventing READ_IMPLIES_EXEC propagation Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 57/84] vt: fix unchecked __put_user() in tioclinux ioctls Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 58/84] rcu: Add memory barriers for NOCB leader wakeup Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 59/84] nvmem: core: fix leaks on registration errors Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 60/84] Drivers: hv: vmbus: Close timing hole that can corrupt per-cpu page Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 61/84] mnt: In umount propagation reparent in a separate pass Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 62/84] mnt: In propgate_umount handle visiting mounts in any order Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 63/84] mnt: Make propagate_umount less slow for overlapping mount propagation trees Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 64/84] selftests/capabilities: Fix the test_execve test Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 67/84] crypto: atmel - only treat EBUSY as transient if backlog Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 68/84] crypto: sha1-ssse3 - Disable avx2 Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 71/84] KEYS: DH: validate __spare field Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 72/84] sched/headers/uapi: Fix linux/sched/types.h userspace compilation errors Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 73/84] sched/topology: Fix building of overlapping sched-groups Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 74/84] sched/topology: Optimize build_group_mask() Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 75/84] sched/topology: Fix overlapping sched_group_mask Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 76/84] PM / wakeirq: Convert to SRCU Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 77/84] pstore: Fix leaked pstore_record in pstore_get_backend_records() Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 79/84] ALSA: hda/realtek - change the location for one of two front microphones Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 80/84] PM / QoS: return -EINVAL for bogus strings Greg Kroah-Hartman
2017-07-19  9:44 ` [PATCH 4.12 84/84] kvm: vmx: allow host to access guest MSR_IA32_BNDCFGS Greg Kroah-Hartman
     [not found] ` <596f88cd.48b4df0a.797d0.d5e3@mx.google.com>
2017-07-19 16:36   ` [PATCH 4.12 00/84] 4.12.3-stable review Shuah Khan
2017-07-22 15:47     ` Kevin Hilman
2017-07-24  9:11       ` Sjoerd Simons
     [not found]   ` <7hfudosc1k.fsf@baylibre.com>
2017-08-01  8:21     ` Jan Lübbe
2017-07-19 20:35 ` Guenter Roeck
2017-07-20  5:06   ` Greg Kroah-Hartman
2017-07-19 23:37 ` Shuah Khan

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=20170719092322.814654222@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=chriscormier@cumulusnetworks.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.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.