All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [kkdwivedi:fermata 187/284] kernel/bpf/states.c:557 same_refs() error: memcmp() '&a->refs[i]->ptr' too small (4 vs 8)
Date: Sun, 22 Nov 2026 06:35:09 +0100	[thread overview]
Message-ID: <20261122062625.bcP0YNJd-lkp@intel.com> (raw)

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

                 reply	other threads:[~2026-11-22  5:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261122062625.bcP0YNJd-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.