Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 929966 (CVE-2024-2494) - <app-emulation/libvirt-10.2.0: check for negative array lengths before allocation
Summary: <app-emulation/libvirt-10.2.0: check for negative array lengths before alloca...
Status: UNCONFIRMED
Alias: CVE-2024-2494
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Security
URL: https://gitlab.com/libvirt/libvirt/-/...
Whiteboard: B3 [glsa?]
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-13 20:02 UTC by Michal Prívozník
Modified: 2024-04-14 06:46 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Prívozník 2024-04-13 20:02:14 UTC
A flaw was found in the RPC library APIs of libvirt. The RPC server deserialization code allocates memory for arrays before the non-negative length check is performed by the C API entry points. Passing a negative length to the g_new0 function results in a crash due to the negative length being treated as a huge positive number. This flaw allows a local, unprivileged user to perform a denial of service attack by causing the libvirt daemon to crash.
Comment 1 Larry the Git Cow gentoo-dev 2024-04-14 00:43:18 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c32491d0bcded18663dd976934ad5c10b29d4c2

commit 3c32491d0bcded18663dd976934ad5c10b29d4c2
Author:     Michal Privoznik <michal.privoznik@gmail.com>
AuthorDate: 2024-04-13 18:53:12 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-04-14 00:41:53 +0000

    app-emulation/libvirt: Backport fix for CVE-2024-2494
    
    The fix made it into app-emulation/libvirt-10.2.0 release.
    Backport the fix into anything older.
    
    https://nvd.nist.gov/vuln/detail/CVE-2024-2494
    
    Bug: https://bugs.gentoo.org/929966
    Signed-off-by: Michal Privoznik <michal.privoznik@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/36242
    Signed-off-by: Sam James <sam@gentoo.org>

 ...k-for-negative-array-lengths-before-alloc.patch | 222 +++++++++++++++++++++
 ...t-10.0.0-r1.ebuild => libvirt-10.0.0-r2.ebuild} |   1 +
 ...virt-10.1.0.ebuild => libvirt-10.1.0-r1.ebuild} |   1 +
 ...irt-9.8.0-r1.ebuild => libvirt-9.8.0-r2.ebuild} |   1 +
 ...irt-9.9.0-r1.ebuild => libvirt-9.9.0-r2.ebuild} |   1 +
 5 files changed, 226 insertions(+)