All of lore.kernel.org
 help / color / mirror / Atom feed
* [kkdwivedi:fermata 187/284] kernel/bpf/states.c:557 same_refs() error: memcmp() '&a->refs[i]->ptr' too small (4 vs 8)
@ 2026-11-22  5:35 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-11-22  5:35 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

Unfiltered warning: this smatch report is sent as-is and has not been
reviewed for false positives, so please treat it with due skepticism.

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Kumar Kartikeya Dwivedi <memxor@gmail.com>

tree:   https://github.com/kkdwivedi/linux fermata
head:   7f7b1fb0e49ec9ac76f5d9f32824c34f601bd438
commit: 594aa7bcd085fc1bee0df72e792e57426e710157 [187/284] bpf: Add reference-owned slot arrays to verifier state
:::::: branch date: 76 minutes ago
:::::: commit date: 5 hours ago
config: csky-randconfig-2200-20261122 (https://download.01.org/0day-ci/archive/20261122/20261122062625.bcP0YNJd-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 9.5.0
smatch: v0.5.0-9187-g5189e3fb

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/20261122062625.bcP0YNJd-lkp@intel.com/

smatch warnings:
kernel/bpf/states.c:557 same_refs() error: memcmp() '&a->refs[i]->ptr' too small (4 vs 8)
kernel/bpf/states.c:557 same_refs() error: memcmp() '&b->refs[i]->ptr' too small (4 vs 8)

vim +557 kernel/bpf/states.c

594aa7bcd085fc Kumar Kartikeya Dwivedi 2026-09-29  550  
a03670bf0cf38b Alexei Starovoitov      2026-11-20  551  static bool same_refs(const struct bpf_verifier_state *a, const struct bpf_verifier_state *b)
a03670bf0cf38b Alexei Starovoitov      2026-11-20  552  {
a03670bf0cf38b Alexei Starovoitov      2026-11-20  553  	u32 i;
a03670bf0cf38b Alexei Starovoitov      2026-11-20  554  
3cd88d44c75b33 Kumar Kartikeya Dwivedi 2026-11-13  555  	for (i = 0; i < a->acquired_refs; i++) {
a03670bf0cf38b Alexei Starovoitov      2026-11-20  556  		if (a->refs[i].type != b->refs[i].type || a->refs[i].id != b->refs[i].id ||
a03670bf0cf38b Alexei Starovoitov      2026-11-20 @557  		    memcmp(&a->refs[i].ptr, &b->refs[i].ptr, sizeof(u64)))
a03670bf0cf38b Alexei Starovoitov      2026-11-20  558  			return false;
3cd88d44c75b33 Kumar Kartikeya Dwivedi 2026-11-13  559  		/* a state doesn't stand for one where another frame is to release it */
3cd88d44c75b33 Kumar Kartikeya Dwivedi 2026-11-13  560  		if (a->refs[i].frameno != b->refs[i].frameno)
3cd88d44c75b33 Kumar Kartikeya Dwivedi 2026-11-13  561  			return false;
2b95051722e6ed Kumar Kartikeya Dwivedi 2026-11-13  562  		/* or where a frame above the owner got it in another argument */
2b95051722e6ed Kumar Kartikeya Dwivedi 2026-11-13  563  		if (memcmp(a->refs[i].args, b->refs[i].args, sizeof(a->refs[i].args)))
2b95051722e6ed Kumar Kartikeya Dwivedi 2026-11-13  564  			return false;
594aa7bcd085fc Kumar Kartikeya Dwivedi 2026-09-29  565  		if (!same_ref_slots(&a->refs[i], &b->refs[i]))
594aa7bcd085fc Kumar Kartikeya Dwivedi 2026-09-29  566  			return false;
3cd88d44c75b33 Kumar Kartikeya Dwivedi 2026-11-13  567  	}
a03670bf0cf38b Alexei Starovoitov      2026-11-20  568  	return true;
a03670bf0cf38b Alexei Starovoitov      2026-11-20  569  }
a03670bf0cf38b Alexei Starovoitov      2026-11-20  570  

:::::: The code at line 557 was first introduced by commit
:::::: a03670bf0cf38b9429887b8d8f9334e1fd1b3e95 bpf: Compare states by join_key, then by value

:::::: TO: Alexei Starovoitov <ast@kernel.org>
:::::: CC: Alexei Starovoitov <ast@kernel.org>

-- 
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-11-22  5:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22  5:35 [kkdwivedi:fermata 187/284] kernel/bpf/states.c:557 same_refs() error: memcmp() '&a->refs[i]->ptr' too small (4 vs 8) 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.