]> git.ipfire.org Git - thirdparty/libvirt.git/commit
remote: check for negative array lengths before allocation CVE-2024-2494
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 15 Mar 2024 10:47:50 +0000 (10:47 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 21 Mar 2024 08:08:00 +0000 (08:08 +0000)
commit8a3f8d957507c1f8223fdcf25a3ff885b15557f2
tree269d0567a7a2fd7866983ef681352b6ba7374b41
parent5fb47c5bedb135f70a9bc214b9d3203bec10cdb8
remote: check for negative array lengths before allocation

While the C API entry points will validate non-negative lengths
for various parameters, the RPC server de-serialization code
will need to allocate memory for arrays before entering the C
API. These allocations will thus happen before the non-negative
length check is performed.

Passing a negative length to the g_new0 function will usually
result in a crash due to the negative length being treated as
a huge positive number.

This was found and diagnosed by ALT Linux Team with AFLplusplus.

CVE-2024-2494
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Found-by: Alexandr Shashkin <dutyrok@altlinux.org>
Co-developed-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/remote/remote_daemon_dispatch.c
src/rpc/gendispatch.pl