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

!10440 net/sched: Fix UAF when resolving a clash

parents 5b28bbbd 10a53bc7
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1027,6 +1027,14 @@ static int tcf_ct_act(struct sk_buff *skb, const struct tc_action *a,
		 */
		if (nf_conntrack_confirm(skb) != NF_ACCEPT)
			goto drop;

		/* The ct may be dropped if a clash has been resolved,
		 * so it's necessary to retrieve it from skb again to
		 * prevent UAF.
		 */
		ct = nf_ct_get(skb, &ctinfo);
		if (!ct)
			skip_add = true;
	}

	if (!skip_add)