summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorRodrigo Branco <bsdaemon@google.com>2023-01-03 14:17:51 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-12 12:02:44 +0100
commite8377f0456fb6738a4668d4df16c13d7599925fd (patch)
treeaf3681f35b51480c832fba87a37e001b78e45d03 /arch
parent5bd3c7abeb69fb4133418b846a1c6dc11313d6f0 (diff)
downloadlinux-e8377f0456fb6738a4668d4df16c13d7599925fd.tar.gz
linux-e8377f0456fb6738a4668d4df16c13d7599925fd.tar.bz2
linux-e8377f0456fb6738a4668d4df16c13d7599925fd.zip
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>
Diffstat (limited to 'arch')
-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 6daf84229548..16d8e43be775 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -1951,6 +1951,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;