7.5high
net/sched: act_ct: fix sk_buff leak when the header checks reject a packet
- Severity
- 7.5high CVSS:3.1 by Linux
- Exploit likelihood
- 0.49% (higher than 43% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: net/sched: act_ct: fix sk_buff leak when the header checks reject a packet tcf_ct_handle_fragments() runs its header sanity checks before handing anything to the defragmentation engine: if (family == NFPROTO_IPV4) err = tcf_ct_ipv4_is_fragment(skb, &frag); else err = tcf_ct_ipv6_is_fragment(skb, &frag); if (err || !frag) return err; tcf_ct_ipv4_is_fragment() returns -EINVAL or -ENOMEM; tcf_ct_ipv6_is_fragment() adds -EPROTO when ipv6_find_hdr() fails. None of them frees or queues the skb, so on that path the caller still owns it. tcf_ct_act() however funnels every non-zero return into the ownership-transfer exit: err = tcf_ct_handle_fragments(net, skb, family, p->zone, &defrag); if (err) goto out_frag; ... out_frag: if (err != -EINPROGRESS) tcf_action_inc_drop_qstats(&c->common); return TC_ACT_CONSUMED; TC_ACT_CONSUMED means the action took ownership of the skb, so no caller frees it - sch_handle_ingress(), sch_handle_egress() and tcf_qevent_handle() all deliberately skip the free for that verdict. The skb is therefore orphaned: one sk_buff plus its data buffer is leaked per malformed packet, unbounded. Note the drop counter is already incremented for these errors, so the statistics claim a drop that never happens. Three different ownership states reach out_frag: today - the skb may be queued by the defrag engine (-EINPROGRESS), already freed by nf_ct_handle_fragments(), or still owned by us. Tell the caller which of those it is, and free the packet ourselves in the last case, which restores the TC_ACT_SHOT behaviour that predated the Fixes: commit. Reproduced on v7.2-rc6 with a 54-byte frame carrying a 40-byte IPv6 header with nexthdr = 0 (hop-by-hop) and nothing after it, on a clsact ingress chain with "action ct". kmemleak reports one leaked 232-byte skbuff_head_cache object plus its 704-byte data buffer per packet; with this patch it reports none.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from 172ba7d46c202e679f3ccb10264c67416aaeb1c4 before b5dbecc2016e1692fd1c2532af9c41ba729cb747, from 0b5b831122fc3789fff75be433ba3e4dd7b779d4 before 23e97d594ddd0153020c506d5041048fbde1beb4, from 73f7da5fd124f2cda9161e2e46114915e6e82e97 before 737873a59905a54ca0d2d127ef882f3f88bf4379, from 3f14b377d01d8357eba032b4cabc8c1149b458b6 before 47d99828591d0fe8be4b9c8992ff3b8e47968db9, from 3f14b377d01d8357eba032b4cabc8c1149b458b6 before b47bb899e04b5407c5a63fe88d4b6676586a6e84, from 3f14b377d01d8357eba032b4cabc8c1149b458b6 before 439d3e404f9d5e515911cc8132cde198b337c19e, from 3f14b377d01d8357eba032b4cabc8c1149b458b6 before 8a7ed561671aa6a911a2de99e59ef670a4d0b1df, f5346df0591d10bc948761ca854b1fae6d2ef441 and 5 more Not affected: before 6.8, from 5.15.217 up to 5.15.*, from 6.1.184 up to 6.1.*, from 6.6.152 up to 6.6.*, from 6.12.104 up to 6.12.*, from 6.18.45 up to 6.18.* | CVE List |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: net/sched: act_ct: fix sk_buff leak when the header checks reject a packet tcf_ct_handle_fragments() runs its header sanity checks before handing anything to the defragmentation engine: if (family == NFPROTO_IPV4) err = tcf_ct_ipv4_is_fragment(skb, &frag); else err = tcf_ct_ipv6_is_fragment(skb, &frag); if (err || !frag) return err; tcf_ct_ipv4_is_fragment() returns -EINVAL or -ENOMEM; tcf_ct_ipv6_is_fragment() adds -EPROTO when ipv6_find_hdr() fails. None of them frees or queues the skb, so on that path the caller still owns it. tcf_ct_act() however funnels every non-zero return into the ownership-transfer exit: err = tcf_ct_handle_fragments(net, skb, family, p->zone, &defrag); if (err) goto out_frag; ... out_frag: if (err != -EINPROGRESS) tcf_action_inc_drop_qstats(&c->common); return TC_ACT_CONSUMED; TC_ACT_CONSUMED means the action took ownership of the skb, so no caller frees it - sch_handle_ingress(), sch_handle_egress() and tcf_qevent_handle() all deliberately skip the free for that verdict. The skb is therefore orphaned: one sk_buff plus its data buffer is leaked per malformed packet, unbounded. Note the drop counter is already incremented for these errors, so the statistics claim a drop that never happens. Three different ownership states reach out_frag: today - the skb may be queued by the defrag engine (-EINPROGRESS), already freed by nf_ct_handle_fragments(), or still owned by us. Tell the caller which of those it is, and free the packet ourselves in the last case, which restores the TC_ACT_SHOT behaviour that predated the Fixes: commit. Reproduced on v7.2-rc6 with a 54-byte frame carrying a 40-byte IPv6 header with nexthdr = 0 (hop-by-hop) and nothing after it, on a clsact ingress chain with "action ct". kmemleak reports one leaked 232-byte skbuff_head_cache object plus its 704-byte data buffer per packet; with this patch it reports none.
NVD (es)
En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: net/sched: act_ct: corrige la fuga de sk_buff cuando las comprobaciones de cabecera rechazan un paquete tcf_ct_handle_fragments() ejecuta sus comprobaciones de integridad de cabecera antes de entregar cualquier cosa al motor de desfragmentación: if (family == NFPROTO_IPV4) err = tcf_ct_ipv4_is_fragment(skb, &frag); else err = tcf_ct_ipv6_is_fragment(skb, &frag); if (err || !frag) return err; tcf_ct_ipv4_is_fragment() devuelve -EINVAL o -ENOMEM; tcf_ct_ipv6_is_fragment() añade -EPROTO cuando ipv6_find_hdr() falla. Ninguno de ellos libera o encola el skb, por lo que en esa ruta el llamador todavía lo posee. tcf_ct_act() sin embargo canaliza cada retorno no nulo hacia la salida de transferencia de propiedad: err = tcf_ct_handle_fragments(net, skb, family, p -> zone, &defrag); if (err) goto out_frag; ... out_frag: if (err != -EINPROGRESS) tcf_action_inc_drop_qstats(&c -> common); return TC_ACT_CONSUMED; TC_ACT_CONSUMED significa que la acción tomó posesión del skb, por lo que ningún llamador lo libera - sch_handle_ingress(), sch_handle_egress() y tcf_qevent_handle() omiten deliberadamente la liberación para ese veredicto. El skb queda, por lo tanto, huérfano: un sk_buff más su búfer de datos se fuga por cada paquete malformado, sin límites. Nótese que el contador de caídas ya se incrementa para estos errores, por lo que las estadísticas afirman una caída que nunca ocurre. Tres estados de propiedad diferentes alcanzan out_frag: hoy - el skb puede ser encolado por el motor de desfragmentación (-EINPROGRESS), ya liberado por nf_ct_handle_fragments(), o todavía en nuestra posesión. Informar al llamador cuál de ellos es, y liberar el paquete nosotros mismos en el último caso, lo que restaura el comportamiento TC_ACT_SHOT que precedió al commit de Fixes:. Reproducido en v7.2-rc6 con una trama de 54 bytes que transporta una cabecera IPv6 de 40 bytes con nexthdr = 0 (salto a salto) y nada después de ella, en una cadena de entrada clsact con 'action ct'. kmemleak informa de un objeto skbuff_head_cache de 232 bytes fugado más su búfer de datos de 704 bytes por paquete; con este parche no informa de ninguno.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-74621 changed 2026-10-16 | CVE Terms of Use |
| NVD | CVE-2026-74621 changed 2026-10-16 | Public domain |