[lkml]   [2022]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH v2 bpf-next 0/5] ftrace: host klp and bpf trampoline together
Changes v1 => v2:
1. Fix build errors for different config. (kernel test robot)

Kernel Live Patch (livepatch, or klp) and bpf trampoline are important
features for modern systems. This set allows the two to work on the same
kernel function as the same time.

live patch uses ftrace with IPMODIFY, while bpf trampoline use direct
ftrace. Existing policy does not allow the two to attach to the same kernel
function. This is changed by fine tuning ftrace IPMODIFY policy, and allows
one non-DIRECT IPMODIFY ftrace_ops and one non-IPMODIFY DIRECT ftrace_ops
on the same kernel function at the same time. Please see 3/5 for more
details on this.

Note that, one of the constraint here is to let bpf trampoline use direct
call when it is not working on the same function as live patch. This is
achieved by allowing ftrace code to ask bpf trampoline to make changes.

Jiri Olsa (1):
bpf, x64: Allow to use caller address from stack

Song Liu (4):
ftrace: allow customized flags for ftrace_direct_multi ftrace_ops
ftrace: add modify_ftrace_direct_multi_nolock
bpf: trampoline: support FTRACE_OPS_FL_SHARE_IPMODIFY

arch/x86/net/bpf_jit_comp.c | 13 +-
include/linux/bpf.h | 8 ++
include/linux/ftrace.h | 79 +++++++++++
kernel/bpf/trampoline.c | 109 +++++++++++++--
kernel/trace/ftrace.c | 269 +++++++++++++++++++++++++++++++-----
5 files changed, 424 insertions(+), 54 deletions(-)


 \ /
  Last update: 2022-06-02 21:49    [W:0.413 / U:2.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site