]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - arch/arm64/kernel/ptrace.c
arm64: ptrace: Fix incorrect get_user() use in compat_vfp_set()
[mirror_ubuntu-artful-kernel.git] / arch / arm64 / kernel / ptrace.c
index 949ab6bdfbadfda982c12b89ebc42234d54995a6..1b38c0150aec6f034289b5e1faead0727f8f5056 100644 (file)
@@ -935,15 +935,17 @@ static int compat_vfp_set(struct task_struct *target,
 {
        struct user_fpsimd_state *uregs;
        compat_ulong_t fpscr;
-       int ret;
+       int ret, vregs_end_pos;
 
        uregs = &target->thread.fpsimd_state.user_fpsimd;
 
+       vregs_end_pos = VFP_STATE_SIZE - sizeof(compat_ulong_t);
        ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, uregs, 0,
-                                VFP_STATE_SIZE - sizeof(compat_ulong_t));
+                                vregs_end_pos);
 
        if (count && !ret) {
-               ret = get_user(fpscr, (compat_ulong_t *)ubuf);
+               ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &fpscr,
+                                        vregs_end_pos, VFP_STATE_SIZE);
                if (!ret) {
                        uregs->fpsr = fpscr & VFP_FPSCR_STAT_MASK;
                        uregs->fpcr = fpscr & VFP_FPSCR_CTRL_MASK;