Commit 476d7d69 authored by Julian Wiedmann's avatar Julian Wiedmann Committed by Greg Kroah-Hartman

s390/qeth: lock IP table while applying takeover changes


[ Upstream commit 8a03a369 ]

Modifying the flags of an IP addr object needs to be protected against
eg. concurrent removal of the same object from the IP table.

Fixes: 5f78e29c ("qeth: optimize IP handling in rx_mode callback")
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 475018c7
......@@ -397,6 +397,7 @@ static ssize_t qeth_l3_dev_ipato_enable_store(struct device *dev,
goto out;
card->ipato.enabled = enable;
spin_lock_bh(&card->ip_lock);
hash_for_each(card->ip_htable, i, addr, hnode) {
if (addr->type != QETH_IP_TYPE_NORMAL)
continue;
......@@ -405,6 +406,7 @@ static ssize_t qeth_l3_dev_ipato_enable_store(struct device *dev,
else if (qeth_l3_is_addr_covered_by_ipato(card, addr))
addr->set_flags |= QETH_IPA_SETIP_TAKEOVER_FLAG;
}
spin_unlock_bh(&card->ip_lock);
out:
mutex_unlock(&card->conf_mutex);
return rc ? rc : count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment