All of lore.kernel.org
 help / color / mirror / Atom feed
* [martin-lau-bpf-next:cgrp.struct_ops.v8 9/12] kernel/bpf/cgroup.c:513 prog_list_replace_item() error: we previously assumed 'pl->link' could be null (see line 510)
@ 2026-05-18  5:02 Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2026-05-18  5:02 UTC (permalink / raw)
  To: oe-kbuild, Martin KaFai Lau; +Cc: lkp, oe-kbuild-all, Martin KaFai Lau

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/martin.lau/bpf-next.git cgrp.struct_ops.v8
head:   1ae5eccb04d5d8c62c310b206b5e5dc4ff1d9c71
commit: 32e27daf9a1563276f88eb17d076f61f8cc8b502 [9/12] bpf: Add infrastructure to support attaching struct_ops to cgroups
config: nios2-randconfig-r073-20260517 (https://download.01.org/0day-ci/archive/20260517/202605170734.0Q0GXEJ9-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 11.5.0
smatch: v0.5.0-9185-gbcc58b9c

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/202605170734.0Q0GXEJ9-lkp@intel.com/

smatch warnings:
kernel/bpf/cgroup.c:513 prog_list_replace_item() error: we previously assumed 'pl->link' could be null (see line 510)

vim +513 kernel/bpf/cgroup.c

95b27b9bf36972 Martin KaFai Lau 2026-05-13  508  static void prog_list_replace_item(struct bpf_prog_list *pl, struct bpf_prog_array_item *item)
95b27b9bf36972 Martin KaFai Lau 2026-05-13  509  {
32e27daf9a1563 Martin KaFai Lau 2026-05-12 @510  	if (pl->link && pl->link->map)
                                                            ^^^^^^^^
If pl->link is NULL

32e27daf9a1563 Martin KaFai Lau 2026-05-12  511  		WRITE_ONCE(item->kdata, bpf_struct_ops_map_kdata(pl->link->map));
32e27daf9a1563 Martin KaFai Lau 2026-05-12  512  	else
95b27b9bf36972 Martin KaFai Lau 2026-05-13 @513  		WRITE_ONCE(item->prog, pl->link->link.prog);
                                                                                       ^^^^^^^^
it's going to crash here.

95b27b9bf36972 Martin KaFai Lau 2026-05-13  514  }

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


^ permalink raw reply	[flat|nested] 2+ messages in thread
* [martin-lau-bpf-next:cgrp.struct_ops.v8 9/12] kernel/bpf/cgroup.c:513 prog_list_replace_item() error: we previously assumed 'pl->link' could be null (see line 510)
@ 2026-05-17  0:00 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-05-17  0:00 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: Martin KaFai Lau <martin.lau@linux.dev>
TO: Martin KaFai Lau <martin.lau@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/martin.lau/bpf-next.git cgrp.struct_ops.v8
head:   1ae5eccb04d5d8c62c310b206b5e5dc4ff1d9c71
commit: 32e27daf9a1563276f88eb17d076f61f8cc8b502 [9/12] bpf: Add infrastructure to support attaching struct_ops to cgroups
:::::: branch date: 20 hours ago
:::::: commit date: 20 hours ago
config: nios2-randconfig-r073-20260517 (https://download.01.org/0day-ci/archive/20260517/202605170734.0Q0GXEJ9-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 11.5.0
smatch: v0.5.0-9185-gbcc58b9c

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/202605170734.0Q0GXEJ9-lkp@intel.com/

smatch warnings:
kernel/bpf/cgroup.c:513 prog_list_replace_item() error: we previously assumed 'pl->link' could be null (see line 510)

vim +513 kernel/bpf/cgroup.c

95b27b9bf36972 Martin KaFai Lau 2026-05-13  507  
95b27b9bf36972 Martin KaFai Lau 2026-05-13  508  static void prog_list_replace_item(struct bpf_prog_list *pl, struct bpf_prog_array_item *item)
95b27b9bf36972 Martin KaFai Lau 2026-05-13  509  {
32e27daf9a1563 Martin KaFai Lau 2026-05-12 @510  	if (pl->link && pl->link->map)
32e27daf9a1563 Martin KaFai Lau 2026-05-12  511  		WRITE_ONCE(item->kdata, bpf_struct_ops_map_kdata(pl->link->map));
32e27daf9a1563 Martin KaFai Lau 2026-05-12  512  	else
95b27b9bf36972 Martin KaFai Lau 2026-05-13 @513  		WRITE_ONCE(item->prog, pl->link->link.prog);
95b27b9bf36972 Martin KaFai Lau 2026-05-13  514  }
95b27b9bf36972 Martin KaFai Lau 2026-05-13  515  

:::::: The code at line 513 was first introduced by commit
:::::: 95b27b9bf369725868da48816a0dda25fb69805f bpf: Add prog_list_init_item(), prog_list_replace_item(), and prog_list_id()

:::::: TO: Martin KaFai Lau <martin.lau@kernel.org>
:::::: CC: Martin KaFai Lau <martin.lau@kernel.org>

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

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

end of thread, other threads:[~2026-05-18  5:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-18  5:02 [martin-lau-bpf-next:cgrp.struct_ops.v8 9/12] kernel/bpf/cgroup.c:513 prog_list_replace_item() error: we previously assumed 'pl->link' could be null (see line 510) Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2026-05-17  0:00 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.