aboutsummaryrefslogtreecommitdiff
path: root/qemu-keymap.c
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2024-11-29 13:55:05 +0000
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2024-12-03 12:26:24 +0100
commitbff1050a5630ce5da6f43ed002725d52140bb9e6 (patch)
treea92a4bb4fb7b1f1c5309d00e79235b27df99bea9 /qemu-keymap.c
parent302075f85e29d6e658aeec75f50a90eec23f3726 (diff)
downloadqemu-bff1050a5630ce5da6f43ed002725d52140bb9e6.zip
qemu-bff1050a5630ce5da6f43ed002725d52140bb9e6.tar.gz
qemu-bff1050a5630ce5da6f43ed002725d52140bb9e6.tar.bz2
hw/virtio: fix crash in processing balloon stats
balloon_stats_get_all will iterate over guest stats upto the max VIRTIO_BALLOON_S_NR value, calling visit_type_uint64 to populate the QObject dict. The dict keys are obtained from the static array balloon_stat_names which is VIRTIO_BALLOON_S_NR in size. Unfortunately the way that array is declared results in any unassigned stats getting a NULL name, which will then cause visit_type_uint64 to trigger an assert in qobject_output_add_obj. The balloon_stat_names array was fortunately fully populated with names until recently: commit 0d2eeef77a33315187df8519491a900bde4a3d83 Author: Bibo Mao <maobibo@loongson.cn> Date: Mon Oct 28 10:38:09 2024 +0800 linux-headers: Update to Linux v6.12-rc5 pulled a change to include/standard-headers/linux/virtio_balloon.h which increased VIRTIO_BALLOON_S_NR by 6, and failed to add the new names to balloon_stat_names. This commit fills in the missing names, and uses a static assert to guarantee that any future changes to VIRTIO_BALLOON_S_NR will cause a build failure until balloon_stat_names is updated. This problem was detected by the Cockpit Project's automated integration tests on QEMU 9.2.0-rc1. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2329448 Fixes: 0d2eeef77a3 ("linux-headers: Update to Linux v6.12-rc5") Reported-by: Martin Pitt <mpitt@redhat.com> Reviewed-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Acked-by: Michael S. Tsirkin <mst@redhat.com> Message-ID: <20241129135507.699030-2-berrange@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'qemu-keymap.c')
0 files changed, 0 insertions, 0 deletions