Re: [PATCH bpf-next v3 12/17] bpf: Disallow fentry/fexit/freplace for exception callbacks

Alexei Starovoitov
2023-09-16T16:44:40Z

On Thu, Sep 14, 2023 at 5:13 AM Kumar Kartikeya Dwivedi
<memxor@gmail.com> wrote:
> > > }
> > > + if (aux->func && aux->func[subprog]->aux->exception_cb) {
> > > + bpf_log(log,
> > > + "Extension programs cannot replace exception callback\n");
> > > + return -EINVAL;
> > > + }
> >
> > This check is redundant because you already did this check above if (prog_extension branch)
> > Remove this as it will never be reached.
> >
>
> Good catch, will fix it in v4.

No worries. I fixed this duplicate check while applying.
Everything else can be addressed in the follow ups.

This spam is a bit annoying:
$ ./test_progs -t exceptions
func#0 @0
FENTRY/FEXIT programs cannot attach to exception callback
processed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0
peak_states 0 mark_read 0

func#0 @0
FENTRY/FEXIT programs cannot attach to exception callback
processed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0
peak_states 0 mark_read 0