]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ARM: 8794/1: uaccess: Prevent speculative use of the current addr_limit
authorJulien Thierry <julien.thierry@arm.com>
Thu, 14 Feb 2019 02:10:11 +0000 (21:10 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Feb 2019 09:20:45 +0000 (10:20 +0100)
commitf2ed1df0161fa04f6914c4a61b3b2e1df3fd8b82
tree68f3f273ea253f6a17ccf971aff0a55664c6f0eb
parent2ef94913e3289d5e23c0a10fdfbdf51ca1c52d67
ARM: 8794/1: uaccess: Prevent speculative use of the current addr_limit

Commit 621afc677465db231662ed126ae1f355bf8eac47 upstream.

A mispredicted conditional call to set_fs could result in the wrong
addr_limit being forwarded under speculation to a subsequent access_ok
check, potentially forming part of a spectre-v1 attack using uaccess
routines.

This patch prevents this forwarding from taking place, but putting heavy
barriers in set_fs after writing the addr_limit.

Porting commit c2f0ad4fc089cff8 ("arm64: uaccess: Prevent speculative use
of the current addr_limit").

Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David A. Long <dave.long@linaro.org>
Reviewed-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm/include/asm/uaccess.h