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: <1375732053-829-1-git-send-email-vfalico@redhat.com>
Date:	Mon,  5 Aug 2013 21:47:33 +0200
From:	Veaceslav Falico <vfalico@...hat.com>
To:	netdev@...r.kernel.org
Cc:	Veaceslav Falico <vfalico@...hat.com>,
	Jay Vosburgh <fubar@...ibm.com>,
	Andy Gospodarek <andy@...yhouse.net>
Subject: [PATCH net-next] bonding: fix send_peer_notif leekage on rtnl lock congestion

In bond_mii_monitor()/bond_activebackup_arp_mon(), we verify if we have any
notifications to be sent before trying to get the rtnl_trylock(), and if
we have - we set should_notify_peers and withdraw a notification. However,
if we fail the get the rtnl_trylock(), we don't send out any notification
and don't put the notification back to bond->send_peer_notif.

Fix it by putting back the notification to send_peer_notif in case of
rtnl_trylock() failure.

CC: Jay Vosburgh <fubar@...ibm.com>
CC: Andy Gospodarek <andy@...yhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@...hat.com>
---
 drivers/net/bonding/bond_main.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 5697043..fd92738 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2383,7 +2383,10 @@ void bond_mii_monitor(struct work_struct *work)
 		if (!rtnl_trylock()) {
 			read_lock(&bond->lock);
 			delay = 1;
-			should_notify_peers = false;
+			if (should_notify_peers) {
+				bond->send_peer_notif++;
+				should_notify_peers = false;
+			}
 			goto re_arm;
 		}
 
@@ -2999,7 +3002,10 @@ void bond_activebackup_arp_mon(struct work_struct *work)
 		if (!rtnl_trylock()) {
 			read_lock(&bond->lock);
 			delta_in_ticks = 1;
-			should_notify_peers = false;
+			if (should_notify_peers) {
+				bond->send_peer_notif++;
+				should_notify_peers = false;
+			}
 			goto re_arm;
 		}
 
-- 
1.8.1.4

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