Commit 4eb726b
committed
netdev-dpdk: Fix vhost_driver_flags data race in destruct.
Coverity reports a data race where netdev_dpdk_vhost_destruct()
accesses vhost_driver_flags without holding dpdk_mutex, while
netdev_dpdk_vhost_client_reconfigure() writes to vhost_driver_flags
with the mutex held (as is done 4 out of 4 times when writing).
This could cause a race if another thread modifies vhost_driver_flags
through netdev_dpdk_vhost_client_reconfigure() at the same time the
destructor is running, potentially leading to incorrect socket cleanup.
Fix by capturing the flag value while holding dpdk_mutex, similar to how
vhost_id is already handled.
Fixes: c1ff66a ("netdev-dpdk: vHost client mode and reconnect")
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Mike Pattrick <mkp@redhat.com>
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>1 parent fc9442d commit 4eb726b
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1843 | 1843 | | |
1844 | 1844 | | |
1845 | 1845 | | |
| 1846 | + | |
1846 | 1847 | | |
1847 | 1848 | | |
1848 | 1849 | | |
| |||
1857 | 1858 | | |
1858 | 1859 | | |
1859 | 1860 | | |
| 1861 | + | |
1860 | 1862 | | |
1861 | 1863 | | |
1862 | 1864 | | |
| |||
1871 | 1873 | | |
1872 | 1874 | | |
1873 | 1875 | | |
1874 | | - | |
| 1876 | + | |
1875 | 1877 | | |
1876 | 1878 | | |
1877 | 1879 | | |
| |||
0 commit comments