From: Andreas Hansson Date: Thu, 26 May 2016 10:56:24 +0000 (+0100) Subject: arm: Fix heap overflow issue in Neon64Load operation X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7dc5034ff2e8559c1cc6afedeb32d17583469d72;p=gem5.git arm: Fix heap overflow issue in Neon64Load operation This patch fixes an issue identified by ASAN where the Neon64Load operation assumes the packet always contains 16 bytes. Change-Id: If24a7e461d60cb80970dfbe61d923d7d56926698 Reviewed-by: Giacomo Gabrielli Reviewed-by: Curtis Dunham --- diff --git a/src/arch/arm/isa/templates/neon64.isa b/src/arch/arm/isa/templates/neon64.isa index 6356073c5..336187fd8 100644 --- a/src/arch/arm/isa/templates/neon64.isa +++ b/src/arch/arm/isa/templates/neon64.isa @@ -332,7 +332,8 @@ def template NeonLoadCompleteAcc64 {{ %(op_decl)s; %(op_rd)s; - MemUnion &memUnion = *(MemUnion *)pkt->getPtr(); + MemUnion memUnion { { } }; + memcpy(&memUnion, pkt->getPtr(), pkt->getSize()); if (fault == NoFault) { %(memacc_code)s;