]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: vfp: use __copy_from_user() when restoring VFP state
authorRussell King <rmk+kernel@armlinux.org.uk>
Mon, 9 Jul 2018 09:13:36 +0000 (10:13 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Thu, 2 Aug 2018 16:41:37 +0000 (17:41 +0100)
commitcb9cd72cf5a64cd6a61f2a4cc1e23d82647d772f
tree7c2173ccdbd6aec6c1bf37434df28a408f986384
parent53b9ce6b8e798387349a9c79ab37d35667cd2efc
ARM: vfp: use __copy_from_user() when restoring VFP state

__get_user_error() is used as a fast accessor to make copying structure
members in the signal handling path as efficient as possible.  However,
with software PAN and the recent Spectre variant 1, the efficiency is
reduced as these are no longer fast accessors.

In the case of software PAN, it has to switch the domain register around
each access, and with Spectre variant 1, it would have to repeat the
access_ok() check for each access.

Use __copy_from_user() rather than __get_user_err() for individual
members when restoring VFP state.

Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/include/asm/thread_info.h
arch/arm/kernel/signal.c
arch/arm/vfp/vfpmodule.c