Skip to content

Commit 200d171

Browse files
Moni ShouaJeff Garzik
authored andcommitted
IB/ipoib: Verify address handle validity on send
When the bonding device senses a carrier loss of its active slave it replaces that slave with a new one. In between the times when the carrier of an IPoIB device goes down and ipoib_neigh is destroyed, it is possible that the bonding driver will send a packet on a new slave that uses an old ipoib_neigh. This patch detects and prevents this from happenning. Signed-off-by: Moni Shoua <monis at voltaire.com> Signed-off-by: Or Gerlitz <ogerlitz at voltaire.com> Acked-by: Roland Dreier <rdreier@cisco.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
1 parent 732a217 commit 200d171

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/infiniband/ulp/ipoib/ipoib_main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,9 +692,10 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
692692
goto out;
693693
}
694694
} else if (neigh->ah) {
695-
if (unlikely(memcmp(&neigh->dgid.raw,
695+
if (unlikely((memcmp(&neigh->dgid.raw,
696696
skb->dst->neighbour->ha + 4,
697-
sizeof(union ib_gid)))) {
697+
sizeof(union ib_gid))) ||
698+
(neigh->dev != dev))) {
698699
spin_lock(&priv->lock);
699700
/*
700701
* It's safe to call ipoib_put_ah() inside

0 commit comments

Comments
 (0)