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-next>] [day] [month] [year] [list]
Date:	Wed, 25 Jul 2012 16:47:10 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	amwang@...hat.com
Cc:	netdev@...r.kernel.org
Subject: re: bonding: sync netpoll code with bridge

Hello Amerigo Wang,

The patch 8a8efa22f51b: "bonding: sync netpoll code with bridge" from 
Feb 17, 2011, leads to the following warning:
drivers/net/bonding/bond_main.c:1849 bond_enslave()
	 error: scheduling with locks held: 'read_lock:&bond->lock'

drivers/net/bonding/bond_main.c
  1301          read_lock(&bond->lock);
  1302          bond_for_each_slave(bond, slave, i) {
  1303                  err = slave_enable_netpoll(slave);
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
This can lead to a scheduling while atomic bug because it does a
GFP_KERNEL allocation and calls __netpoll_setup() which sleeps.

  1304                  if (err) {
  1305                          __bond_netpoll_cleanup(bond);
  1306                          break;
  1307                  }
  1308          }
  1309          read_unlock(&bond->lock);

Also later in the file:

  1848          if (slave_dev->npinfo) {
  1849                  if (slave_enable_netpoll(new_slave)) {
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
We are holding read_lock(&bond->lock);

  1850                          read_unlock(&bond->lock);
  1851                          pr_info("Error, %s: master_dev is using netpoll, "
  1852                                   "but new slave device does not support netpoll.\n",
  1853                                   bond_dev->name);
  1854                          res = -EBUSY;
  1855                          goto err_detach;
  1856                  }

The easy way to trigger this warning is to test with
CONFIG_DEBUG_ATOMIC_SLEEP=y.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ