summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-u300
diff options
context:
space:
mode:
authorDave Martin <dave.martin@linaro.org>2012-01-30 20:22:28 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-02-02 17:37:42 +0000
commit247f4993a5974e6759606c4d380748eecfd273ff (patch)
tree79cf9e348c8274154e64d69d4373bec416cf4dee /arch/arm/mach-u300
parent2af276dfb1722e97b190bd2e646b079a2aa674db (diff)
downloadblackbird-op-linux-247f4993a5974e6759606c4d380748eecfd273ff.tar.gz
blackbird-op-linux-247f4993a5974e6759606c4d380748eecfd273ff.zip
ARM: 7307/1: vfp: fix ptrace regset modification race
In a preemptible kernel, vfp_set() can be preempted, causing the hardware VFP context to be switched while the thread vfp state is being read and modified. This leads to a race condition which can cause the thread vfp state to become corrupted if lazy VFP context save occurs due to preemption in between the time thread->vfpstate is read and the time the modified state is written back. This may occur if preemption occurs during the execution of a ptrace() call which modifies the VFP register state of a thread. Such instances should be very rare in most realistic scenarios -- none has been reported, so far as I am aware. Only uniprocessor systems should be affected, since VFP context save is not currently lazy in SMP kernels. The problem was introduced by my earlier patch migrating to use regsets to implement ptrace. This patch does a vfp_sync_hwstate() before reading thread->vfpstate, to make sure that the thread's VFP state is not live in the hardware registers while the registers are modified. Thanks to Will Deacon for spotting this. Cc: stable <stable@vger.kernel.org> Signed-off-by: Dave Martin <dave.martin@linaro.org> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-u300')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud