{"id":66586,"date":"2025-07-19T12:31:40","date_gmt":"2025-07-19T09:01:40","guid":{"rendered":"https:\/\/afaghhosting.net\/blog\/cve-2025-38350-linux-kernel-hfsc-netem-blackhole-use-after-free-vulnerability\/"},"modified":"2025-07-19T12:31:40","modified_gmt":"2025-07-19T09:01:40","slug":"cve-2025-38350-linux-kernel-hfsc-netem-blackhole-use-after-free-vulnerability","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/cve-2025-38350-linux-kernel-hfsc-netem-blackhole-use-after-free-vulnerability\/","title":{"rendered":"CVE-2025-38350 &#8211; Linux Kernel HFSC Netem Blackhole Use-After-Free Vulnerability"},"content":{"rendered":"<p><strong>CVE ID : <\/strong>CVE-2025-38350<br \/>\n<br \/>\n<strong>Published : <\/strong> July 19, 2025, 7:15 a.m. | 1\u00a0hour, 30\u00a0minutes ago<br \/>\n<br \/>\n<strong>Description : <\/strong>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>net\/sched: Always pass notifications when child class becomes empty<\/p>\n<p>Certain classful qdiscs may invoke their classes&#8217; dequeue handler on an<br \/>\nenqueue operation. This may unexpectedly empty the child qdisc and thus<br \/>\nmake an in-flight class passive via qlen_notify(). Most qdiscs do not<br \/>\nexpect such behaviour at this point in time and may re-activate the<br \/>\nclass eventually anyways which will lead to a use-after-free.<\/p>\n<p>The referenced fix commit attempted to fix this behavior for the HFSC<br \/>\ncase by moving the backlog accounting around, though this turned out to<br \/>\nbe incomplete since the parent&#8217;s parent may run into the issue too.<br \/>\nThe following reproducer demonstrates this use-after-free:<\/p>\n<p>    tc qdisc add dev lo root handle 1: drr<br \/>\n    tc filter add dev lo parent 1: basic classid 1:1<br \/>\n    tc class add dev lo parent 1: classid 1:1 drr<br \/>\n    tc qdisc add dev lo parent 1:1 handle 2: hfsc def 1<br \/>\n    tc class add dev lo parent 2: classid 2:1 hfsc rt m1 8 d 1 m2 0<br \/>\n    tc qdisc add dev lo parent 2:1 handle 3: netem<br \/>\n    tc qdisc add dev lo parent 3:1 handle 4: blackhole<\/p>\n<p>    echo 1 | socat -u STDIN UDP4-DATAGRAM:127.0.0.1:8888<br \/>\n    tc class delete dev lo classid 1:1<br \/>\n    echo 1 | socat -u STDIN UDP4-DATAGRAM:127.0.0.1:8888<\/p>\n<p>Since backlog accounting issues leading to a use-after-frees on stale<br \/>\nclass pointers is a recurring pattern at this point, this patch takes<br \/>\na different approach. Instead of trying to fix the accounting, the patch<br \/>\nensures that qdisc_tree_reduce_backlog always calls qlen_notify when<br \/>\nthe child qdisc is empty. This solves the problem because deletion of<br \/>\nqdiscs always involves a call to qdisc_reset() and \/ or<br \/>\nqdisc_purge_queue() which ultimately resets its qlen to 0 thus causing<br \/>\nthe following qdisc_tree_reduce_backlog() to report to the parent. Note<br \/>\nthat this may call qlen_notify on passive classes multiple times. This<br \/>\nis not a problem after the recent patch series that made all the<br \/>\nclassful qdiscs qlen_notify() handlers idempotent.<br \/>\n<br \/>\n<strong>Severity:<\/strong> 0.0 | NA<br \/>\n<br \/>\nVisit the link for more details, such as CVSS details, affected products, timeline, and more&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CVE ID : CVE-2025-38350 Published : July 19, 2025, 7:15 a.m. | 1\u00a0hour, 30\u00a0minutes ago Description : In the Linux kernel, the following vulnerability has been resolved: net\/sched: Always pass notifications when child class becomes empty Certain classful qdiscs may invoke their classes&#8217; dequeue handler on an enqueue operation. This may unexpectedly empty the child &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-66586","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/66586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=66586"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/66586\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=66586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=66586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=66586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}