Commit Graph

15 Commits

Author SHA1 Message Date
zengchi 6d829c1a6d Fix CVE-2023-3750
Signed-off-by: zengchi <zengchi@kylinos.cn>
2023-12-04 11:21:36 +08:00
Peter Krempa 87ecdf0329 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 0c4b391e2a (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: 0c4b391e2a
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2221851
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: zeng_chi <zengchi@kylinos.cn>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2023-12-04 11:13:33 +08:00
zeng_chi e3770f2cd8 Fix CVE-2018-12896 2023-07-17 17:54:59 +08:00
Tim Shearer d376861af8 virpci: Resolve leak in virPCIVirtualFunctionList cleanup
CVE: CVE-2018-12896

Repeatedly querying an SR-IOV PCI device's capabilities exposes a
memory leak caused by a failure to free the virPCIVirtualFunction
array within the parent struct's g_autoptr cleanup.

Valgrind output after getting a single interface's XML description
1000 times:

==325982== 256,000 bytes in 1,000 blocks are definitely lost in loss record 2,634 of 2,635
==325982==    at 0x4C3C096: realloc (vg_replace_malloc.c:1437)
==325982==    by 0x59D952D: g_realloc (in /usr/lib64/libglib-2.0.so.0.5600.4)
==325982==    by 0x4EE1F52: virReallocN (viralloc.c:52)
==325982==    by 0x4EE1FB7: virExpandN (viralloc.c:78)
==325982==    by 0x4EE219A: virInsertElementInternal (viralloc.c:183)
==325982==    by 0x4EE23B2: virAppendElement (viralloc.c:288)
==325982==    by 0x4F65D85: virPCIGetVirtualFunctionsFull (virpci.c:2389)
==325982==    by 0x4F65753: virPCIGetVirtualFunctions (virpci.c:2256)
==325982==    by 0x505CB75: virNodeDeviceGetPCISRIOVCaps (node_device_conf.c:2969)
==325982==    by 0x505D181: virNodeDeviceGetPCIDynamicCaps (node_device_conf.c:3099)
==325982==    by 0x505BC4E: virNodeDeviceUpdateCaps (node_device_conf.c:2677)
==325982==    by 0x260FCBB2: nodeDeviceGetXMLDesc (node_device_driver.c:355)

Signed-off-by: Tim Shearer <tshearer@adva.com>
Signed-off-by: zeng_chi <zengchi@kylinos.cn>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2023-07-17 17:06:27 +08:00
Cong Liu e220983594 update changelog 2022-11-23 13:42:20 +08:00
Cong Liu f690687621 changed debian/source/format to native 2022-11-09 15:23:37 +08:00
Andrea Bolognani 67531b88fb Use sensible-editor by default
It is the reasonable default for Debian.

Forwarded: not-needed

Gbp-Pq: Topic debian
Gbp-Pq: Name Use-sensible-editor-by-default.patch
2022-11-09 15:23:37 +08:00
Felix Geyer 848e5aff27 apparmor_profiles_local_include
Include local apparmor profile

Forwarded: not-needed

Gbp-Pq: Topic debian
Gbp-Pq: Name apparmor_profiles_local_include.patch
2022-11-09 15:23:37 +08:00
Guido Günther 2a83111e16 Debianize systemd service files
Forwarded: not-needed

Gbp-Pq: Topic debian
Gbp-Pq: Name Debianize-systemd-service-files.patch
2022-11-09 15:23:37 +08:00
Laurent Léonard 837167c4c5 Debianize libvirt-guests
Forwarded: not-needed

Gbp-Pq: Topic debian
Gbp-Pq: Name Debianize-libvirt-guests.patch
2022-11-09 15:23:37 +08:00
Guilhem Moulin 54c8afb277 Pass GPG_TTY env var to the ssh binary
gpg-agent(1) can emulate the OpenSSH Agent protocol (which provides
pubkey-authentication using an authentication-capable OpenPGP key, in
addition to the usual identity files).  However for a console-based
password prompt to work, the 'GPG_TTY' environment variable needs to be
set to the current TTY.  Furthermore, curses-based password prompts also
require the 'TERM' environment variable to be set to the terminal type.

Gbp-Pq: Topic forward
Gbp-Pq: Name Pass-GPG_TTY-env-var-to-the-ssh-binary.patch
2022-11-09 15:23:37 +08:00
Guido Günther 22e5b22189 Reduce udevadm settle timeout to 10 seconds
This isn't a proper fix but it will make virt-manager at least start.

Closes: #663931

Gbp-Pq: Topic forward
Gbp-Pq: Name Reduce-udevadm-settle-timeout-to-10-seconds.patch
2022-11-09 15:23:37 +08:00
Guido Günther 9a5ccdd321 Skip vircgrouptest
We don't have a mock for nodeGetCPUCount yet so we fail in a chroot
without sysfs mounted.

Gbp-Pq: Topic forward
Gbp-Pq: Name Skip-vircgrouptest.patch
2022-11-09 15:23:37 +08:00
Cong Liu 042b1b46a9 Import Debian changes 8.5.0-ok1 2022-11-09 15:23:25 +08:00
Cong Liu 396cdcb173 Import Upstream version 8.5.0 2022-11-08 17:23:04 +08:00