summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodrigo Branco <bsdaemon@google.com>2023-01-03 23:17:51 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-18 11:26:41 +0300
commite1feec3bd63b7e526f92464def38a5fbe437dc99 (patch)
tree6d266ab457b715412d39c7812f772fe5caf7b1e3
parent27b5b63973d19f791f591c382c49b797eb9b6eea (diff)
downloadlinux-e1feec3bd63b7e526f92464def38a5fbe437dc99.tar.xz
x86/bugs: Flush IBP in ib_prctl_set()
commit a664ec9158eeddd75121d39c9a0758016097fa96 upstream. We missed the window between the TIF flag update and the next reschedule. Signed-off-by: Rodrigo Branco <bsdaemon@google.com> Reviewed-by: Borislav Petkov (AMD) <bp@alien8.de> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/x86/kernel/cpu/bugs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 12c687455430..80dfd84c3ca8 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -1776,6 +1776,8 @@ static int ib_prctl_set(struct task_struct *task, unsigned long ctrl)
if (ctrl == PR_SPEC_FORCE_DISABLE)
task_set_spec_ib_force_disable(task);
task_update_spec_tif(task);
+ if (task == current)
+ indirect_branch_prediction_barrier();
break;
default:
return -ERANGE;