Skip to content

Commit

Permalink
x86/bugs: Flush IBP in ib_prctl_set()
Browse files Browse the repository at this point in the history
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>
(cherry picked from commit a664ec9)
CVE-2023-0045
Signed-off-by: Yuxuan Luo <yuxuan.luo@canonical.com>
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
  • Loading branch information
Rodrigo Branco authored and Timo Aaltonen committed Feb 10, 2023
1 parent 709626e commit 641d3e3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/x86/kernel/cpu/bugs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,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;
Expand Down

0 comments on commit 641d3e3

Please sign in to comment.