oe-kbuild.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v1 bpf-next 08/11] bpf, x86: add support for indirect jumps
@ 2025-08-18  0:35 ` kernel test robot
  2025-08-18  7:57   ` Dan Carpenter
  2025-08-18  8:22   ` Anton Protopopov
  0 siblings, 2 replies; 3+ messages in thread
From: kernel test robot @ 2025-08-18  0:35 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20250816180631.952085-9-a.s.protopopov@gmail.com>
References: <20250816180631.952085-9-a.s.protopopov@gmail.com>
TO: Anton Protopopov <a.s.protopopov@gmail.com>
TO: bpf@vger.kernel.org
TO: Alexei Starovoitov <ast@kernel.org>
TO: Andrii Nakryiko <andrii@kernel.org>
TO: Anton Protopopov <aspsk@isovalent.com>
TO: Daniel Borkmann <daniel@iogearbox.net>
TO: Eduard Zingerman <eddyz87@gmail.com>
TO: Quentin Monnet <qmo@kernel.org>
TO: Yonghong Song <yonghong.song@linux.dev>

Hi Anton,

kernel test robot noticed the following build warnings:

[auto build test WARNING on bpf-next/master]

url:    https://github.com/intel-lab-lkp/linux/commits/Anton-Protopopov/bpf-fix-the-return-value-of-push_stack/20250817-020411
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link:    https://lore.kernel.org/r/20250816180631.952085-9-a.s.protopopov%40gmail.com
patch subject: [PATCH v1 bpf-next 08/11] bpf, x86: add support for indirect jumps
:::::: branch date: 30 hours ago
:::::: commit date: 30 hours ago
config: x86_64-randconfig-161-20250818 (https://download.01.org/0day-ci/archive/20250818/202508180805.aUCPtTuQ-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0

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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202508180805.aUCPtTuQ-lkp@intel.com/

smatch warnings:
kernel/bpf/verifier.c:17800 push_goto_x_edge() error: uninitialized symbol 'w'.
kernel/bpf/verifier.c:25013 compute_scc() warn: unsigned 'succ_cnt' is never less than zero.

vim +/w +17800 kernel/bpf/verifier.c

a34675076b990b Anton Protopopov 2025-08-16  17775  
a34675076b990b Anton Protopopov 2025-08-16  17776  static int push_goto_x_edge(int t, struct bpf_verifier_env *env, struct jt *jt)
a34675076b990b Anton Protopopov 2025-08-16  17777  {
a34675076b990b Anton Protopopov 2025-08-16  17778  	int *insn_stack = env->cfg.insn_stack;
a34675076b990b Anton Protopopov 2025-08-16  17779  	int *insn_state = env->cfg.insn_state;
a34675076b990b Anton Protopopov 2025-08-16  17780  	u16 prev;
a34675076b990b Anton Protopopov 2025-08-16  17781  	int w;
a34675076b990b Anton Protopopov 2025-08-16  17782  
a34675076b990b Anton Protopopov 2025-08-16  17783  	for (prev = GET_HIGH(insn_state[t]); prev < jt->off_cnt; prev++) {
a34675076b990b Anton Protopopov 2025-08-16  17784  		w = jt->off[prev];
a34675076b990b Anton Protopopov 2025-08-16  17785  
a34675076b990b Anton Protopopov 2025-08-16  17786  		/* EXPLORED || DISCOVERED */
a34675076b990b Anton Protopopov 2025-08-16  17787  		if (insn_state[w])
a34675076b990b Anton Protopopov 2025-08-16  17788  			continue;
a34675076b990b Anton Protopopov 2025-08-16  17789  
a34675076b990b Anton Protopopov 2025-08-16  17790  		break;
a34675076b990b Anton Protopopov 2025-08-16  17791  	}
a34675076b990b Anton Protopopov 2025-08-16  17792  
a34675076b990b Anton Protopopov 2025-08-16  17793  	if (prev == jt->off_cnt)
a34675076b990b Anton Protopopov 2025-08-16  17794  		return DONE_EXPLORING;
a34675076b990b Anton Protopopov 2025-08-16  17795  
a34675076b990b Anton Protopopov 2025-08-16  17796  	mark_prune_point(env, t);
a34675076b990b Anton Protopopov 2025-08-16  17797  
a34675076b990b Anton Protopopov 2025-08-16  17798  	if (env->cfg.cur_stack >= env->prog->len)
a34675076b990b Anton Protopopov 2025-08-16  17799  		return -E2BIG;
a34675076b990b Anton Protopopov 2025-08-16 @17800  	insn_stack[env->cfg.cur_stack++] = w;
a34675076b990b Anton Protopopov 2025-08-16  17801  
a34675076b990b Anton Protopopov 2025-08-16  17802  	mark_jmp_point(env, w);
a34675076b990b Anton Protopopov 2025-08-16  17803  
a34675076b990b Anton Protopopov 2025-08-16  17804  	SET_HIGH(insn_state[t], prev + 1);
a34675076b990b Anton Protopopov 2025-08-16  17805  	return KEEP_EXPLORING;
a34675076b990b Anton Protopopov 2025-08-16  17806  }
a34675076b990b Anton Protopopov 2025-08-16  17807  

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 bpf-next 08/11] bpf, x86: add support for indirect jumps
  2025-08-18  0:35 ` [PATCH v1 bpf-next 08/11] bpf, x86: add support for indirect jumps kernel test robot
@ 2025-08-18  7:57   ` Dan Carpenter
  2025-08-18  8:22   ` Anton Protopopov
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2025-08-18  7:57 UTC (permalink / raw)
  To: oe-kbuild, Anton Protopopov, bpf, Alexei Starovoitov,
	Andrii Nakryiko, Anton Protopopov, Daniel Borkmann,
	Eduard Zingerman, Quentin Monnet, Yonghong Song
  Cc: lkp, oe-kbuild-all

Hi Anton,

kernel test robot noticed the following build warnings:

url:    https://github.com/intel-lab-lkp/linux/commits/Anton-Protopopov/bpf-fix-the-return-value-of-push_stack/20250817-020411
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link:    https://lore.kernel.org/r/20250816180631.952085-9-a.s.protopopov%40gmail.com
patch subject: [PATCH v1 bpf-next 08/11] bpf, x86: add support for indirect jumps
config: x86_64-randconfig-161-20250818 (https://download.01.org/0day-ci/archive/20250818/202508180805.aUCPtTuQ-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0

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>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202508180805.aUCPtTuQ-lkp@intel.com/

smatch warnings:
kernel/bpf/verifier.c:25013 compute_scc() warn: unsigned 'succ_cnt' is never less than zero.

vim +/w +25013 kernel/bpf/verifier.c
 24891  static int compute_scc(struct bpf_verifier_env *env)
 24892  {
 24893          const u32 NOT_ON_STACK = U32_MAX;
 24894  
 24895          struct bpf_insn_aux_data *aux = env->insn_aux_data;
 24896          const u32 insn_cnt = env->prog->len;
 24897          int stack_sz, dfs_sz, err = 0;
 24898          u32 *stack, *pre, *low, *dfs;
 24899          u32 succ_cnt, i, j, t, w;
                ^^^^^^^^^^^^

 24900          u32 next_preorder_num;
 24901          u32 next_scc_id;
 24902          bool assign_scc;
 24903  
 24904          next_preorder_num = 1;
 24905          next_scc_id = 1;
 24906          /*

[ snip ]

 25008                                  next_preorder_num++;
 25009                                  stack[stack_sz++] = w;
 25010                          }
 25011                          /* Visit 'w' successors */
 25012                          succ_cnt = insn_successors(env, env->prog, w, &succ);
 25013                          if (succ_cnt < 0) {
                                    ^^^^^^^^^^^^
unsigned can't be negative.

 25014                                  err = succ_cnt;
 25015                                  goto exit;
 25016  
 25017                          }
 25018                          for (j = 0; j < succ_cnt; ++j) {
 25019                                  if (pre[succ[j]]) {
 25020                                          low[w] = min(low[w], low[succ[j]]);

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 bpf-next 08/11] bpf, x86: add support for indirect jumps
  2025-08-18  0:35 ` [PATCH v1 bpf-next 08/11] bpf, x86: add support for indirect jumps kernel test robot
  2025-08-18  7:57   ` Dan Carpenter
@ 2025-08-18  8:22   ` Anton Protopopov
  1 sibling, 0 replies; 3+ messages in thread
From: Anton Protopopov @ 2025-08-18  8:22 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: oe-kbuild, bpf, Alexei Starovoitov, Andrii Nakryiko,
	Anton Protopopov, Daniel Borkmann, Eduard Zingerman,
	Quentin Monnet, Yonghong Song, lkp, oe-kbuild-all

On 25/08/18 10:57AM, Dan Carpenter wrote:
> Hi Anton,
> 
> kernel test robot noticed the following build warnings:
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Anton-Protopopov/bpf-fix-the-return-value-of-push_stack/20250817-020411
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
> patch link:    https://lore.kernel.org/r/20250816180631.952085-9-a.s.protopopov%40gmail.com
> patch subject: [PATCH v1 bpf-next 08/11] bpf, x86: add support for indirect jumps
> config: x86_64-randconfig-161-20250818 (https://download.01.org/0day-ci/archive/20250818/202508180805.aUCPtTuQ-lkp@intel.com/config)
> compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0
> 
> 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>
> | Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> | Closes: https://lore.kernel.org/r/202508180805.aUCPtTuQ-lkp@intel.com/
> 
> smatch warnings:
> kernel/bpf/verifier.c:25013 compute_scc() warn: unsigned 'succ_cnt' is never less than zero.
> 
> vim +/w +25013 kernel/bpf/verifier.c
>  24891  static int compute_scc(struct bpf_verifier_env *env)
>  24892  {
>  24893          const u32 NOT_ON_STACK = U32_MAX;
>  24894  
>  24895          struct bpf_insn_aux_data *aux = env->insn_aux_data;
>  24896          const u32 insn_cnt = env->prog->len;
>  24897          int stack_sz, dfs_sz, err = 0;
>  24898          u32 *stack, *pre, *low, *dfs;
>  24899          u32 succ_cnt, i, j, t, w;
>                 ^^^^^^^^^^^^
> 
>  24900          u32 next_preorder_num;
>  24901          u32 next_scc_id;
>  24902          bool assign_scc;
>  24903  
>  24904          next_preorder_num = 1;
>  24905          next_scc_id = 1;
>  24906          /*
> 
> [ snip ]
> 
>  25008                                  next_preorder_num++;
>  25009                                  stack[stack_sz++] = w;
>  25010                          }
>  25011                          /* Visit 'w' successors */
>  25012                          succ_cnt = insn_successors(env, env->prog, w, &succ);
>  25013                          if (succ_cnt < 0) {
>                                     ^^^^^^^^^^^^
> unsigned can't be negative.

Thanks! Fixed, will squash into v2.

>  25014                                  err = succ_cnt;
>  25015                                  goto exit;
>  25016  
>  25017                          }
>  25018                          for (j = 0; j < succ_cnt; ++j) {
>  25019                                  if (pre[succ[j]]) {
>  25020                                          low[w] = min(low[w], low[succ[j]]);
> 
> -- 
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-18  8:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20250816180631.952085-9-a.s.protopopov@gmail.com>
2025-08-18  0:35 ` [PATCH v1 bpf-next 08/11] bpf, x86: add support for indirect jumps kernel test robot
2025-08-18  7:57   ` Dan Carpenter
2025-08-18  8:22   ` Anton Protopopov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).