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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202006240743.8fFRAHmB%lkp@intel.com>
Date:   Wed, 24 Jun 2020 07:51:08 +0800
From:   kernel test robot <lkp@...el.com>
To:     Florian Westphal <fw@...len.de>,
        Steffen Klassert <steffen.klassert@...unet.com>
Cc:     kbuild-all@...ts.01.org, netdev@...r.kernel.org,
        Florian Westphal <fw@...len.de>
Subject: Re: [PATCH ipsec-next 3/6] xfrm: replay: remove advance indirection

Hi Florian,

I love your patch! Perhaps something to improve:

[auto build test WARNING on ipsec-next/master]

url:    https://github.com/0day-ci/linux/commits/Florian-Westphal/xfrm-remove-xfrm-replay-indirections/20200624-035102
base:   https://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next.git master
config: mips-malta_defconfig (attached as .config)
compiler: mipsel-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   net/xfrm/xfrm_replay.c: In function 'xfrm_replay_advance':
>> net/xfrm/xfrm_replay.c:519:13: warning: 'seq' may be used uninitialized in this function [-Wmaybe-uninitialized]
     519 |  if ((!wrap && seq > replay_esn->seq) || wrap > 0) {
         |      ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
   net/xfrm/xfrm_replay.c:509:17: note: 'seq' was declared here
     509 |  u32 diff, pos, seq, seq_hi;
         |                 ^~~

vim +/seq +519 net/xfrm/xfrm_replay.c

3b59df46a449ec9 Steffen Klassert 2012-09-04  504  
2cd084678fc1eb7 Steffen Klassert 2011-03-08  505  static void xfrm_replay_advance_esn(struct xfrm_state *x, __be32 net_seq)
2cd084678fc1eb7 Steffen Klassert 2011-03-08  506  {
2cd084678fc1eb7 Steffen Klassert 2011-03-08  507  	unsigned int bitnr, nr, i;
2cd084678fc1eb7 Steffen Klassert 2011-03-08  508  	int wrap;
2cd084678fc1eb7 Steffen Klassert 2011-03-08  509  	u32 diff, pos, seq, seq_hi;
2cd084678fc1eb7 Steffen Klassert 2011-03-08  510  	struct xfrm_replay_state_esn *replay_esn = x->replay_esn;
2cd084678fc1eb7 Steffen Klassert 2011-03-08  511  
2cd084678fc1eb7 Steffen Klassert 2011-03-08  512  	if (!replay_esn->replay_window)
2cd084678fc1eb7 Steffen Klassert 2011-03-08  513  		return;
2cd084678fc1eb7 Steffen Klassert 2011-03-08  514  
2cd084678fc1eb7 Steffen Klassert 2011-03-08  515  	pos = (replay_esn->seq - 1) % replay_esn->replay_window;
2cd084678fc1eb7 Steffen Klassert 2011-03-08  516  	seq_hi = xfrm_replay_seqhi(x, net_seq);
2cd084678fc1eb7 Steffen Klassert 2011-03-08  517  	wrap = seq_hi - replay_esn->seq_hi;
2cd084678fc1eb7 Steffen Klassert 2011-03-08  518  
2cd084678fc1eb7 Steffen Klassert 2011-03-08 @519  	if ((!wrap && seq > replay_esn->seq) || wrap > 0) {
2cd084678fc1eb7 Steffen Klassert 2011-03-08  520  		if (likely(!wrap))
2cd084678fc1eb7 Steffen Klassert 2011-03-08  521  			diff = seq - replay_esn->seq;
2cd084678fc1eb7 Steffen Klassert 2011-03-08  522  		else
2cd084678fc1eb7 Steffen Klassert 2011-03-08  523  			diff = ~replay_esn->seq + seq + 1;
2cd084678fc1eb7 Steffen Klassert 2011-03-08  524  
2cd084678fc1eb7 Steffen Klassert 2011-03-08  525  		if (diff < replay_esn->replay_window) {
2cd084678fc1eb7 Steffen Klassert 2011-03-08  526  			for (i = 1; i < diff; i++) {
2cd084678fc1eb7 Steffen Klassert 2011-03-08  527  				bitnr = (pos + i) % replay_esn->replay_window;
2cd084678fc1eb7 Steffen Klassert 2011-03-08  528  				nr = bitnr >> 5;
2cd084678fc1eb7 Steffen Klassert 2011-03-08  529  				bitnr = bitnr & 0x1F;
2cd084678fc1eb7 Steffen Klassert 2011-03-08  530  				replay_esn->bmp[nr] &=  ~(1U << bitnr);
2cd084678fc1eb7 Steffen Klassert 2011-03-08  531  			}
2cd084678fc1eb7 Steffen Klassert 2011-03-08  532  		} else {
e756682c8baa47d Steffen Klassert 2011-06-05  533  			nr = (replay_esn->replay_window - 1) >> 5;
2cd084678fc1eb7 Steffen Klassert 2011-03-08  534  			for (i = 0; i <= nr; i++)
2cd084678fc1eb7 Steffen Klassert 2011-03-08  535  				replay_esn->bmp[i] = 0;
2cd084678fc1eb7 Steffen Klassert 2011-03-08  536  		}
2cd084678fc1eb7 Steffen Klassert 2011-03-08  537  
1d9743745bf5ba3 Steffen Klassert 2011-10-11  538  		bitnr = (pos + diff) % replay_esn->replay_window;
2cd084678fc1eb7 Steffen Klassert 2011-03-08  539  		replay_esn->seq = seq;
2cd084678fc1eb7 Steffen Klassert 2011-03-08  540  
2cd084678fc1eb7 Steffen Klassert 2011-03-08  541  		if (unlikely(wrap > 0))
2cd084678fc1eb7 Steffen Klassert 2011-03-08  542  			replay_esn->seq_hi++;
2cd084678fc1eb7 Steffen Klassert 2011-03-08  543  	} else {
2cd084678fc1eb7 Steffen Klassert 2011-03-08  544  		diff = replay_esn->seq - seq;
2cd084678fc1eb7 Steffen Klassert 2011-03-08  545  
1d9743745bf5ba3 Steffen Klassert 2011-10-11  546  		if (pos >= diff)
2cd084678fc1eb7 Steffen Klassert 2011-03-08  547  			bitnr = (pos - diff) % replay_esn->replay_window;
1d9743745bf5ba3 Steffen Klassert 2011-10-11  548  		else
2cd084678fc1eb7 Steffen Klassert 2011-03-08  549  			bitnr = replay_esn->replay_window - (diff - pos);
1d9743745bf5ba3 Steffen Klassert 2011-10-11  550  	}
1d9743745bf5ba3 Steffen Klassert 2011-10-11  551  
50bd870a9e5cca9 Yossef Efraim    2018-01-14  552  	xfrm_dev_state_advance_esn(x);
50bd870a9e5cca9 Yossef Efraim    2018-01-14  553  
2cd084678fc1eb7 Steffen Klassert 2011-03-08  554  	nr = bitnr >> 5;
2cd084678fc1eb7 Steffen Klassert 2011-03-08  555  	bitnr = bitnr & 0x1F;
2cd084678fc1eb7 Steffen Klassert 2011-03-08  556  	replay_esn->bmp[nr] |= (1U << bitnr);
2cd084678fc1eb7 Steffen Klassert 2011-03-08  557  
2cd084678fc1eb7 Steffen Klassert 2011-03-08  558  	if (xfrm_aevent_is_on(xs_net(x)))
f7d9410c27544ca Florian Westphal 2020-06-23  559  		xfrm_replay_notify(x, XFRM_REPLAY_UPDATE);
2cd084678fc1eb7 Steffen Klassert 2011-03-08  560  }
2cd084678fc1eb7 Steffen Klassert 2011-03-08  561  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (20401 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ