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

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

parents 29373c47 1a2d17c8
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1032,6 +1032,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)