Skip to content

Commit a664ec9

Browse files
rrbrancoingomolnar
authored andcommitted
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>
1 parent 72bb8f8 commit a664ec9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

arch/x86/kernel/cpu/bugs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1981,6 +1981,8 @@ static int ib_prctl_set(struct task_struct *task, unsigned long ctrl)
19811981
if (ctrl == PR_SPEC_FORCE_DISABLE)
19821982
task_set_spec_ib_force_disable(task);
19831983
task_update_spec_tif(task);
1984+
if (task == current)
1985+
indirect_branch_prediction_barrier();
19841986
break;
19851987
default:
19861988
return -ERANGE;

0 commit comments

Comments
 (0)