summaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorRodrigo Branco <bsdaemon@google.com>2023-01-03 14:17:51 -0600
committerIngo Molnar <mingo@kernel.org>2023-01-04 11:25:32 +0100
commita664ec9158eeddd75121d39c9a0758016097fa96 (patch)
treec158a59624bea7ee7998643dd62cd3da52ab3c0e /arch/x86
parent72bb8f8cc088730c4d84117a6906f458c2fc64bb (diff)
x86/bugs: Flush IBP in ib_prctl_set()
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>
Diffstat (limited to 'arch/x86')
-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 d970ddb0cc65..bca0bd8f4846 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -1981,6 +1981,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;