bpf-restrict-fs fails to load without DYNAMIC_FTRACE_WITH_DIRECT_CALLS on arm64

Nathan Chancellor nathan at kernel.org
Tue Jun 10 19:05:22 PDT 2025


On Tue, Jun 10, 2025 at 04:37:24PM -0700, Alexei Starovoitov wrote:
> On Tue, Jun 10, 2025 at 4:24 PM Nathan Chancellor <nathan at kernel.org> wrote:
> > I was able to figure out that enabling CONFIG_CFI_CLANG was the culprit
> > for the change in behavior but it does not appear to be the root cause,
> > as I can get the same error with GCC and the following diff (which
> > happens with CFI_CLANG because of the CALL_OPS dependency):
...
> > -       select HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS \
> > -               if DYNAMIC_FTRACE_WITH_ARGS && DYNAMIC_FTRACE_WITH_CALL_OPS
> >         select HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS \
> >                 if (DYNAMIC_FTRACE_WITH_ARGS && !CFI_CLANG && \
> >                     (CC_IS_CLANG || !CC_OPTIMIZE_FOR_SIZE))
> >
...
> That's expected.
> See how kernel/bpf/trampoline.c is using DYNAMIC_FTRACE_WITH_DIRECT_CALLS.
> 
> Theoretically we can make bpf trampoline work without it,
> but why bother? Just enable this config.

As I note above, this is incompatible with CONFIG_CFI_CLANG, which is
more important for my particular area of testing and maintenance. Since
you note this is expected, I will just go back to ignoring the warning
in my kernel logs :) thank you for the quick response!

Cheers,
Nathan



More information about the linux-arm-kernel mailing list