[PATCH 0/1] nwfilter: Fix deadlock between nwfilter-list and VM startup/migration

Dion Bosschieter posted 1 patch 10 months ago
Failed in applying to current master (apply log)
src/nwfilter/nwfilter_driver.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
[PATCH 0/1] nwfilter: Fix deadlock between nwfilter-list and VM startup/migration
Posted by Dion Bosschieter 10 months ago
A deadlock occurs when `nwfilterBindingCreateXML` and `nwfilterConnectListAllNWFilters`
acquire locks in an inconsistent order. This affects both incoming migrations and
VM startups (`virsh start`), where `nwfilterBindingCreateXML` needs `updateLock`,
while `nwfilter-list` first acquires `driverMutex` and then locks individual filters.

This patch resolves the deadlock by ensuring `nwfilterBindingCreateXML` acquires
`driverMutex` before `updateLock`, following the locking pattern used by other
functions like `undefine` `nwfilterStateReload`.

Added the use of `driverMutex` in `nwfilterBindingDelete` to maintain
consistent locking order, as suggested.

Fixes: https://gitlab.com/libvirt/libvirt/-/issues/680

Dion Bosschieter (1):
  nwfilter: Fix deadlock between nwfilter-list and VM startup/migration

 src/nwfilter/nwfilter_driver.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

-- 
2.39.3 (Apple Git-146)
Re: [PATCH 0/1] nwfilter: Fix deadlock between nwfilter-list and VM startup/migration
Posted by dionbosschieter@gmail.com 9 months, 2 weeks ago
Hi,  

Just a gentle ping on this patch.  
Any feedback would be appreciated.  

Thanks!  
Dion