Unverified Commit ce086fc7 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!4069 tipc: fix a potential deadlock on &tx->lock

parents c3036512 26672a99
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1445,14 +1445,14 @@ static int tipc_crypto_key_revoke(struct net *net, u8 tx_key)
	struct tipc_crypto *tx = tipc_net(net)->crypto_tx;
	struct tipc_key key;

	spin_lock(&tx->lock);
	spin_lock_bh(&tx->lock);
	key = tx->key;
	WARN_ON(!key.active || tx_key != key.active);

	/* Free the active key */
	tipc_crypto_key_set_state(tx, key.passive, 0, key.pending);
	tipc_crypto_key_detach(tx->aead[key.active], &tx->lock);
	spin_unlock(&tx->lock);
	spin_unlock_bh(&tx->lock);

	pr_warn("%s: key is revoked\n", tx->name);
	return -EKEYREVOKED;