summaryrefslogtreecommitdiff
path: root/src/arch/arm/isa/templates
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2016-05-26 11:56:24 +0100
committerAndreas Hansson <andreas.hansson@arm.com>2016-05-26 11:56:24 +0100
commit7dc5034ff2e8559c1cc6afedeb32d17583469d72 (patch)
treea7f999790a9b2af19b37f6628a14b5f066e0fb7e /src/arch/arm/isa/templates
parent4a3e2156acb1a6152f78d2d9d92d0aece453ead9 (diff)
downloadgem5-7dc5034ff2e8559c1cc6afedeb32d17583469d72.tar.xz
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 <giacomo.gabrielli@arm.com> Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Diffstat (limited to 'src/arch/arm/isa/templates')
-rw-r--r--src/arch/arm/isa/templates/neon64.isa3
1 files changed, 2 insertions, 1 deletions
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<uint8_t>();
+ MemUnion memUnion { { } };
+ memcpy(&memUnion, pkt->getPtr<uint8_t>(), pkt->getSize());
if (fault == NoFault) {
%(memacc_code)s;