public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* kernel/bpf/arena.c:245:6-25: WARNING: atomic_dec_and_test variation before object free at line 249.
@ 2024-12-29 12:27 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-12-29 12:27 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: oe-kbuild-all, linux-kernel, Daniel Borkmann, Barret Rhoden

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   059dd502b263d8a4e2a84809cf1068d6a3905e6f
commit: b90d77e5fd784ada62ddd714d15ee2400c28e1cf bpf: Fix remap of arena.
date:   6 months ago
config: x86_64-randconfig-104-20241229 (https://download.01.org/0day-ci/archive/20241229/202412292037.LXlYSHKl-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)

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/202412292037.LXlYSHKl-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> kernel/bpf/arena.c:245:6-25: WARNING: atomic_dec_and_test variation before object free at line 249.

vim +245 kernel/bpf/arena.c

   238	
   239	static void arena_vm_close(struct vm_area_struct *vma)
   240	{
   241		struct bpf_map *map = vma->vm_file->private_data;
   242		struct bpf_arena *arena = container_of(map, struct bpf_arena, map);
   243		struct vma_list *vml = vma->vm_private_data;
   244	
 > 245		if (!atomic_dec_and_test(&vml->mmap_count))
   246			return;
   247		guard(mutex)(&arena->lock);
   248		/* update link list under lock */
 > 249		list_del(&vml->head);
   250		vma->vm_private_data = NULL;
   251		kfree(vml);
   252	}
   253	

-- 
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:[~2024-12-29 12:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-29 12:27 kernel/bpf/arena.c:245:6-25: WARNING: atomic_dec_and_test variation before object free at line 249 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox