Skip to content

Ensure default return thunk isn't used at runtime

David Kaplan lkml llvm 1 version Applied

Status from this message: The following commit has been merged into the x86/bugs branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 23 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3Revert "x86/retpoline: Remove .text..__x86.return_thunk section"arch/x86/kernel/vmlinux.lds.S arch/x86/lib/retpoline.S+5 -015 replies
2/3x86/vdso: Run objtool on vdso32-setuparch/x86/entry/vdso/Makefile+2 -10 replies
3/3x86/retpoline: Ensure default return thunk isn't used at runtimearch/x86/lib/retpoline.S+5 -358 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPeter Zijlstra (Intel)Josh PoimboeufNick DesaulniersMarco ElverNathan ChancellorDavid KaplanBorislav PetkovKlara Modin
SeriesA-b
1/3A-b
2/3
3/3R-b R-b R-b A-b A-b T-b T-b Debugged-by Debugged-by T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 8 reviewers.

Read the v1 thread

Cover letter [PATCH 0/3] Ensure default return thunk isn't used at runtime

Several CPU side-channel mitigations require the use of a special return thunk. The necessary return thunk is installed at runtime via apply_returns(), after which point the default return thunk (__x86_return_thunk) should never be used.

Patch 3 enforces this by modifying __x86_return_thunk to be a ud2 after alternatives are applied.

Patch 1 reverts a recent commit which resulted in retpoline sequences not being annotated as containing returns, which was leaving them using the default return thunk.

Patch 2 fixes an issue where functions in vdso32-setup were using the default return thunk because objtool was not being run on them in some cases.

David Kaplan (3):
Revert "x86/retpoline: Remove .text..__x86.return_thunk section" x86/vdso: Run objtool on vdso32-setup
x86/retpoline: Ensure default return thunk isn't used at runtime

 arch/x86/entry/vdso/Makefile  |  3 ++-
 arch/x86/kernel/vmlinux.lds.S |  3 +++
 arch/x86/lib/retpoline.S      | 10 +++++++---
 3 files changed, 12 insertions(+), 4 deletions(-)
Signature · 1 line
2.25.1