summary refs log tree commit diff stats
path: root/hw/intc/omap_intc.c
diff options
context:
space:
mode:
authorFabiano Rosas <farosas@linux.ibm.com>2019-02-13 15:29:26 -0200
committerDavid Gibson <david@gibson.dropbear.id.au>2019-02-17 21:54:02 +1100
commitcc941111a5bc5f498185fa3824c3b6579c7d45ad (patch)
tree3d12f6a598c5bcb51a88ceeff4119590a615ee11 /hw/intc/omap_intc.c
parent316aed64827ee51267adcf187e867747f29b9a6e (diff)
downloadfocaccia-qemu-cc941111a5bc5f498185fa3824c3b6579c7d45ad.tar.gz
focaccia-qemu-cc941111a5bc5f498185fa3824c3b6579c7d45ad.zip
spapr: fix out of bounds write in spapr_populate_drmem_v2
buf_len is uint8_t which is not large enough to hold the result of:

  nr_entries * sizeof(struct sPAPRDrconfCellV2) + sizeof(uint32_t);

for a nr_entries greater than 10.

This causes the allocated buffer 'int_buf' to be smaller than expected
and we eventually overwrite some of glibc's control structures (see
"chunk" in https://sourceware.org/glibc/wiki/MallocInternals)

The following error is seen while trying to free int_buf:

  "free(): invalid next size (fast)"

Fixes: a324d6f166 "spapr: Support ibm,dynamic-memory-v2 property"
Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Message-Id: <20190213172926.21740-1-farosas@linux.ibm.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/intc/omap_intc.c')
0 files changed, 0 insertions, 0 deletions