{"id":"CVE-2026-97959","summary":"net/sched: cls_route: free emptied bucket on filter move","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet/sched: cls_route: free emptied bucket on filter move\n\nroute4_change can move an existing filter to a different top-level\nbucket: route4_set_parms recomputes the handle from TCA_ROUTE4_TO/\nFROM/IIF, and the handle-mismatch check is gated on the 'new' flag, so\nfor an existing filter the new handle may differ from the old one and\nland in a different bucket. When this happens, the filter is unlinked\nfrom the old bucket, but the bucket itself is never freed once it goes\nempty. The stale empty bucket remains in head-\u003etable[], causing\nroute4_delete to report *last=false even after the last live filter is\ngone. That pins the empty tcf_proto and causes a leak.\n\nFix this by refcounting the filters linked to a bucket and freeing the\nbucket when the count drops to zero. The existing scan in route4_delete\ngoes away with it.\n\nThe count is updated at all sites that link or unlink a filter during add,\nchange and delete, and the bucket is dropped from head-\u003etable[] as soon as\nit reaches zero.\n\nConditions to recreate the bug:\n  CONFIG_NET_CLS_ROUTE4=y, CONFIG_NET_SCH_INGRESS=y, CONFIG_NET_CLS_ACT=y.\n\n  tc qdisc replace dev lo clsact\n  tc filter add dev lo ingress protocol ip pref 100 route from 1 to 1\n  tc filter change dev lo ingress protocol ip pref 100 handle 0x10001 \\\n    route from 1 to 2\n  tc filter del dev lo ingress protocol ip pref 100 handle 0x10002 \\\n    route from 1 to 2\n  tc filter show dev lo ingress | grep -c 'pref 100 route chain 0 '","modified":"2026-09-26T03:48:27.940412686Z","published":"2026-09-25T10:23:04.348Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/97xxx/CVE-2026-97959.json"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/1853f30cf5c84971f99788a76207c6f745380896"},{"type":"WEB","url":"https://git.kernel.org/stable/c/2e2f130951d34871b0643bf700164d97cff4b427"},{"type":"WEB","url":"https://git.kernel.org/stable/c/81dd117c04422c6d0c7974aba9fa6a0ba370959b"},{"type":"WEB","url":"https://git.kernel.org/stable/c/f8495d67434e1cb7e511297687ca55fdb28e4c20"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/97xxx/CVE-2026-97959.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-97959"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"1e052be69d045c8d0f82ff1116fd3e5a79661745"},{"fixed":"2e2f130951d34871b0643bf700164d97cff4b427"},{"fixed":"f8495d67434e1cb7e511297687ca55fdb28e4c20"},{"fixed":"81dd117c04422c6d0c7974aba9fa6a0ba370959b"},{"fixed":"1853f30cf5c84971f99788a76207c6f745380896"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-97959.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.1.0"},{"fixed":"6.12.111"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.53"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.2.7"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-97959.json"}}],"schema_version":"1.9.0"}