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

!8098 netfilter: nf_tables: release mutex after nft_gc_seq_end from abort path

parents 602e9b9d 027b4085
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -8997,11 +8997,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;
}

@@ -9021,6 +9016,14 @@ static int nf_tables_abort(struct net *net, struct sk_buff *skb,
	ret = __nf_tables_abort(net, action);
	nft_gc_seq_end(nft_net, gc_seq);

	/* 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;