Re: [PATCH] net: xfrm: fix shift-out-of-bounce

From: kernel test robot
Date: Tue Jul 27 2021 - 13:47:05 EST


Hi Pavel,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on ipsec-next/master]
[also build test ERROR on next-20210726]
[cannot apply to ipsec/master net-next/master net/master v5.14-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Pavel-Skripkin/net-xfrm-fix-shift-out-of-bounce/20210727-224549
base: https://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next.git master
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 10.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
# https://github.com/0day-ci/linux/commit/0d1cb044926e3d81c86b5add2eeaf38c7aec7f90
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Pavel-Skripkin/net-xfrm-fix-shift-out-of-bounce/20210727-224549
git checkout 0d1cb044926e3d81c86b5add2eeaf38c7aec7f90
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=sh SHELL=/bin/bash net/xfrm/

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

All error/warnings (new ones prefixed by >>):

net/xfrm/xfrm_user.c: In function 'xfrm_set_default':
>> net/xfrm/xfrm_user.c:1977:2: error: expected ';' before 'net'
1977 | net->xfrm.policy_default = (old_default & (0xff ^ dirmask))
| ^~~
net/xfrm/xfrm_user.c:1970:5: warning: unused variable 'old_default' [-Wunused-variable]
1970 | u8 old_default = net->xfrm.policy_default;
| ^~~~~~~~~~~
>> net/xfrm/xfrm_user.c:1969:5: warning: variable 'dirmask' set but not used [-Wunused-but-set-variable]
1969 | u8 dirmask;
| ^~~~~~~

Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_PDC
Depends on SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && HAS_DMA
Selected by
- SND_ATMEL_SOC_SSC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC
- SND_ATMEL_SOC_SSC_PDC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && ATMEL_SSC


vim +1977 net/xfrm/xfrm_user.c

^1da177e4c3f41 Linus Torvalds 2005-04-16 1963
2d151d39073aff Steffen Klassert 2021-07-18 1964 static int xfrm_set_default(struct sk_buff *skb, struct nlmsghdr *nlh,
2d151d39073aff Steffen Klassert 2021-07-18 1965 struct nlattr **attrs)
2d151d39073aff Steffen Klassert 2021-07-18 1966 {
2d151d39073aff Steffen Klassert 2021-07-18 1967 struct net *net = sock_net(skb->sk);
2d151d39073aff Steffen Klassert 2021-07-18 1968 struct xfrm_userpolicy_default *up = nlmsg_data(nlh);
0d1cb044926e3d Pavel Skripkin 2021-07-27 @1969 u8 dirmask;
2d151d39073aff Steffen Klassert 2021-07-18 1970 u8 old_default = net->xfrm.policy_default;
2d151d39073aff Steffen Klassert 2021-07-18 1971
0d1cb044926e3d Pavel Skripkin 2021-07-27 1972 if (up->dirmask >= sizeof(up->action) * 8)
0d1cb044926e3d Pavel Skripkin 2021-07-27 1973 return -EINVAL;
0d1cb044926e3d Pavel Skripkin 2021-07-27 1974
0d1cb044926e3d Pavel Skripkin 2021-07-27 1975 dirmask = (1 << up->dirmask) & XFRM_POL_DEFAULT_MASK
0d1cb044926e3d Pavel Skripkin 2021-07-27 1976
2d151d39073aff Steffen Klassert 2021-07-18 @1977 net->xfrm.policy_default = (old_default & (0xff ^ dirmask))
2d151d39073aff Steffen Klassert 2021-07-18 1978 | (up->action << up->dirmask);
2d151d39073aff Steffen Klassert 2021-07-18 1979
2d151d39073aff Steffen Klassert 2021-07-18 1980 rt_genid_bump_all(net);
2d151d39073aff Steffen Klassert 2021-07-18 1981
2d151d39073aff Steffen Klassert 2021-07-18 1982 return 0;
2d151d39073aff Steffen Klassert 2021-07-18 1983 }
2d151d39073aff Steffen Klassert 2021-07-18 1984

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

Attachment: .config.gz
Description: application/gzip