[PATCH] virnwfilterbindingobj: Fix virNWFilterBindingObjNew()
Ján Tomko
jtomko at redhat.com
Tue Feb 1 10:50:15 UTC 2022
On a Tuesday in 2022, Michal Privoznik wrote:
>The idea behind virNWFilterBindingObjNew() is to create and
>return an object of virNWFilterBindingObjClass class. The class
>is virObjectLockable (and the corresponding
>_virNWFilterBindingObj structure has virObjectLockable parent).
>But for some reason plain virObjectNew() is called. This is wrong
>because the mutex in the parent is left uninitialized.
>
>Next, the returned object is not locked. This is wrong because in
>some cases the returned object is added onto a list of bindings
>and then passed to virNWFilterBindingObjEndAPI() which unlocks it
>right away. This is potentially dangerous because we might just
>have unlocked the object for another thread.
>
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
> src/conf/virnwfilterbindingobj.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
Reviewed-by: Ján Tomko <jtomko at redhat.com>
Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20220201/8b7d09df/attachment-0001.sig>
More information about the libvir-list
mailing list