Stop accessing the saved stack pointer by looking past the end of the

array of registers.

Submitted by:	Michal Meloun <meloun at miracle.cz>
This commit is contained in:
andrew 2014-09-10 13:07:01 +00:00
parent 5939c729a8
commit 924d84a44c

View File

@ -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]);