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]
Message-Id: <1418979417-28867-1-git-send-email-wen.gang.wang@oracle.com>
Date:	Fri, 19 Dec 2014 16:56:57 +0800
From:	Wengang Wang <wen.gang.wang@...cle.com>
To:	netdev@...r.kernel.org
Cc:	wen.gang.wang@...cle.com
Subject: [PATCH] bonding: avoid re-entry of bond_release

If bond_release is run against an interface which is already detached from
it's master, then there is an error message shown like
	"<master name> cannot release <slave name>".

The call path is:
	bond_do_ioctl()
		bond_release()
			__bond_release_one()

Though it does not really harm, the message the message is misleading.
This patch tries to avoid the message.

Signed-off-by: Wengang Wang <wen.gang.wang@...cle.com>
---
 drivers/net/bonding/bond_main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 184c434..4a71bbd 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3256,7 +3256,10 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
 		break;
 	case BOND_RELEASE_OLD:
 	case SIOCBONDRELEASE:
-		res = bond_release(bond_dev, slave_dev);
+		if (slave_dev->flags & IFF_SLAVE)
+			res = bond_release(bond_dev, slave_dev);
+		else
+			res = 0;
 		break;
 	case BOND_SETHWADDR_OLD:
 	case SIOCBONDSETHWADDR:
-- 
1.8.3.1

--
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