Skip to content

Commit

Permalink
i#1569 AArch64: Make dynamorio_syscall only read the 7th arg when used.
Browse files Browse the repository at this point in the history
Fixes breakage in release-build AArch64 from d193665 exposing
dynamorio_syscall's deref of more args than were passed to it.

(Currently it seems that no Linux arm64 syscall has more than 6
arguments but several other Linux architectures do.)

Review-URL: https://codereview.appspot.com/308700043
  • Loading branch information
egrimley-arm committed Oct 18, 2016
1 parent 36b6159 commit c54e068
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/arch/aarch64/aarch64_shared.asm
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,20 @@ START_FILE
*/
DECLARE_FUNC(dynamorio_syscall)
GLOBAL_LABEL(dynamorio_syscall:)
cmp w1, #7
mov x8,x0
mov x0,x2
mov x1,x3
mov x2,x4
mov x3,x5
mov x4,x6
mov x5,x7
/* We set up first 6 args unconditionally, but read 7th arg from stack
* only if there are at least 7 args.
*/
b.cc 1f
ldr x6,[sp]
1:
svc #0
ret

Expand Down

0 comments on commit c54e068

Please sign in to comment.