public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Alexei Starovoitov <ast@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Daniel Borkmann <daniel@iogearbox.net>,
	Barret Rhoden <brho@google.com>
Subject: kernel/bpf/arena.c:245:6-25: WARNING: atomic_dec_and_test variation before object free at line 249.
Date: Sun, 29 Dec 2024 20:27:36 +0800	[thread overview]
Message-ID: <202412292037.LXlYSHKl-lkp@intel.com> (raw)

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

                 reply	other threads:[~2024-12-29 12:27 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=202412292037.LXlYSHKl-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ast@kernel.org \
    --cc=brho@google.com \
    --cc=daniel@iogearbox.net \
    --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