]> git.baikalelectronics.ru Git - kernel.git/commit
x86/entry: Avoid very early RET
authorPeter Zijlstra <peterz@infradead.org>
Tue, 14 Jun 2022 21:15:46 +0000 (23:15 +0200)
committerBorislav Petkov <bp@suse.de>
Mon, 27 Jun 2022 08:33:58 +0000 (10:33 +0200)
commit7dce5a26250f8999dc49af4187e3c5a2e04e89f4
tree04f9f4c9c7289fb9b8fbe3ab9927c01712f74c2b
parentd9111be487f708835e401302d9bcdd3c91f4998a
x86/entry: Avoid very early RET

Commit

  1beaf57c4a68 ("x86/entry: Move PUSH_AND_CLEAR_REGS out of error_entry()")

manages to introduce a CALL/RET pair that is before SWITCH_TO_KERNEL_CR3,
which means it is before RETBleed can be mitigated.

Revert to an earlier version of the commit in Fixes. Down side is that
this will bloat .text size somewhat. The alternative is fully reverting
it.

The purpose of this patch was to allow migrating error_entry() to C,
including the whole of kPTI. Much care needs to be taken moving that
forward to not re-introduce this problem of early RETs.

Fixes: 1beaf57c4a68 ("x86/entry: Move PUSH_AND_CLEAR_REGS out of error_entry()")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
arch/x86/entry/entry_64.S