From 98f739b627c5daa488e70dae1c8097aa78ca80ae Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 7 Aug 2024 15:15:13 +0200 Subject: Adding upstream version 6.9.10. Signed-off-by: Daniel Baumann --- net/sched/act_ct.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'net/sched/act_ct.c') diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c index 2a96d9c1db..6fa3cca87d 100644 --- a/net/sched/act_ct.c +++ b/net/sched/act_ct.c @@ -1077,6 +1077,14 @@ do_nat: */ 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) -- cgit v1.2.3