diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2018-07-09 10:13:36 +0100 |
---|---|---|
committer | Jason Liu <jason.hui.liu@nxp.com> | 2018-08-29 16:11:02 +0800 |
commit | 158fb692e95a60d2ce204603c65835a4e3546a04 (patch) | |
tree | fc953fd33bdee34e9ef2a9d3dfb855486b735d9b /arch/arm/include | |
parent | ecb106b04682c80d82d980566e89bd23edcea496 (diff) |
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>
(cherry picked from commit 42019fc50dfadb219f9e6ddf4c354f3837057d80)
Fixed conflicts caused by older versions missing commit ce184a0dee92
("ARM: 8687/1: signal: Fix unparseable iwmmxt_sigframe in uc_regspace[]")
(cherry picked from commit 04de67be2d4d84db018d641563cafc9c36dba6f0)
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/thread_info.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h index 776757d1604a..57d2ad9c75ca 100644 --- a/arch/arm/include/asm/thread_info.h +++ b/arch/arm/include/asm/thread_info.h @@ -126,8 +126,8 @@ struct user_vfp_exc; extern int vfp_preserve_user_clear_hwstate(struct user_vfp __user *, struct user_vfp_exc __user *); -extern int vfp_restore_user_hwstate(struct user_vfp __user *, - struct user_vfp_exc __user *); +extern int vfp_restore_user_hwstate(struct user_vfp *, + struct user_vfp_exc *); #endif /* |