x86/cpu: Enable STIBP on AMD if Automatic IBRS is enabled
authorKim Phillips <kim.phillips@amd.com>
Thu, 20 Jul 2023 19:47:27 +0000 (14:47 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:19:34 +0000 (16:19 +0200)
commitff5305ec8c0e706e87817535504ef30d9b1f4916
tree44e23bae7c67accaa684913a2c7f48ad01bbd50b
parent34c0786ef6c745ad2db0148682cc450b5068451d
x86/cpu: Enable STIBP on AMD if Automatic IBRS is enabled

commit fd470a8beed88440b160d690344fbae05a0b9b1b upstream.

Unlike Intel's Enhanced IBRS feature, AMD's Automatic IBRS does not
provide protection to processes running at CPL3/user mode, see section
"Extended Feature Enable Register (EFER)" in the APM v2 at
https://bugzilla.kernel.org/attachment.cgi?id=304652

Explicitly enable STIBP to protect against cross-thread CPL3
branch target injections on systems with Automatic IBRS enabled.

Also update the relevant documentation.

Fixes: e7862eda309e ("x86/cpu: Support AMD Automatic IBRS")
Reported-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Kim Phillips <kim.phillips@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230720194727.67022-1-kim.phillips@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/admin-guide/hw-vuln/spectre.rst
arch/x86/kernel/cpu/bugs.c