Skip to content

Commit

Permalink
ARM: 7308/1: vfp: flush thread hwstate before copying ptrace registers
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
Signed-off-by: Russell King <[email protected]>
  • Loading branch information
wildea01 authored and Russell King committed Feb 2, 2012
1 parent 247f499 commit 8130b9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 8130b9d

Please sign in to comment.