net/sched: Return NULL when htb_lookup_leaf encounters an empty rbtree
In the Linux kernel, the following vulnerability has been resolved: net/sched: Return NULL when htb_lookup_leaf encounters an empty rbtree htb_lookup_leaf has a BUG_ON that can trigger with the following: tc qdisc del dev lo root tc qdisc add dev lo root handle 1: htb default 1 tc class add dev lo parent 1: classid 1:1 htb rate 64bit tc qdisc add dev lo parent 1:1 handle 2: netem tc qdisc add dev lo parent 2:1 handle 3: blackhole ping -I lo -c1 -W0.001 127.0.0.1 The root cause is the following: 1. htb_dequeue calls htb_dequeue_tree which calls the dequeue handler on the selected leaf qdisc 2. netem_dequeue calls enqueue on the child qdisc 3. blackhole_enqueue drops the packet and returns a value that is not just NET_XMIT_SUCCESS 4. Because of this, netem_dequeue calls qdisc_tree_reduce_backlog, and since qlen is now 0, it calls htb_qlen_notify -> htb_deactivate -> htb_deactiviate_prios -> htb_remove_class_from_row -> htb_safe_rb_erase 5. As this is the only class in the selected hprio rbtree, __rb_change_child in __rb_erase_augmented sets the rb_root pointer to NULL 6. Because blackhole_dequeue returns NULL, netem_dequeue returns NULL, which causes htb_dequeue_tree to call htb_lookup_leaf with the same hprio rbtree, and fail the BUG_ON The function graph for this scenario is shown here: 0) | htb_enqueue() { 0) + 13.635 us | netem_enqueue(); 0) 4.719 us | htb_activate_prios(); 0) # 2249.199 us | } 0) | htb_dequeue() { 0) 2.355 us | htb_lookup_leaf(); 0) | netem_dequeue() { 0)
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 5.10.241, 5.15.190, 5.4.297, 6.1.147, 6.12.40, 6.15.8, 6.6.100
- CVEs
- CVE-2025-38468
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 6 Nov 2026, 18:09 UTC · Revision 1
Source evidence
net/sched: Return NULL when htb_lookup_leaf encounters an empty rbtree
core-osv · Original sourcePublished 28 Jul 2025, 11:12 UTC
In the Linux kernel, the following vulnerability has been resolved: net/sched: Return NULL when htb_lookup_leaf encounters an empty rbtree htb_lookup_leaf has a BUG_ON that can trigger with the following: tc qdisc del dev lo root tc qdisc add dev lo root handle 1: htb default 1 tc class add dev lo parent 1: classid 1:1 htb rate 64bit tc qdisc add dev lo parent 1:1 handle 2: netem tc qdisc add dev lo parent 2:1 handle 3: blackhole ping -I lo -c1 -W0.001 127.0.0.1 The root cause is the following: 1. htb_dequeue calls htb_dequeue_tree which calls the dequeue handler on the selected leaf qdisc 2. netem_dequeue calls enqueue on the child qdisc 3. blackhole_enqueue drops the packet and returns a value that is not just NET_XMIT_SUCCESS 4. Because of this, netem_dequeue calls qdisc_tree_reduce_backlog, and since qlen is now 0, it calls htb_qlen_notify -> htb_deactivate -> htb_deactiviate_prios -> htb_remove_class_from_row -> htb_safe_rb_erase 5. As this is the only class in the selected hprio rbtree, __rb_change_child in __rb_erase_augmented sets the rb_root pointer to NULL 6. Because blackhole_dequeue returns NULL, netem_dequeue returns NULL, which causes htb_dequeue_tree to call htb_lookup_leaf with the same hprio rbtree, and fail the BUG_ON The function graph for this scenario is shown here: 0) | htb_enqueue() { 0) + 13.635 us | netem_enqueue(); 0) 4.719 us | htb_activate_prios(); 0) # 2249.199 us | } 0) | htb_dequeue() { 0) 2.355 us | htb_lookup_leaf(); 0) | netem_dequeue() { 0)
osv:CVE-2025-38468
Kernel
Fixed versions: 5.4.297, 5.10.241, 5.15.190, 6.1.147, 6.6.100, 6.12.40, 6.15.8
Complete source record
{
"id": "d48b09a31adb264eb67f984852da3db8bef74603cf48b095ec2522d3ca06a492",
"url": "https://osv.dev/vulnerability/CVE-2025-38468",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "net/sched: Return NULL when htb_lookup_leaf encounters an empty rbtree",
"summary": "In the Linux kernel, the following vulnerability has been resolved: net/sched: Return NULL when htb_lookup_leaf encounters an empty rbtree htb_lookup_leaf has a BUG_ON that can trigger with the following: tc qdisc del dev lo root tc qdisc add dev lo root handle 1: htb default 1 tc class add dev lo parent 1: classid 1:1 htb rate 64bit tc qdisc add dev lo parent 1:1 handle 2: netem tc qdisc add dev lo parent 2:1 handle 3: blackhole ping -I lo -c1 -W0.001 127.0.0.1 The root cause is the following: 1. htb_dequeue calls htb_dequeue_tree which calls the dequeue handler on the selected leaf qdisc 2. netem_dequeue calls enqueue on the child qdisc 3. blackhole_enqueue drops the packet and returns a value that is not just NET_XMIT_SUCCESS 4. Because of this, netem_dequeue calls qdisc_tree_reduce_backlog, and since qlen is now 0, it calls htb_qlen_notify -> htb_deactivate -> htb_deactiviate_prios -> htb_remove_class_from_row -> htb_safe_rb_erase 5. As this is the only class in the selected hprio rbtree, __rb_change_child in __rb_erase_augmented sets the rb_root pointer to NULL 6. Because blackhole_dequeue returns NULL, netem_dequeue returns NULL, which causes htb_dequeue_tree to call htb_lookup_leaf with the same hprio rbtree, and fail the BUG_ON The function graph for this scenario is shown here: 0) | htb_enqueue() { 0) + 13.635 us | netem_enqueue(); 0) 4.719 us | htb_activate_prios(); 0) # 2249.199 us | } 0) | htb_dequeue() { 0) 2.355 us | htb_lookup_leaf(); 0) | netem_dequeue() { 0) ",
"evidence": "osv:CVE-2025-38468",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "5.4.297",
"evidence": "/affected/1/ranges"
},
{
"value": "5.10.241",
"evidence": "/affected/1/ranges"
},
{
"value": "5.15.190",
"evidence": "/affected/1/ranges"
},
{
"value": "6.1.147",
"evidence": "/affected/1/ranges"
},
{
"value": "6.6.100",
"evidence": "/affected/1/ranges"
},
{
"value": "6.12.40",
"evidence": "/affected/1/ranges"
},
{
"value": "6.15.8",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "unknown",
"structured": {
"id": "CVE-2025-38468",
"aliases": [
"CVE-2025-38468"
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "512bb43eb5422ee69a1be05ea0d89dc074fac9a2"
},
{
"fixed": "fed3570e548a6c9f95c5f4c9e1a7afc1679fd90d"
},
{
"fixed": "5c0506cd1b1a3b145bda2612bbf7fe78d186c355"
},
{
"fixed": "850226aef8d28a00cf966ef26d2f8f2bff344535"
},
{
"fixed": "890a5d423ef0a7bd13447ceaffad21189f557301"
},
{
"fixed": "7ff2d83ecf2619060f30ecf9fad4f2a700fca344"
},
{
"fixed": "e5c480dc62a3025b8428d4818e722da30ad6804f"
},
{
"fixed": "3691f84269a23f7edd263e9b6edbc27b7ae332f4"
},
{
"fixed": "0e1d5d9b5c5966e2e42e298670808590db5ed628"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-38468.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "2.6.29"
},
{
"fixed": "5.4.297"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.5.0"
},
{
"fixed": "5.10.241"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.11.0"
},
{
"fixed": "5.15.190"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.16.0"
},
{
"fixed": "6.1.147"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.2.0"
},
{
"fixed": "6.6.100"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.7.0"
},
{
"fixed": "6.12.40"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.13.0"
},
{
"fixed": "6.15.8"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-38468.json"
}
}
],
"modified": "2026-10-28T02:30:47.800861987Z",
"provider": "osv",
"references": [
"https://cert-portal.siemens.com/productcert/html/ssa-082556.html",
"https://git.kernel.org/stable/c/0e1d5d9b5c5966e2e42e298670808590db5ed628",
"https://git.kernel.org/stable/c/3691f84269a23f7edd263e9b6edbc27b7ae332f4",
"https://git.kernel.org/stable/c/5c0506cd1b1a3b145bda2612bbf7fe78d186c355",
"https://git.kernel.org/stable/c/7ff2d83ecf2619060f30ecf9fad4f2a700fca344",
"https://git.kernel.org/stable/c/850226aef8d28a00cf966ef26d2f8f2bff344535",
"https://git.kernel.org/stable/c/890a5d423ef0a7bd13447ceaffad21189f557301",
"https://git.kernel.org/stable/c/e5c480dc62a3025b8428d4818e722da30ad6804f",
"https://git.kernel.org/stable/c/fed3570e548a6c9f95c5f4c9e1a7afc1679fd90d",
"https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html",
"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38468.json",
"https://nvd.nist.gov/vuln/detail/CVE-2025-38468",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38468.json"
}
},
"related_cves": [
{
"value": "CVE-2025-38468",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": null
},
"source_id": "core-osv",
"document_id": 515851,
"published_at": "2025-07-28T11:12:20.188+00:00"
}