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>] [day] [month] [year] [list]
Date:   Wed, 2 Sep 2020 21:20:24 +0800
From:   kernel test robot <lkp@...el.com>
To:     Amit Daniel Kachhap <amit.kachhap@....com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Will Deacon <will@...nel.org>
Subject: net/mptcp/pm_netlink.c:256:9: sparse: sparse: context imbalance in
 'mptcp_pm_nl_add_addr_received' - unexpected unlock

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9c7d619be5a002ea29c172df5e3c1227c22cbb41
commit: 203b1152d18c04823f73b843eb3b0ad646e4dbb2 arm64/crash_core: Export KERNELPACMASK in vmcoreinfo
date:   4 months ago
config: arm64-randconfig-s031-20200902 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.2-191-g10164920-dirty
        git checkout 203b1152d18c04823f73b843eb3b0ad646e4dbb2
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arm64 

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


sparse warnings: (new ones prefixed by >>)

   net/mptcp/pm_netlink.c:209:25: sparse: sparse: context imbalance in 'mptcp_pm_create_subflow_or_signal_addr' - unexpected unlock
>> net/mptcp/pm_netlink.c:256:9: sparse: sparse: context imbalance in 'mptcp_pm_nl_add_addr_received' - unexpected unlock

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=203b1152d18c04823f73b843eb3b0ad646e4dbb2
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 203b1152d18c04823f73b843eb3b0ad646e4dbb2
vim +/mptcp_pm_nl_add_addr_received +256 net/mptcp/pm_netlink.c

01cacb00b35cb6 Paolo Abeni 2020-03-27  234  
01cacb00b35cb6 Paolo Abeni 2020-03-27  235  void mptcp_pm_nl_add_addr_received(struct mptcp_sock *msk)
01cacb00b35cb6 Paolo Abeni 2020-03-27  236  {
01cacb00b35cb6 Paolo Abeni 2020-03-27  237  	struct sock *sk = (struct sock *)msk;
01cacb00b35cb6 Paolo Abeni 2020-03-27  238  	struct mptcp_addr_info remote;
01cacb00b35cb6 Paolo Abeni 2020-03-27  239  	struct mptcp_addr_info local;
01cacb00b35cb6 Paolo Abeni 2020-03-27  240  
01cacb00b35cb6 Paolo Abeni 2020-03-27  241  	pr_debug("accepted %d:%d remote family %d",
01cacb00b35cb6 Paolo Abeni 2020-03-27  242  		 msk->pm.add_addr_accepted, msk->pm.add_addr_accept_max,
01cacb00b35cb6 Paolo Abeni 2020-03-27  243  		 msk->pm.remote.family);
01cacb00b35cb6 Paolo Abeni 2020-03-27  244  	msk->pm.add_addr_accepted++;
01cacb00b35cb6 Paolo Abeni 2020-03-27  245  	msk->pm.subflows++;
01cacb00b35cb6 Paolo Abeni 2020-03-27  246  	if (msk->pm.add_addr_accepted >= msk->pm.add_addr_accept_max ||
01cacb00b35cb6 Paolo Abeni 2020-03-27  247  	    msk->pm.subflows >= msk->pm.subflows_max)
01cacb00b35cb6 Paolo Abeni 2020-03-27  248  		WRITE_ONCE(msk->pm.accept_addr, false);
01cacb00b35cb6 Paolo Abeni 2020-03-27  249  
01cacb00b35cb6 Paolo Abeni 2020-03-27  250  	/* connect to the specified remote address, using whatever
01cacb00b35cb6 Paolo Abeni 2020-03-27  251  	 * local address the routing configuration will pick.
01cacb00b35cb6 Paolo Abeni 2020-03-27  252  	 */
01cacb00b35cb6 Paolo Abeni 2020-03-27  253  	remote = msk->pm.remote;
01cacb00b35cb6 Paolo Abeni 2020-03-27  254  	if (!remote.port)
01cacb00b35cb6 Paolo Abeni 2020-03-27  255  		remote.port = sk->sk_dport;
01cacb00b35cb6 Paolo Abeni 2020-03-27 @256  	memset(&local, 0, sizeof(local));
01cacb00b35cb6 Paolo Abeni 2020-03-27  257  	local.family = remote.family;
01cacb00b35cb6 Paolo Abeni 2020-03-27  258  
01cacb00b35cb6 Paolo Abeni 2020-03-27  259  	spin_unlock_bh(&msk->pm.lock);
01cacb00b35cb6 Paolo Abeni 2020-03-27  260  	__mptcp_subflow_connect((struct sock *)msk, 0, &local, &remote);
01cacb00b35cb6 Paolo Abeni 2020-03-27  261  	spin_lock_bh(&msk->pm.lock);
01cacb00b35cb6 Paolo Abeni 2020-03-27  262  }
01cacb00b35cb6 Paolo Abeni 2020-03-27  263  

:::::: The code at line 256 was first introduced by commit
:::::: 01cacb00b35cb62b139f07d5f84bcf0eeda8eff6 mptcp: add netlink-based PM

:::::: TO: Paolo Abeni <pabeni@...hat.com>
:::::: CC: David S. Miller <davem@...emloft.net>

---
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" (33530 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ