The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Satish Kharat <satishkh@cisco.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Breno Leitao <leitao@debian.org>,
	Sesidhar Baddela <sebaddel@cisco.com>
Subject: Re: [PATCH net-next v12 01/12] enic: cancel tx_hang_reset work on device removal
Date: Mon, 27 Jul 2026 17:37:41 -0700	[thread overview]
Message-ID: <20260727173741.67147e9f@kernel.org> (raw)
In-Reply-To: <20260719-enic-sriov-v2-admin-channel-v2-v12-1-6ff2c617001d@cisco.com>

On Sun, 19 Jul 2026 01:41:45 -0700 Satish Kharat wrote:
> enic_remove() cancels the reset and change_mtu_work items but does not
> cancel tx_hang_reset.  A TX timeout that fires while the device is being
> removed can schedule enic_tx_hang_reset() so that it runs after
> free_netdev(), resulting in a use-after-free.
> 
> Cancel tx_hang_reset alongside the other work items before
> unregister_netdev().
> 
> This is a pre-existing issue, not introduced by the SR-IOV V2 series;
> it is included here as an independent fix.
> 
> Fixes: 937317c7c109 ("enic: do hang reset only in case of tx timeout")
> Signed-off-by: Satish Kharat <satishkh@cisco.com>

Since this is a fix it should go separately to the net tree.
If there is a conflict the net-next submission will have to wait for
the fix to propagate there.

> diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
> index e7125b818087..b65796d96efc 100644
> --- a/drivers/net/ethernet/cisco/enic/enic_main.c
> +++ b/drivers/net/ethernet/cisco/enic/enic_main.c
> @@ -3012,6 +3012,7 @@ static void enic_remove(struct pci_dev *pdev)
>  		struct enic *enic = netdev_priv(netdev);
>  
>  		cancel_work_sync(&enic->reset);
> +		cancel_work_sync(&enic->tx_hang_reset);

Is this enough? The work may get scheduled between the cancel and 
the unregister, right? disable_work_sync() is probably the answer.

>  		cancel_work_sync(&enic->change_mtu_work);
>  		unregister_netdev(netdev);
>  		enic_dev_deinit(enic);
-- 
pw-bot: cr

  reply	other threads:[~2026-07-28  0:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-19  8:41 [PATCH net-next v12 00/12] enic: SR-IOV V2 admin channel and MBOX protocol Satish Kharat
2026-07-19  8:41 ` [PATCH net-next v12 01/12] enic: cancel tx_hang_reset work on device removal Satish Kharat
2026-07-28  0:37   ` Jakub Kicinski [this message]
2026-07-19  8:41 ` [PATCH net-next v12 02/12] enic: verify firmware supports V2 SR-IOV at probe time Satish Kharat
2026-07-19  8:41 ` [PATCH net-next v12 03/12] enic: add admin channel open and close for SR-IOV Satish Kharat
2026-07-19  8:41 ` [PATCH net-next v12 04/12] enic: add admin RQ buffer management Satish Kharat
2026-07-19  8:41 ` [PATCH net-next v12 05/12] enic: add admin CQ service with MSI-X interrupt and workqueue polling Satish Kharat
2026-07-28  0:41   ` Jakub Kicinski
2026-07-28  0:41   ` Jakub Kicinski
2026-07-19  8:41 ` [PATCH net-next v12 06/12] enic: define MBOX message types and header structures Satish Kharat
2026-07-19  8:41 ` [PATCH net-next v12 07/12] enic: add MBOX core send and receive for admin channel Satish Kharat
2026-07-19  8:41 ` [PATCH net-next v12 08/12] enic: add MBOX PF handlers for VF register and capability Satish Kharat
2026-07-19  8:41 ` [PATCH net-next v12 09/12] enic: add MBOX VF handlers for capability, register and link state Satish Kharat
2026-07-19  8:41 ` [PATCH net-next v12 10/12] enic: wire V2 SR-IOV enable with admin channel and MBOX Satish Kharat
2026-07-19  8:41 ` [PATCH net-next v12 11/12] enic: add V2 VF probe with admin channel and PF registration Satish Kharat
2026-07-19  8:41 ` [PATCH net-next v12 12/12] enic: re-establish V2 VF admin channel and PF registration after reset Satish Kharat

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=20260727173741.67147e9f@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=satishkh@cisco.com \
    --cc=sebaddel@cisco.com \
    /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