Skip to content

Commit 3ec35f3

Browse files
committed
Merge: net/sched: Fix UAF when resolving a clash
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/4942 JIRA: https://issues.redhat.com/browse/RHEL-51020 CVE: CVE-2024-41040 Tested: compile only Signed-off-by: Xin Long <lxin@redhat.com> Approved-by: Florian Westphal <fwestpha@redhat.com> Approved-by: Hangbin Liu <haliu@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Lucas Zampieri <lzampier@redhat.com>
2 parents 247d450 + 00be5b8 commit 3ec35f3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

net/sched/act_ct.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,14 @@ TC_INDIRECT_SCOPE int tcf_ct_act(struct sk_buff *skb, const struct tc_action *a,
10791079
*/
10801080
if (nf_conntrack_confirm(skb) != NF_ACCEPT)
10811081
goto drop;
1082+
1083+
/* The ct may be dropped if a clash has been resolved,
1084+
* so it's necessary to retrieve it from skb again to
1085+
* prevent UAF.
1086+
*/
1087+
ct = nf_ct_get(skb, &ctinfo);
1088+
if (!ct)
1089+
skip_add = true;
10821090
}
10831091

10841092
if (!skip_add)

0 commit comments

Comments
 (0)