]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
arm64: uaccess: Prevent speculative use of the current addr_limit
authorWill Deacon <will.deacon@arm.com>
Mon, 5 Feb 2018 15:34:21 +0000 (15:34 +0000)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 22 Feb 2018 14:15:48 +0000 (08:15 -0600)
commitf0133a00640563c9ff3701829c2ef2b848d5aac8
tree7bb06ee19fab56aaeeead9c9dc9e805a211c9be0
parent05ce179c92e4772ec3120e2475ac68b5c5ab3727
arm64: uaccess: Prevent speculative use of the current addr_limit

BugLink: http://bugs.launchpad.net/bugs/1751064
Commit c2f0ad4fc089 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.

Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
arch/arm64/include/asm/uaccess.h