On Mon, May 12, 2025 at 2:02 PM Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx> wrote: > > Instead of hardcoding the list of kfuncs that need prog->aux passed to > them with a combination of fixup_kfunc_call adjustment + __ign suffix, > combine both in __aux suffix, which ignores the argument passed in, and > fixes it up to the prog->aux. This allows kfuncs to have the prog->aux > passed into them without having to touch the verifier. I have this wet dream that one day we'll make sure that all BPF programs have bpf_run_ctx set up for them, across all program types, and we'll just use that for these "BPF environment"-like things like getting currently-running bpf_prog/bpf_prog_aux pointer. Do you think it makes sense? One of the concerns for wiring bpf_run_ctx for, say, XDP programs was perceived potential tiny perf regression (but it's just current->bpf_ctx swap, so shouldn't be a big deal at all, IMO) and just generally no immediate use case. So maybe this bpf_prog_aux access is a good enough reason now, WDYT? > > Cc: Tejun Heo <tj@xxxxxxxxxx> > Signed-off-by: Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx> > --- > include/linux/bpf_verifier.h | 1 + > kernel/bpf/helpers.c | 4 ++-- > kernel/bpf/verifier.c | 33 +++++++++++++++++++++++++++------ > 3 files changed, 30 insertions(+), 8 deletions(-) > [...]