lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202505210027.EOM219DU-lkp@intel.com>
Date: Wed, 21 May 2025 00:52:38 +0800
From: kernel test robot <lkp@...el.com>
To: David Howells <dhowells@...hat.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: fs/afs/server.c:375:5-24: WARNING: atomic_dec_and_test variation
 before object free at line 383.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   a5806cd506af5a7c19bcd596e4708b5c464bfd21
commit: 4882ba78574e2d8c579658f65f6784b0d139d173 afs: Fix afs_server ref accounting
date:   2 months ago
config: loongarch-randconfig-r061-20250520 (https://download.01.org/0day-ci/archive/20250521/202505210027.EOM219DU-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 14.2.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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505210027.EOM219DU-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> fs/afs/server.c:375:5-24: WARNING: atomic_dec_and_test variation before object free at line 383.
   fs/afs/server.c:357:5-24: WARNING: atomic_dec_and_test variation before object free at line 360.

vim +375 fs/afs/server.c

   365	
   366	/*
   367	 * Drop an active count on a server object.
   368	 */
   369	void afs_unuse_server(struct afs_net *net, struct afs_server *server,
   370			      enum afs_server_trace reason)
   371	{
   372		if (!server)
   373			return;
   374	
 > 375		if (atomic_dec_and_test(&server->active)) {
   376			if (!test_bit(AFS_SERVER_FL_EXPIRED, &server->flags) &&
   377			    READ_ONCE(server->cell->state) < AFS_CELL_FAILED) {
   378				time64_t unuse_time = ktime_get_real_seconds();
   379	
   380				server->unuse_time = unuse_time;
   381				afs_set_server_timer(server, afs_server_gc_delay);
   382			} else {
 > 383				schedule_work(&server->destroyer);
   384			}
   385		}
   386	
   387		afs_put_server(net, server, reason);
   388	}
   389	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ