diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index c421a899fc84..347611ae762f 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c @@ -583,10 +583,15 @@ static int fpa_set(struct task_struct *target, const void *kbuf, const void __user *ubuf) { struct thread_info *thread = task_thread_info(target); + const unsigned int pos0 = pos; + char buf[sizeof(struct user_fp)]; + int ret; - return user_regset_copyin(&pos, &count, &kbuf, &ubuf, - &thread->fpstate, - 0, sizeof(struct user_fp)); + ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, + buf, 0, sizeof(struct user_fp)); + if (!ret) + memcpy(&thread->fpstate, buf, pos - pos0); + return ret; } #ifdef CONFIG_VFP