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>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 17 Nov 2022 10:36:19 +0300
From:   Dan Carpenter <error27@...il.com>
To:     oe-kbuild@...ts.linux.dev, Eric Dumazet <edumazet@...gle.com>
Cc:     lkp@...el.com, oe-kbuild-all@...ts.linux.dev,
        netdev@...r.kernel.org
Subject: [net-next:master 25/27] net/core/dev.c:6409 napi_disable() error:
 uninitialized symbol 'new'.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   d82303df06481235fe7cbaf605075e0c2c87e99b
commit: 4ffa1d1c6842a97e84cfbe56bfcf70edb23608e2 [25/27] net: adopt try_cmpxchg() in napi_{enable|disable}()
config: i386-randconfig-m021
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
| Reported-by: Dan Carpenter <error27@...il.com>

New smatch warnings:
net/core/dev.c:6409 napi_disable() error: uninitialized symbol 'new'.

Old smatch warnings:
net/core/dev.c:10356 netdev_run_todo() warn: passing freed memory 'dev'

vim +/new +6409 net/core/dev.c

3b47d30396bae4 Eric Dumazet   2014-11-06  6393  void napi_disable(struct napi_struct *n)
3b47d30396bae4 Eric Dumazet   2014-11-06  6394  {
719c571970109b Jakub Kicinski 2021-09-24  6395  	unsigned long val, new;
719c571970109b Jakub Kicinski 2021-09-24  6396  
3b47d30396bae4 Eric Dumazet   2014-11-06  6397  	might_sleep();
3b47d30396bae4 Eric Dumazet   2014-11-06  6398  	set_bit(NAPI_STATE_DISABLE, &n->state);
3b47d30396bae4 Eric Dumazet   2014-11-06  6399  
719c571970109b Jakub Kicinski 2021-09-24  6400  	val = READ_ONCE(n->state);
4ffa1d1c6842a9 Eric Dumazet   2022-11-15  6401  	do {
719c571970109b Jakub Kicinski 2021-09-24  6402  		if (val & (NAPIF_STATE_SCHED | NAPIF_STATE_NPSVC)) {
719c571970109b Jakub Kicinski 2021-09-24  6403  			usleep_range(20, 200);
719c571970109b Jakub Kicinski 2021-09-24  6404  			continue;

"new" not initialized for first iteration through the loop.

719c571970109b Jakub Kicinski 2021-09-24  6405  		}
719c571970109b Jakub Kicinski 2021-09-24  6406  
719c571970109b Jakub Kicinski 2021-09-24  6407  		new = val | NAPIF_STATE_SCHED | NAPIF_STATE_NPSVC;
719c571970109b Jakub Kicinski 2021-09-24  6408  		new &= ~(NAPIF_STATE_THREADED | NAPIF_STATE_PREFER_BUSY_POLL);
4ffa1d1c6842a9 Eric Dumazet   2022-11-15 @6409  	} while (!try_cmpxchg(&n->state, &val, new));
                                                                                               ^^^

3b47d30396bae4 Eric Dumazet   2014-11-06  6410  
3b47d30396bae4 Eric Dumazet   2014-11-06  6411  	hrtimer_cancel(&n->timer);
3b47d30396bae4 Eric Dumazet   2014-11-06  6412  
3b47d30396bae4 Eric Dumazet   2014-11-06  6413  	clear_bit(NAPI_STATE_DISABLE, &n->state);
3b47d30396bae4 Eric Dumazet   2014-11-06  6414  }

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Powered by blists - more mailing lists