{"id":"CVE-2025-38721","aliases":["CVE-2025-38721"],"related":[],"kind":"vulnerability","state":"published","title":"netfilter: ctnetlink: fix refcount leak on table dump","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nnetfilter: ctnetlink: fix refcount leak on table dump\n\nThere is a reference count leak in ctnetlink_dump_table():\n      if (res < 0) {\n                nf_conntrack_get(&ct->ct_general); // HERE\n                cb->args[1] = (unsigned long)ct;\n                ...\n\nWhile its very unlikely, its possible that ct == last.\nIf this happens, then the refcount of ct was already incremented.\nThis 2nd increment is never undone.\n\nThis prevents the conntrack object from being released, which in turn\nkeeps prevents cnet->count from dropping back to 0.\n\nThis will then block the netns dismantle (or conntrack rmmod) as\nnf_conntrack_cleanup_net_list() will wait forever.\n\nThis can be reproduced by running conntrack_resize.sh selftest in a loop.\nIt takes ~20 minutes for me on a preemptible kernel on average before\nI see a runaway kworker spinning in nf_conntrack_cleanup_net_list.\n\nOne fix would to change this to:\n        if (res < 0) {\n\t\tif (ct != last)\n\t                nf_conntrack_get(&ct->ct_general);\n\nBut this reference counting isn't needed in the first place.\nWe can just store a cookie value instead.\n\nA followup patch will do the same for ctnetlink_exp_dump_table,\nit looks to me as if this has the same problem and like\nctnetlink_dump_table, we only need a 'skip hint', not the actual\nobject so we can apply the same cookie strategy there as well.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nnetfilter: ctnetlink: fix refcount leak on table dump\n\nThere is a reference count leak in ctnetlink_dump_table():\n      if (res < 0) {\n                nf_conntrack_get(&ct->ct_general); // HERE\n                cb->args[1] = (unsigned long)ct;\n                ...\n\nWhile its very unlikely, its possible that ct == last.\nIf this happens, then the refcount of ct was already incremented.\nThis 2nd increment is never undone.\n\nThis prevents the conntrack object from being released, which in turn\nkeeps prevents cnet->count from dropping back to 0.\n\nThis will then block the netns dismantle (or conntrack rmmod) as\nnf_conntrack_cleanup_net_list() will wait forever.\n\nThis can be reproduced by running conntrack_resize.sh selftest in a loop.\nIt takes ~20 minutes for me on a preemptible kernel on average before\nI see a runaway kworker spinning in nf_conntrack_cleanup_net_list.\n\nOne fix would to change this to:\n        if (res < 0) {\n\t\tif (ct != last)\n\t                nf_conntrack_get(&ct->ct_general);\n\nBut this reference counting isn't needed in the first place.\nWe can just store a cookie value instead.\n\nA followup patch will do the same for ctnetlink_exp_dump_table,\nit looks to me as if this has the same problem and like\nctnetlink_dump_table, we only need a 'skip hint', not the actual\nobject so we can apply the same cookie strategy there as well.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nnetfilter: ctnetlink: corrección de fuga de contador de referencias en el volcado de tabla\n\nHay una fuga de contador de referencias en ctnetlink_dump_table():\n      if (res < 0) {\n                nf_conntrack_get(&ct->ct_general); // AQUÍ\n                cb->args[1] = (unsigned long)ct;\n                ...\n\nAunque es muy improbable, es posible que ct == last.\nSi esto ocurre, entonces el contador de referencias de ct ya se había incrementado.\nEste segundo incremento nunca se deshace.\n\nEsto evita que el objeto conntrack sea liberado, lo que a su vez\nimpide que cnet->count vuelva a 0.\n\nEsto entonces bloqueará el desmantelamiento de netns (o rmmod de conntrack) ya que\nnf_conntrack_cleanup_net_list() esperará indefinidamente.\n\nEsto puede reproducirse ejecutando la autoprueba conntrack_resize.sh en un bucle.\nMe lleva ~20 minutos en un kernel preemptivo en promedio antes de que\nvea un kworker descontrolado girando en nf_conntrack_cleanup_net_list.\n\nUna solución sería cambiar esto a:\n        if (res < 0) {\n\t\tif (ct != last)\n\t                nf_conntrack_get(&ct->ct_general);\n\nPero este conteo de referencias no es necesario en primer lugar.\nPodemos simplemente almacenar un valor de cookie en su lugar.\n\nUn parche de seguimiento hará lo mismo para ctnetlink_exp_dump_table,\nme parece que esto tiene el mismo problema y al igual que\nctnetlink_dump_table, solo necesitamos una 'pista de salto', no el objeto real,\nasí que podemos aplicar la misma estrategia de cookie allí también.","source":"nvd"}],"published":"2025-09-04T15:33:14.891Z","modified":"2026-11-10T13:17:48.013Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"d205dc40798d97d63ad348bfaf7394f445d152d4","fixed":"586892e341fbf698e7cbaca293e1353957db725a","status":"affected"},{"type":"git","introduced":"d205dc40798d97d63ad348bfaf7394f445d152d4","fixed":"962518c6ca9f9a13df099cafa429f72f68ad61f0","status":"affected"},{"type":"git","introduced":"d205dc40798d97d63ad348bfaf7394f445d152d4","fixed":"19b909a4b1452fb97e477d2f08b97f8d04095619","status":"affected"},{"type":"git","introduced":"d205dc40798d97d63ad348bfaf7394f445d152d4","fixed":"41462f4cfc583513833f87f9ee55d12da651a7e3","status":"affected"},{"type":"git","introduced":"d205dc40798d97d63ad348bfaf7394f445d152d4","fixed":"30cf811058552b8cd0e98dff677ef3f89d6d34ce","status":"affected"},{"type":"git","introduced":"d205dc40798d97d63ad348bfaf7394f445d152d4","fixed":"a2cb4df7872de069f809de2f076ec8e54d649fe3","status":"affected"},{"type":"git","introduced":"d205dc40798d97d63ad348bfaf7394f445d152d4","fixed":"e14f72aa66c029db106921d621edcedef68e065b","status":"affected"},{"type":"git","introduced":"d205dc40798d97d63ad348bfaf7394f445d152d4","fixed":"a62d6aa3f31f216b637a4c71b7a8bfc7c57f049b","status":"affected"},{"type":"git","introduced":"d205dc40798d97d63ad348bfaf7394f445d152d4","fixed":"de788b2e6227462b6dcd0e07474e72c089008f74","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"2.6.18","status":"affected"},{"type":"semver","introduced":"0","fixed":"2.6.18","status":"unaffected"},{"type":"semver","introduced":"5.4.297","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.241","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.190","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.149","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.103","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.43","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.15.11","lastAffected":"6.15.*","status":"unaffected"},{"type":"semver","introduced":"6.16.2","lastAffected":"6.16.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.17","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"2.6.19","fixed":"5.4.297"},{"status":"affected","introduced":"5.5","fixed":"5.10.241"},{"status":"affected","introduced":"5.11","fixed":"5.15.190"},{"status":"affected","introduced":"5.16","fixed":"6.1.149"},{"status":"affected","introduced":"6.2","fixed":"6.6.103"},{"status":"affected","introduced":"6.7","fixed":"6.12.43"},{"status":"affected","introduced":"6.13","fixed":"6.15.11"},{"status":"affected","introduced":"6.16","fixed":"6.16.2"},{"status":"affected","version":"2.6.18"},{"status":"affected","version":"2.6.18"},{"status":"affected","version":"2.6.18"},{"status":"affected","version":"2.6.18"},{"status":"affected","version":"6.17"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"11.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/586892e341fbf698e7cbaca293e1353957db725a","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/962518c6ca9f9a13df099cafa429f72f68ad61f0","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/19b909a4b1452fb97e477d2f08b97f8d04095619","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/41462f4cfc583513833f87f9ee55d12da651a7e3","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/30cf811058552b8cd0e98dff677ef3f89d6d34ce","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/a2cb4df7872de069f809de2f076ec8e54d649fe3","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/e14f72aa66c029db106921d621edcedef68e065b","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/a62d6aa3f31f216b637a4c71b7a8bfc7c57f049b","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/de788b2e6227462b6dcd0e07474e72c089008f74","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html","tags":["mailing-list","third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html","tags":["mailing-list","third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-082556.html","tags":[],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-032379.html","tags":[],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-019113.html","tags":[],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-457936.html","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-05T21:07:57.026Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-38721","url":"https://www.cve.org/CVERecord?id=CVE-2025-38721","licence":"CVE Terms of Use","modified":"2026-11-10T12:36:35.362Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-38721","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-38721","licence":"Public domain","modified":"2026-11-10T13:17:48.013Z"}],"updatedAt":"2026-11-25T22:59:04.159Z","epss":{"score":0.00242,"percentile":0.16414,"date":"2026-12-01T12:00:22.000Z"}}