Patch "netvsc: fix deadlock betwen link status and removal" has been added to the 4.12-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
netvsc: fix deadlock betwen link status and removal
to the 4.12-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
netvsc-fix-deadlock-betwen-link-status-and-removal.patch
and it can be found in the queue-4.12 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Thu Sep 14 23:20:23 PDT 2017
From: stephen hemminger <[email protected]>
Date: Thu, 24 Aug 2017 16:49:16 -0700
Subject: netvsc: fix deadlock betwen link status and removal
From: stephen hemminger <[email protected]>
[ Upstream commit 9b4e946ce14e20d7addbfb7d9139e604f9fda107 ]
There is a deadlock possible when canceling the link status delayed work queue. The removal process is run with RTNL held, and the link status callback is acquring RTNL.
Resolve the issue by using trylock and rescheduling. If cancel is in process, that block it from happening.
--- drivers/net/hyperv/netvsc_drv.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/hyperv/netvsc_drv.c +6 -1
@@ -1270,7 +1270,12 @@ static void netvsc_link_change(struct wobool notify = false, reschedule = false;unsigned long flags, next_reconfig, delay; -rtnl_lock (); +/* if changes are happening, comeback later */ +if (!rtnl_trylock ()) { +schedule_delayed_work (&ndev_ctx->dwork,LINKCHANGE_INT ); +return ; + } + net_device =rtnl_dereference (ndev_ctx->nvdev);if (!net_device) goto out_unlock;
Patches currently in stable-queue which might be from [email protected] are
queue-4.12/netvsc-fix-deadlock-betwen-link-status-and-removal.patch