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 Turner 2014-09-10 13:07:01 +00:00
parent 27ad26d8c7
commit adc9488df4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271389

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