From: kernel test robot <lkp@intel.com>
To: Dave Marchevsky <davemarchevsky@fb.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Alexei Starovoitov <ast@kernel.org>
Subject: kernel/bpf/helpers.c:1960:13: sparse: sparse: Using plain integer as NULL pointer
Date: Sat, 2 Dec 2023 09:52:36 +0800 [thread overview]
Message-ID: <202312020920.S1lRh7FH-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 815fb87b753055df2d9e50f6cd80eb10235fe3e9
commit: c3c510ce431cd99fa10dcd50d995c8e89330ee5b bpf: Add 'owner' field to bpf_{list,rb}_node
date: 5 months ago
config: hexagon-randconfig-r121-20231119 (https://download.01.org/0day-ci/archive/20231202/202312020920.S1lRh7FH-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce: (https://download.01.org/0day-ci/archive/20231202/202312020920.S1lRh7FH-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/202312020920.S1lRh7FH-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> kernel/bpf/helpers.c:1960:13: sparse: sparse: Using plain integer as NULL pointer
kernel/bpf/helpers.c:2059:13: sparse: sparse: Using plain integer as NULL pointer
kernel/bpf/helpers.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/umh.h, include/linux/kmod.h, ...):
include/linux/page-flags.h:240:46: sparse: sparse: self-comparison always evaluates to false
kernel/bpf/helpers.c:2419:18: sparse: sparse: context imbalance in 'bpf_rcu_read_lock' - wrong count at exit
kernel/bpf/helpers.c:2424:18: sparse: sparse: context imbalance in 'bpf_rcu_read_unlock' - unexpected unlock
vim +1960 kernel/bpf/helpers.c
1944
1945 static int __bpf_list_add(struct bpf_list_node_kern *node,
1946 struct bpf_list_head *head,
1947 bool tail, struct btf_record *rec, u64 off)
1948 {
1949 struct list_head *n = &node->list_head, *h = (void *)head;
1950
1951 /* If list_head was 0-initialized by map, bpf_obj_init_field wasn't
1952 * called on its fields, so init here
1953 */
1954 if (unlikely(!h->next))
1955 INIT_LIST_HEAD(h);
1956
1957 /* node->owner != NULL implies !list_empty(n), no need to separately
1958 * check the latter
1959 */
> 1960 if (cmpxchg(&node->owner, NULL, BPF_PTR_POISON)) {
1961 /* Only called from BPF prog, no need to migrate_disable */
1962 __bpf_obj_drop_impl((void *)n - off, rec);
1963 return -EINVAL;
1964 }
1965
1966 tail ? list_add_tail(n, h) : list_add(n, h);
1967 WRITE_ONCE(node->owner, head);
1968
1969 return 0;
1970 }
1971
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2023-12-02 1:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-02 1:52 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-11-19 18:43 kernel/bpf/helpers.c:1960:13: sparse: sparse: Using plain integer as NULL pointer kernel test robot
2023-11-19 9:48 kernel test robot
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=202312020920.S1lRh7FH-lkp@intel.com \
--to=lkp@intel.com \
--cc=ast@kernel.org \
--cc=davemarchevsky@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox