Skip to content

Commit cb42aa7

Browse files
rrbrancogregkh
authored andcommitted
x86/bugs: Flush IBP in ib_prctl_set()
commit a664ec9 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>
1 parent 554a880 commit cb42aa7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/x86/kernel/cpu/bugs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1951,6 +1951,8 @@ static int ib_prctl_set(struct task_struct *task, unsigned long ctrl)
19511951
if (ctrl == PR_SPEC_FORCE_DISABLE)
19521952
task_set_spec_ib_force_disable(task);
19531953
task_update_spec_tif(task);
1954+
if (task == current)
1955+
indirect_branch_prediction_barrier();
19541956
break;
19551957
default:
19561958
return -ERANGE;

0 commit comments

Comments
 (0)