Commit f86caea
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 71dae04 commit f86caea
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1822 | 1822 | | |
1823 | 1823 | | |
1824 | 1824 | | |
| 1825 | + | |
1825 | 1826 | | |
1826 | 1827 | | |
1827 | 1828 | | |
| |||
1836 | 1837 | | |
1837 | 1838 | | |
1838 | 1839 | | |
| 1840 | + | |
1839 | 1841 | | |
1840 | 1842 | | |
1841 | 1843 | | |
| |||
1850 | 1852 | | |
1851 | 1853 | | |
1852 | 1854 | | |
1853 | | - | |
| 1855 | + | |
1854 | 1856 | | |
1855 | 1857 | | |
1856 | 1858 | | |
| |||
0 commit comments