Commit bec3ae2
hv_netvsc: fix race of netvsc and VF register_netdevice
[ Upstream commit d30fb71 ]
The rtnl lock also needs to be held before rndis_filter_device_add()
which advertises nvsp_2_vsc_capability / sriov bit, and triggers
VF NIC offering and registering. If VF NIC finished register_netdev()
earlier it may cause name based config failure.
To fix this issue, move the call to rtnl_lock() before
rndis_filter_device_add(), so VF will be registered later than netvsc
/ synthetic NIC, and gets a name numbered (ethX) after netvsc.
Cc: stable@vger.kernel.org
Fixes: e04e7a7 ("hv_netvsc: Fix a deadlock by getting rtnl lock earlier in netvsc_probe()")
Reported-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 69732d2 commit bec3ae2
1 file changed
Lines changed: 15 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2563 | 2563 | | |
2564 | 2564 | | |
2565 | 2565 | | |
2566 | | - | |
2567 | | - | |
2568 | | - | |
2569 | | - | |
2570 | | - | |
2571 | | - | |
2572 | | - | |
2573 | | - | |
2574 | | - | |
2575 | 2566 | | |
2576 | 2567 | | |
2577 | 2568 | | |
2578 | 2569 | | |
2579 | 2570 | | |
2580 | 2571 | | |
2581 | 2572 | | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
| 2577 | + | |
2582 | 2578 | | |
2583 | 2579 | | |
2584 | 2580 | | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
2585 | 2590 | | |
2586 | 2591 | | |
2587 | 2592 | | |
| |||
2615 | 2620 | | |
2616 | 2621 | | |
2617 | 2622 | | |
2618 | | - | |
2619 | 2623 | | |
2620 | 2624 | | |
| 2625 | + | |
2621 | 2626 | | |
2622 | 2627 | | |
2623 | 2628 | | |
| |||
0 commit comments