All of lore.kernel.org
 help / color / mirror / Atom feed
* [kkdwivedi:arena-args 14/14] kernel/bpf/trampoline.c:957:undefined reference to `bpf_prog_has_arena_ctx_arg'
@ 2026-08-07  3:25 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-08-07  3:25 UTC (permalink / raw)
  To: Kumar Kartikeya Dwivedi; +Cc: oe-kbuild-all

tree:   https://github.com/kkdwivedi/linux arena-args
head:   15ae81f222268f3e796b1a2ab478fa12eda2354d
commit: 15ae81f222268f3e796b1a2ab478fa12eda2354d [14/14] bpf: Reject tracing progs for struct_ops with arena args
config: x86_64-randconfig-075-20260807 (https://download.01.org/0day-ci/archive/20260807/202608071101.khLFpmUL-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260807/202608071101.khLFpmUL-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202608071101.khLFpmUL-lkp@intel.com/

All errors (new ones prefixed by >>):

   ld: kernel/bpf/trampoline.o: in function `__bpf_trampoline_link_prog':
>> kernel/bpf/trampoline.c:957:(.text+0x65a9): undefined reference to `bpf_prog_has_arena_ctx_arg'


vim +957 kernel/bpf/trampoline.c

e6cc9ed677e6222 Jiri Olsa          2026-06-06  941  
65499074efaf574 Jiri Olsa          2026-06-06  942  static int __bpf_trampoline_link_prog(struct bpf_tramp_node *node,
e6cc9ed677e6222 Jiri Olsa          2026-06-06  943  				      struct bpf_trampoline *tr,
e6cc9ed677e6222 Jiri Olsa          2026-06-06  944  				      struct bpf_prog *tgt_prog,
e6cc9ed677e6222 Jiri Olsa          2026-06-06  945  				      const struct bpf_trampoline_ops *ops,
e6cc9ed677e6222 Jiri Olsa          2026-06-06  946  				      void *data)
e6cc9ed677e6222 Jiri Olsa          2026-06-06  947  {
e6cc9ed677e6222 Jiri Olsa          2026-06-06  948  	enum bpf_tramp_prog_type kind;
e6cc9ed677e6222 Jiri Olsa          2026-06-06  949  	int err = 0;
e6cc9ed677e6222 Jiri Olsa          2026-06-06  950  	int cnt = 0, i;
e6cc9ed677e6222 Jiri Olsa          2026-06-06  951  
65499074efaf574 Jiri Olsa          2026-06-06  952  	kind = bpf_attach_type_to_tramp(node->link->prog);
772e00a29fe12f6 Tejun Heo          2026-08-03  953  	/*
772e00a29fe12f6 Tejun Heo          2026-08-03  954  	 * Arena ctx args are converted only by struct_ops indirect
772e00a29fe12f6 Tejun Heo          2026-08-03  955  	 * trampolines. They must never be attached to a generic trampoline.
772e00a29fe12f6 Tejun Heo          2026-08-03  956  	 */
772e00a29fe12f6 Tejun Heo          2026-08-03 @957  	if (WARN_ON_ONCE(bpf_prog_has_arena_ctx_arg(node->link->prog)))
772e00a29fe12f6 Tejun Heo          2026-08-03  958  		return -ENOTSUPP;
772e00a29fe12f6 Tejun Heo          2026-08-03  959  
e6cc9ed677e6222 Jiri Olsa          2026-06-06  960  	if (tr->extension_prog)
e6cc9ed677e6222 Jiri Olsa          2026-06-06  961  		/* cannot attach fentry/fexit if extension prog is attached.
e6cc9ed677e6222 Jiri Olsa          2026-06-06  962  		 * cannot overwrite extension prog either.
e6cc9ed677e6222 Jiri Olsa          2026-06-06  963  		 */
e6cc9ed677e6222 Jiri Olsa          2026-06-06  964  		return -EBUSY;
e6cc9ed677e6222 Jiri Olsa          2026-06-06  965  
e6cc9ed677e6222 Jiri Olsa          2026-06-06  966  	for (i = 0; i < BPF_TRAMP_MAX; i++)
e6cc9ed677e6222 Jiri Olsa          2026-06-06  967  		cnt += tr->progs_cnt[i];
e6cc9ed677e6222 Jiri Olsa          2026-06-06  968  
e6cc9ed677e6222 Jiri Olsa          2026-06-06  969  	if (kind == BPF_TRAMP_REPLACE) {
e6cc9ed677e6222 Jiri Olsa          2026-06-06  970  		/* Cannot attach extension if fentry/fexit are in use. */
e6cc9ed677e6222 Jiri Olsa          2026-06-06  971  		if (cnt)
e6cc9ed677e6222 Jiri Olsa          2026-06-06  972  			return -EBUSY;
e6cc9ed677e6222 Jiri Olsa          2026-06-06  973  		err = bpf_freplace_check_tgt_prog(tgt_prog);
e6cc9ed677e6222 Jiri Olsa          2026-06-06  974  		if (err)
e6cc9ed677e6222 Jiri Olsa          2026-06-06  975  			return err;
65499074efaf574 Jiri Olsa          2026-06-06  976  		tr->extension_prog = node->link->prog;
e6cc9ed677e6222 Jiri Olsa          2026-06-06  977  		return bpf_arch_text_poke(tr->func.addr, BPF_MOD_NOP,
e6cc9ed677e6222 Jiri Olsa          2026-06-06  978  					  BPF_MOD_JUMP, NULL,
65499074efaf574 Jiri Olsa          2026-06-06  979  					  node->link->prog->bpf_func);
2d419c44658f75e Menglong Dong      2026-01-24  980  	}
65499074efaf574 Jiri Olsa          2026-06-06  981  	err = bpf_trampoline_add_prog(tr, node, cnt);
e6cc9ed677e6222 Jiri Olsa          2026-06-06  982  	if (err)
e6cc9ed677e6222 Jiri Olsa          2026-06-06  983  		return err;
e6cc9ed677e6222 Jiri Olsa          2026-06-06  984  	err = bpf_trampoline_update(tr, true /* lock_direct_mutex */, ops, data);
e6cc9ed677e6222 Jiri Olsa          2026-06-06  985  	if (err)
65499074efaf574 Jiri Olsa          2026-06-06  986  		bpf_trampoline_remove_prog(tr, node);
af3f4134006bf3b Stanislav Fomichev 2022-06-28  987  	return err;
af3f4134006bf3b Stanislav Fomichev 2022-06-28  988  }
af3f4134006bf3b Stanislav Fomichev 2022-06-28  989  

:::::: The code at line 957 was first introduced by commit
:::::: 772e00a29fe12f6af7d0d341c0ac0a26eb5e6be1 bpf: Support __arena and __arena_nullable on struct_ops arguments

:::::: TO: Tejun Heo <tj@kernel.org>
:::::: CC: Kumar Kartikeya Dwivedi <memxor@gmail.com>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-07  3:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07  3:25 [kkdwivedi:arena-args 14/14] kernel/bpf/trampoline.c:957:undefined reference to `bpf_prog_has_arena_ctx_arg' kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.