Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ftrace_direct (used by bpf trampoline) conflicts with live patch #237

Closed
wants to merge 2 commits into from

Commits on Apr 1, 2022

  1. adding ci files

    Nobody committed Apr 1, 2022
    Configuration menu
    Copy the full SHA
    83df176 View commit details
    Browse the repository at this point in the history
  2. ftrace_direct (used by bpf trampoline) conflicts with live patch

    Hi Steven,
    
    We hit an issue with bpf trampoline and kernel live patch on the
    same function.
    
    Basically, we have tracing and live patch on the same function.
    If we use kprobe (over ftrace) for tracing, it works fine with
    live patch. However, fentry on the same function does not work
    with live patch (the one comes later fails to attach).
    
    After digging into this, I found this is because bpf trampoline
    uses register_ftrace_direct, which enables IPMODIFY by default.
    OTOH, it seems that BPF doesn't really need IPMODIFY. As BPF
    trampoline does a "goto do_fexit" in jit for BPF_TRAMP_MODIFY_RETURN.
    
    IIUC, we can let bpf trampoline and live patch work together with
    an ipmodify-less version of register_ftrace_direct, like attached
    below.
    
    Does this make sense to you? Did I miss something?
    
    Thanks in advance,
    Song
    liu-song-6 authored and Nobody committed Apr 1, 2022
    Configuration menu
    Copy the full SHA
    182ff9f View commit details
    Browse the repository at this point in the history