]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
fix a braino in "sparc32: fix register window handling in genregs32_[gs]et()"
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 7 Jun 2020 03:44:24 +0000 (23:44 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 7 Jun 2020 14:37:09 +0000 (10:37 -0400)
lost npc in PTRACE_SETREGSET, breaking PTRACE_SETREGS as well

Fixes: cf51e129b968 "sparc32: fix register window handling in genregs32_[gs]et()"
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/sparc/kernel/ptrace_32.c

index 60f7205ebe40ded084b59b035feeff2a7f6f3424..646dd58169ecb077eb257b051afbbc131cc4a77f 100644 (file)
@@ -168,12 +168,17 @@ static int genregs32_set(struct task_struct *target,
        if (ret || !count)
                return ret;
        ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
-                                &regs->y,
+                                &regs->npc,
                                 34 * sizeof(u32), 35 * sizeof(u32));
        if (ret || !count)
                return ret;
+       ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
+                                &regs->y,
+                                35 * sizeof(u32), 36 * sizeof(u32));
+       if (ret || !count)
+               return ret;
        return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
-                                        35 * sizeof(u32), 38 * sizeof(u32));
+                                        36 * sizeof(u32), 38 * sizeof(u32));
 }
 
 static int fpregs32_get(struct task_struct *target,