Commit 7d2a175b9bf6e9422bebe95130a3c79a25ff4602
Committed by
Benjamin Herrenschmidt
1 parent
1ac42ef844
Exists in
master
and in
7 other branches
powerpc: Don't use the wrong thread_struct for ptrace get/set VSX regs
In PTRACE_GET/SETVSRREGS, we should be using the thread we are ptracing rather than current. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff
arch/powerpc/kernel/ptrace.c
... | ... | @@ -375,7 +375,7 @@ |
375 | 375 | flush_vsx_to_thread(target); |
376 | 376 | |
377 | 377 | for (i = 0; i < 32 ; i++) |
378 | - buf[i] = current->thread.fpr[i][TS_VSRLOWOFFSET]; | |
378 | + buf[i] = target->thread.fpr[i][TS_VSRLOWOFFSET]; | |
379 | 379 | ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, |
380 | 380 | buf, 0, 32 * sizeof(double)); |
381 | 381 | |
... | ... | @@ -394,7 +394,7 @@ |
394 | 394 | ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, |
395 | 395 | buf, 0, 32 * sizeof(double)); |
396 | 396 | for (i = 0; i < 32 ; i++) |
397 | - current->thread.fpr[i][TS_VSRLOWOFFSET] = buf[i]; | |
397 | + target->thread.fpr[i][TS_VSRLOWOFFSET] = buf[i]; | |
398 | 398 | |
399 | 399 | |
400 | 400 | return ret; |