]> git.proxmox.com Git - mirror_qemu.git/commit
hmat acpi: Fix out of bounds access due to missing use of indirection
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 7 Mar 2024 16:03:26 +0000 (16:03 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 12 Mar 2024 21:59:46 +0000 (17:59 -0400)
commit74e2845c5f95b0c139c79233ddb65bb17f2dd679
tree9f4434ca2260dfbdbe6906221ec56565008b481d
parent2eb6672cfdaea7dacd8e9bb0523887f13b9f85ce
hmat acpi: Fix out of bounds access due to missing use of indirection

With a numa set up such as

-numa nodeid=0,cpus=0 \
-numa nodeid=1,memdev=mem \
-numa nodeid=2,cpus=1

and appropriate hmat_lb entries the initiator list is correctly
computed and writen to HMAT as 0,2 but then the LB data is accessed
using the node id (here 2), landing outside the entry_list array.

Stash the reverse lookup when writing the initiator list and use
it to get the correct array index index.

Fixes: 4586a2cb83 ("hmat acpi: Build System Locality Latency and Bandwidth Information Structure(s)")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20240307160326.31570-3-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/acpi/hmat.c