From: Will Deacon Date: Mon, 30 Jan 2012 19:23:29 +0000 (+0100) Subject: ARM: 7308/1: vfp: flush thread hwstate before copying ptrace registers X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8130b9d7b9d858aa04ce67805e8951e3cb6e9b2f;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git ARM: 7308/1: vfp: flush thread hwstate before copying ptrace registers If we are context switched whilst copying into a thread's vfp_hard_struct then the partial copy may be corrupted by the VFP context switching code (see "ARM: vfp: flush thread hwstate before restoring context from sigframe"). This patch updates the ptrace VFP set code so that the thread state is flushed before the copy, therefore disabling VFP and preventing corruption from occurring. Cc: stable Signed-off-by: Will Deacon Signed-off-by: Russell King --- diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index d001be4e0ce1..e33870ff0ac0 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c @@ -726,8 +726,8 @@ static int vfp_set(struct task_struct *target, if (ret) return ret; - thread->vfpstate.hard = new_vfp; vfp_flush_hwstate(thread); + thread->vfpstate.hard = new_vfp; return 0; }