]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: Fix returning of locked objects from 'virStoragePoolObjListSearch'
authorPeter Krempa <pkrempa@redhat.com>
Thu, 13 Jul 2023 14:16:37 +0000 (16:16 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 20 Jul 2023 13:24:02 +0000 (15:24 +0200)
commit9a47442366fcf8a7b6d7422016d7bbb6764a1098
tree04ebd73d5b65971d632687adb1e20ba8bc7c7e9e
parenta7f7bfa347a35bbd23f43d335c5f5417f4e10e83
storage: Fix returning of locked objects from 'virStoragePoolObjListSearch'

CVE-2023-3750

'virStoragePoolObjListSearch' explicitly documents that it's returning
a pointer to a locked and ref'd pool that maches the lookup function.

This was not the case as in commit 0c4b391e2a9 (released in
libvirt-8.3.0) the code was accidentally converted to use 'VIR_LOCK_GUARD'
which auto-unlocked it when leaving the scope, even when the code was
originally "leaking" the lock.

Revert the corresponding conversion and add a comment that this function
is intentionally leaking a locked object.

Fixes: 0c4b391e2a9
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2221851
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/virstorageobj.c