All of lore.kernel.org
 help / color / mirror / Atom feed
* Please apply "xen-netback: delete NAPI instance when queue fails to initialize" to v4.4.y
@ 2021-02-24 17:03 SeongJae Park
  2021-02-24 17:21 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: SeongJae Park @ 2021-02-24 17:03 UTC (permalink / raw)
  To: gregkh, sashal
  Cc: aams, markubo, linux-kernel, # 4 . 4 . y, David Vrabel,
	David S . Miller

This is a request for merge of upstream commit 4a658527271b ("xen-netback:
delete NAPI instance when queue fails to initialize") on v4.4.y tree.

If 'xenvif_connect()' fails after successful 'netif_napi_add()', the napi is
not cleaned up.  Because 'create_queues()' frees the queues in its error
handling code, if the 'xenvif_free()' is called for the vif, use-after-free
occurs. The upstream commit fixes the problem by cleaning up the napi in the
'xenvif_connect()'.

Attaching the original patch below for your convenience.

Tested-by: Markus Boehme <markubo@amazon.de>


Thanks,
SeongJae Park

==================================== >8 =======================================
From 4a658527271bce43afb1cf4feec89afe6716ca59 Mon Sep 17 00:00:00 2001
From: David Vrabel <david.vrabel@citrix.com>
Date: Fri, 15 Jan 2016 14:55:35 +0000
Subject: [PATCH] xen-netback: delete NAPI instance when queue fails to
 initialize

When xenvif_connect() fails it may leave a stale NAPI instance added to
the device.  Make sure we delete it in the error path.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
 drivers/net/xen-netback/interface.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
index e7bd63eb2876..3bba6ceee132 100644
--- a/drivers/net/xen-netback/interface.c
+++ b/drivers/net/xen-netback/interface.c
@@ -615,6 +615,7 @@ int xenvif_connect(struct xenvif_queue *queue, unsigned long tx_ring_ref,
 	queue->tx_irq = 0;
 err_unmap:
 	xenvif_unmap_frontend_rings(queue);
+	netif_napi_del(&queue->napi);
 err:
 	module_put(THIS_MODULE);
 	return err;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-24 17:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-24 17:03 Please apply "xen-netback: delete NAPI instance when queue fails to initialize" to v4.4.y SeongJae Park
2021-02-24 17:21 ` Greg KH
2021-02-24 17:47   ` SeongJae Park

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.