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

!9469 [sync] PR-8098: netfilter: nf_tables: release mutex after nft_gc_seq_end from abort path

parents ca957eb8 df0a30d7
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -8591,11 +8591,6 @@ static int __nf_tables_abort(struct net *net, enum nfnl_abort_action action)
		nf_tables_abort_release(trans);
	}

	if (action == NFNL_ABORT_AUTOLOAD)
		nf_tables_module_autoload(net);
	else
		nf_tables_module_autoload_cleanup(net);

	return 0;
}

@@ -8610,6 +8605,14 @@ static int nf_tables_abort(struct net *net, struct sk_buff *skb,
	struct nftables_pernet *nft_net = net_generic(net, nf_tables_net_id);
	int ret = __nf_tables_abort(net, action);

	/* module autoload needs to happen after GC sequence update because it
	 * temporarily releases and grabs mutex again.
	 */
	if (action == NFNL_ABORT_AUTOLOAD)
		nf_tables_module_autoload(net);
	else
		nf_tables_module_autoload_cleanup(net);

	mutex_unlock(&nft_net->commit_mutex);

	return ret;