[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202006240945.SFT9l5cv%lkp@intel.com>
Date: Wed, 24 Jun 2020 09:35:38 +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, clang-built-linux@...glegroups.com,
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: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 1d4c87335d5236ea1f35937e1014980ba961ae34)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
>> net/xfrm/xfrm_replay.c:519:16: warning: variable 'seq' is uninitialized when used here [-Wuninitialized]
if ((!wrap && seq > replay_esn->seq) || wrap > 0) {
^~~
net/xfrm/xfrm_replay.c:509:20: note: initialize the variable 'seq' to silence this warning
u32 diff, pos, seq, seq_hi;
^
= 0
1 warning generated.
vim +/seq +519 net/xfrm/xfrm_replay.c
3b59df46a449ec Steffen Klassert 2012-09-04 504
2cd084678fc1eb Steffen Klassert 2011-03-08 505 static void xfrm_replay_advance_esn(struct xfrm_state *x, __be32 net_seq)
2cd084678fc1eb Steffen Klassert 2011-03-08 506 {
2cd084678fc1eb Steffen Klassert 2011-03-08 507 unsigned int bitnr, nr, i;
2cd084678fc1eb Steffen Klassert 2011-03-08 508 int wrap;
2cd084678fc1eb Steffen Klassert 2011-03-08 509 u32 diff, pos, seq, seq_hi;
2cd084678fc1eb Steffen Klassert 2011-03-08 510 struct xfrm_replay_state_esn *replay_esn = x->replay_esn;
2cd084678fc1eb Steffen Klassert 2011-03-08 511
2cd084678fc1eb Steffen Klassert 2011-03-08 512 if (!replay_esn->replay_window)
2cd084678fc1eb Steffen Klassert 2011-03-08 513 return;
2cd084678fc1eb Steffen Klassert 2011-03-08 514
2cd084678fc1eb Steffen Klassert 2011-03-08 515 pos = (replay_esn->seq - 1) % replay_esn->replay_window;
2cd084678fc1eb Steffen Klassert 2011-03-08 516 seq_hi = xfrm_replay_seqhi(x, net_seq);
2cd084678fc1eb Steffen Klassert 2011-03-08 517 wrap = seq_hi - replay_esn->seq_hi;
2cd084678fc1eb Steffen Klassert 2011-03-08 518
2cd084678fc1eb Steffen Klassert 2011-03-08 @519 if ((!wrap && seq > replay_esn->seq) || wrap > 0) {
2cd084678fc1eb Steffen Klassert 2011-03-08 520 if (likely(!wrap))
2cd084678fc1eb Steffen Klassert 2011-03-08 521 diff = seq - replay_esn->seq;
2cd084678fc1eb Steffen Klassert 2011-03-08 522 else
2cd084678fc1eb Steffen Klassert 2011-03-08 523 diff = ~replay_esn->seq + seq + 1;
2cd084678fc1eb Steffen Klassert 2011-03-08 524
2cd084678fc1eb Steffen Klassert 2011-03-08 525 if (diff < replay_esn->replay_window) {
2cd084678fc1eb Steffen Klassert 2011-03-08 526 for (i = 1; i < diff; i++) {
2cd084678fc1eb Steffen Klassert 2011-03-08 527 bitnr = (pos + i) % replay_esn->replay_window;
2cd084678fc1eb Steffen Klassert 2011-03-08 528 nr = bitnr >> 5;
2cd084678fc1eb Steffen Klassert 2011-03-08 529 bitnr = bitnr & 0x1F;
2cd084678fc1eb Steffen Klassert 2011-03-08 530 replay_esn->bmp[nr] &= ~(1U << bitnr);
2cd084678fc1eb Steffen Klassert 2011-03-08 531 }
2cd084678fc1eb Steffen Klassert 2011-03-08 532 } else {
e756682c8baa47 Steffen Klassert 2011-06-05 533 nr = (replay_esn->replay_window - 1) >> 5;
2cd084678fc1eb Steffen Klassert 2011-03-08 534 for (i = 0; i <= nr; i++)
2cd084678fc1eb Steffen Klassert 2011-03-08 535 replay_esn->bmp[i] = 0;
2cd084678fc1eb Steffen Klassert 2011-03-08 536 }
2cd084678fc1eb Steffen Klassert 2011-03-08 537
1d9743745bf5ba Steffen Klassert 2011-10-11 538 bitnr = (pos + diff) % replay_esn->replay_window;
2cd084678fc1eb Steffen Klassert 2011-03-08 539 replay_esn->seq = seq;
2cd084678fc1eb Steffen Klassert 2011-03-08 540
2cd084678fc1eb Steffen Klassert 2011-03-08 541 if (unlikely(wrap > 0))
2cd084678fc1eb Steffen Klassert 2011-03-08 542 replay_esn->seq_hi++;
2cd084678fc1eb Steffen Klassert 2011-03-08 543 } else {
2cd084678fc1eb Steffen Klassert 2011-03-08 544 diff = replay_esn->seq - seq;
2cd084678fc1eb Steffen Klassert 2011-03-08 545
1d9743745bf5ba Steffen Klassert 2011-10-11 546 if (pos >= diff)
2cd084678fc1eb Steffen Klassert 2011-03-08 547 bitnr = (pos - diff) % replay_esn->replay_window;
1d9743745bf5ba Steffen Klassert 2011-10-11 548 else
2cd084678fc1eb Steffen Klassert 2011-03-08 549 bitnr = replay_esn->replay_window - (diff - pos);
1d9743745bf5ba Steffen Klassert 2011-10-11 550 }
1d9743745bf5ba Steffen Klassert 2011-10-11 551
50bd870a9e5cca Yossef Efraim 2018-01-14 552 xfrm_dev_state_advance_esn(x);
50bd870a9e5cca Yossef Efraim 2018-01-14 553
2cd084678fc1eb Steffen Klassert 2011-03-08 554 nr = bitnr >> 5;
2cd084678fc1eb Steffen Klassert 2011-03-08 555 bitnr = bitnr & 0x1F;
2cd084678fc1eb Steffen Klassert 2011-03-08 556 replay_esn->bmp[nr] |= (1U << bitnr);
2cd084678fc1eb Steffen Klassert 2011-03-08 557
2cd084678fc1eb Steffen Klassert 2011-03-08 558 if (xfrm_aevent_is_on(xs_net(x)))
f7d9410c27544c Florian Westphal 2020-06-23 559 xfrm_replay_notify(x, XFRM_REPLAY_UPDATE);
2cd084678fc1eb Steffen Klassert 2011-03-08 560 }
2cd084678fc1eb 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" (73984 bytes)
Powered by blists - more mailing lists