From 924d84a44cab6e8006fe21ab8b497cb85bf1e4cc Mon Sep 17 00:00:00 2001 From: andrew Date: Wed, 10 Sep 2014 13:07:01 +0000 Subject: [PATCH] Stop accessing the saved stack pointer by looking past the end of the array of registers. Submitted by: Michal Meloun --- usr.bin/truss/arm-fbsd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/truss/arm-fbsd.c b/usr.bin/truss/arm-fbsd.c index b71761986f8a..a1759ab7d0da 100644 --- a/usr.bin/truss/arm-fbsd.c +++ b/usr.bin/truss/arm-fbsd.c @@ -201,7 +201,7 @@ arm_syscall_entry(struct trussinfo *trussinfo, int nargs) */ // XXX BAD constant used here iorequest.piod_op = PIOD_READ_D; - iorequest.piod_offs = (void *)(regs.r[_REG_SP] + + iorequest.piod_offs = (void *)(regs.r_sp + 4 * sizeof(uint32_t)); iorequest.piod_addr = &fsc->args[4]; iorequest.piod_len = (nargs - 4) * sizeof(fsc->args[0]);