diff options
author | David S. Miller <davem@davemloft.net> | 2010-03-31 21:05:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-31 21:05:05 -0400 |
commit | b857bd292223f54aaae3693c82fa7299a99991cd (patch) | |
tree | d1df20123185c44c4dbac7c82720b71721f82255 /arch/sparc/kernel/ptrace_64.c | |
parent | c4a3987fa075b2d15ebc3d59b01fb7ed403cd3e1 (diff) |
sparc: Fix regset register window handling.
We have to adjust 'reg_window' down by 16 becuase the 'pos' iterator
we'll use to index into the stack slots will be between 16 and 32.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/ptrace_64.c')
-rw-r--r-- | arch/sparc/kernel/ptrace_64.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/sparc/kernel/ptrace_64.c b/arch/sparc/kernel/ptrace_64.c index 2f6524d1a817..aa90da08bf61 100644 --- a/arch/sparc/kernel/ptrace_64.c +++ b/arch/sparc/kernel/ptrace_64.c | |||
@@ -492,6 +492,7 @@ static int genregs32_get(struct task_struct *target, | |||
492 | *k++ = regs->u_regs[pos++]; | 492 | *k++ = regs->u_regs[pos++]; |
493 | 493 | ||
494 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; | 494 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; |
495 | reg_window -= 16; | ||
495 | if (target == current) { | 496 | if (target == current) { |
496 | for (; count > 0 && pos < 32; count--) { | 497 | for (; count > 0 && pos < 32; count--) { |
497 | if (get_user(*k++, ®_window[pos++])) | 498 | if (get_user(*k++, ®_window[pos++])) |
@@ -516,6 +517,7 @@ static int genregs32_get(struct task_struct *target, | |||
516 | } | 517 | } |
517 | 518 | ||
518 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; | 519 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; |
520 | reg_window -= 16; | ||
519 | if (target == current) { | 521 | if (target == current) { |
520 | for (; count > 0 && pos < 32; count--) { | 522 | for (; count > 0 && pos < 32; count--) { |
521 | if (get_user(reg, ®_window[pos++]) || | 523 | if (get_user(reg, ®_window[pos++]) || |
@@ -599,6 +601,7 @@ static int genregs32_set(struct task_struct *target, | |||
599 | regs->u_regs[pos++] = *k++; | 601 | regs->u_regs[pos++] = *k++; |
600 | 602 | ||
601 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; | 603 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; |
604 | reg_window -= 16; | ||
602 | if (target == current) { | 605 | if (target == current) { |
603 | for (; count > 0 && pos < 32; count--) { | 606 | for (; count > 0 && pos < 32; count--) { |
604 | if (put_user(*k++, ®_window[pos++])) | 607 | if (put_user(*k++, ®_window[pos++])) |
@@ -625,6 +628,7 @@ static int genregs32_set(struct task_struct *target, | |||
625 | } | 628 | } |
626 | 629 | ||
627 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; | 630 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; |
631 | reg_window -= 16; | ||
628 | if (target == current) { | 632 | if (target == current) { |
629 | for (; count > 0 && pos < 32; count--) { | 633 | for (; count > 0 && pos < 32; count--) { |
630 | if (get_user(reg, u++) || | 634 | if (get_user(reg, u++) || |