]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Don't overflow the trap frame when accessing lr or xzr.
authorAndrew Turner <andrew@FreeBSD.org>
Fri, 17 Jul 2020 14:39:07 +0000 (14:39 +0000)
committerAndrew Turner <andrew@FreeBSD.org>
Fri, 17 Jul 2020 14:39:07 +0000 (14:39 +0000)
commit256c5d705aa69eb3837436ca0453bd368d51ce31
tree339ce70434ff457b5197bbd7369df9dcd73b012b
parentc6a2e9a7ae8a2143564e0deae86b7d76ccb1ee04
Don't overflow the trap frame when accessing lr or xzr.

When emulating a load pair or store pair in dtrace on arm64 we need to
copy the data between the stack and trap frame. When the registers are
either the link register or the zero register we will access memory
past the end of the trap frame as these are encoded as registers 30 and
31 respectively while the array they access only has 30 entries.

Fix this by creating 2 helper functions to perform the operation with
special cases for these registers.

Sponsored by: Innovate UK
sys/cddl/dev/dtrace/aarch64/dtrace_subr.c