* kernel/bpf/token.c:50:6-27: WARNING: atomic_dec_and_test variation before object free at line 54.
@ 2024-10-13 6:58 kernel test robot
2024-10-14 20:13 ` Andrii Nakryiko
0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2024-10-13 6:58 UTC (permalink / raw)
To: Andrii Nakryiko; +Cc: oe-kbuild-all, linux-kernel, Alexei Starovoitov
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 36c254515dc6592c44db77b84908358979dd6b50
commit: 35f96de04127d332a5c5e8a155d31f452f88c76d bpf: Introduce BPF token object
date: 9 months ago
config: alpha-randconfig-r054-20241012 (https://download.01.org/0day-ci/archive/20241013/202410131412.5csjqw8L-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 13.3.0
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/202410131412.5csjqw8L-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> kernel/bpf/token.c:50:6-27: WARNING: atomic_dec_and_test variation before object free at line 54.
vim +50 kernel/bpf/token.c
44
45 void bpf_token_put(struct bpf_token *token)
46 {
47 if (!token)
48 return;
49
> 50 if (!atomic64_dec_and_test(&token->refcnt))
51 return;
52
53 INIT_WORK(&token->work, bpf_token_put_deferred);
> 54 schedule_work(&token->work);
55 }
56
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: kernel/bpf/token.c:50:6-27: WARNING: atomic_dec_and_test variation before object free at line 54.
2024-10-13 6:58 kernel/bpf/token.c:50:6-27: WARNING: atomic_dec_and_test variation before object free at line 54 kernel test robot
@ 2024-10-14 20:13 ` Andrii Nakryiko
0 siblings, 0 replies; 4+ messages in thread
From: Andrii Nakryiko @ 2024-10-14 20:13 UTC (permalink / raw)
To: kernel test robot
Cc: Andrii Nakryiko, oe-kbuild-all, linux-kernel, Alexei Starovoitov
On Sat, Oct 12, 2024 at 11:58 PM kernel test robot <lkp@intel.com> wrote:
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 36c254515dc6592c44db77b84908358979dd6b50
> commit: 35f96de04127d332a5c5e8a155d31f452f88c76d bpf: Introduce BPF token object
> date: 9 months ago
> config: alpha-randconfig-r054-20241012 (https://download.01.org/0day-ci/archive/20241013/202410131412.5csjqw8L-lkp@intel.com/config)
> compiler: alpha-linux-gcc (GCC) 13.3.0
>
> 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/202410131412.5csjqw8L-lkp@intel.com/
>
> cocci warnings: (new ones prefixed by >>)
> >> kernel/bpf/token.c:50:6-27: WARNING: atomic_dec_and_test variation before object free at line 54.
Can someone please explain what this means and why the code below is
broken, according to coccinelle?
>
> vim +50 kernel/bpf/token.c
>
> 44
> 45 void bpf_token_put(struct bpf_token *token)
> 46 {
> 47 if (!token)
> 48 return;
> 49
> > 50 if (!atomic64_dec_and_test(&token->refcnt))
> 51 return;
> 52
> 53 INIT_WORK(&token->work, bpf_token_put_deferred);
> > 54 schedule_work(&token->work);
this is not "object free", but even if it was, I still don't see the
problem, tbh...
> 55 }
> 56
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 4+ messages in thread
* kernel/bpf/token.c:50:6-27: WARNING: atomic_dec_and_test variation before object free at line 54.
@ 2024-10-31 9:01 kernel test robot
0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2024-10-31 9:01 UTC (permalink / raw)
To: Andrii Nakryiko; +Cc: oe-kbuild-all, linux-kernel, Alexei Starovoitov
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0fc810ae3ae110f9e2fcccce80fc8c8d62f97907
commit: 35f96de04127d332a5c5e8a155d31f452f88c76d bpf: Introduce BPF token object
date: 9 months ago
config: i386-randconfig-051-20241031 (https://download.01.org/0day-ci/archive/20241031/202410311704.yIRxjp0C-lkp@intel.com/config)
compiler: clang version 19.1.2 (https://github.com/llvm/llvm-project 7ba7d8e2f7b6445b60679da826210cdde29eaf8b)
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/202410311704.yIRxjp0C-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> kernel/bpf/token.c:50:6-27: WARNING: atomic_dec_and_test variation before object free at line 54.
vim +50 kernel/bpf/token.c
44
45 void bpf_token_put(struct bpf_token *token)
46 {
47 if (!token)
48 return;
49
> 50 if (!atomic64_dec_and_test(&token->refcnt))
51 return;
52
53 INIT_WORK(&token->work, bpf_token_put_deferred);
> 54 schedule_work(&token->work);
55 }
56
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 4+ messages in thread* kernel/bpf/token.c:50:6-27: WARNING: atomic_dec_and_test variation before object free at line 54.
@ 2024-12-18 21:18 kernel test robot
0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2024-12-18 21:18 UTC (permalink / raw)
To: Andrii Nakryiko; +Cc: oe-kbuild-all, linux-kernel, Alexei Starovoitov
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c061cf420ded391e32f99cd483e1e0107f213b12
commit: 35f96de04127d332a5c5e8a155d31f452f88c76d bpf: Introduce BPF token object
date: 11 months ago
config: hexagon-randconfig-r051-20241218 (https://download.01.org/0day-ci/archive/20241219/202412190521.9R1HKuug-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 2dc22615fd46ab2566d0f26d5ba234ab12dc4bf8)
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/202412190521.9R1HKuug-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> kernel/bpf/token.c:50:6-27: WARNING: atomic_dec_and_test variation before object free at line 54.
vim +50 kernel/bpf/token.c
44
45 void bpf_token_put(struct bpf_token *token)
46 {
47 if (!token)
48 return;
49
> 50 if (!atomic64_dec_and_test(&token->refcnt))
51 return;
52
53 INIT_WORK(&token->work, bpf_token_put_deferred);
> 54 schedule_work(&token->work);
55 }
56
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-12-18 21:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-13 6:58 kernel/bpf/token.c:50:6-27: WARNING: atomic_dec_and_test variation before object free at line 54 kernel test robot
2024-10-14 20:13 ` Andrii Nakryiko
2024-10-31 9:01 kernel test robot
2024-12-18 21:18 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
all inboxes | Powered by JetHome®