diff options
| author | Pawan Gupta <[email protected]> | 2024-06-22 04:17:21 +0000 |
|---|---|---|
| committer | Dave Hansen <[email protected]> | 2025-05-09 20:22:05 +0000 |
| commit | a75bf27fe41abe658c53276a0c486c4bf9adecfc (patch) | |
| tree | 0898216e1eb51992a199696ed652042942ac11f9 /arch/x86/net/bpf_jit_comp.c | |
| parent | x86/its: Add support for ITS-safe indirect thunk (diff) | |
| download | kernel-a75bf27fe41abe658c53276a0c486c4bf9adecfc.tar.gz kernel-a75bf27fe41abe658c53276a0c486c4bf9adecfc.zip | |
x86/its: Add support for ITS-safe return thunk
RETs in the lower half of cacheline may be affected by ITS bug,
specifically when the RSB-underflows. Use ITS-safe return thunk for such
RETs.
RETs that are not patched:
- RET in retpoline sequence does not need to be patched, because the
sequence itself fills an RSB before RET.
- RET in Call Depth Tracking (CDT) thunks __x86_indirect_{call|jump}_thunk
and call_depth_return_thunk are not patched because CDT by design
prevents RSB-underflow.
- RETs in .init section are not reachable after init.
- RETs that are explicitly marked safe with ANNOTATE_UNRET_SAFE.
Signed-off-by: Pawan Gupta <[email protected]>
Signed-off-by: Dave Hansen <[email protected]>
Reviewed-by: Josh Poimboeuf <[email protected]>
Reviewed-by: Alexandre Chartre <[email protected]>
Diffstat (limited to 'arch/x86/net/bpf_jit_comp.c')
| -rw-r--r-- | arch/x86/net/bpf_jit_comp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c index 01e8119db5db..a5b65c09910b 100644 --- a/arch/x86/net/bpf_jit_comp.c +++ b/arch/x86/net/bpf_jit_comp.c @@ -686,7 +686,7 @@ static void emit_return(u8 **pprog, u8 *ip) { u8 *prog = *pprog; - if (cpu_feature_enabled(X86_FEATURE_RETHUNK)) { + if (cpu_wants_rethunk()) { emit_jump(&prog, x86_return_thunk, ip); } else { EMIT1(0xC3); /* ret */ |
