Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Pavel Skripkin <paskripkin@gmail.com>,
	syzbot <syzbot+9cd5837a045bbee5b810@syzkaller.appspotmail.com>
Cc: kbuild-all@lists.01.org, davem@davemloft.net,
	herbert@gondor.apana.org.au, kuba@kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	steffen.klassert@secunet.com, syzkaller-bugs@googlegroups.com
Subject: Re: [PATCH] net: xfrm: fix shift-out-of-bounce
Date: Wed, 28 Jul 2021 01:46:29 +0800	[thread overview]
Message-ID: <202107280109.hxG9y82S-lkp@intel.com> (raw)
In-Reply-To: <20210727174318.53806d27@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4205 bytes --]

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@intel.com>

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@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 55006 bytes --]

  parent reply	other threads:[~2021-07-27 17:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27 12:47 [syzbot] UBSAN: shift-out-of-bounds in xfrm_set_default syzbot
2021-07-27 14:43 ` Pavel Skripkin
2021-07-27 17:25   ` [PATCH] net: xfrm: fix shift-out-of-bounce kernel test robot
2021-07-27 17:30     ` Pavel Skripkin
2021-07-28  0:13       ` [syzbot] UBSAN: shift-out-of-bounds in xfrm_set_default syzbot
2021-07-27 17:46   ` kernel test robot [this message]
2021-07-27 23:28   ` syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202107280109.hxG9y82S-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=kbuild-all@lists.01.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paskripkin@gmail.com \
    --cc=steffen.klassert@secunet.com \
    --cc=syzbot+9cd5837a045bbee5b810@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --subject='Re: [PATCH] net: xfrm: fix shift-out-of-bounce' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).