# CVE-2021-47125: sch\_htb: fix refcount leak in htb\_parent\_to\_leaf\_offload

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.19% (percentile 5, 2026-11-26)
- **Published:** 2024-03-15T20:14:30.285Z
- **Modified:** 2026-06-17T04:16:35.013Z

## Who should check

- Anyone running Linux \>= ae81feb7338c89cee4e6aa0424bdab2ce2b52da2, \< 2411c02d03892a5057499f8102d0cc1e0f852416; \>= ae81feb7338c89cee4e6aa0424bdab2ce2b52da2, \< 944d671d5faa0d78980a3da5c0f04960ef1ad893
- Anyone running Linux 5.12

## Description

In the Linux kernel, the following vulnerability has been resolved:

sch\_htb: fix refcount leak in htb\_parent\_to\_leaf\_offload

The commit ae81feb7338c ("sch\_htb: fix null pointer dereference
on a null new\_q") fixes a NULL pointer dereference bug, but it
is not correct.

Because htb\_graft\_helper properly handles the case when new\_q
is NULL, and after the previous patch by skipping this call
which creates an inconsistency : dev\_queue-\>qdisc will still
point to the old qdisc, but cl-\>parent-\>leaf.q will point to
the new one (which will be noop\_qdisc, because new\_q was NULL).
The code is based on an assumption that these two pointers are
the same, so it can lead to refcount leaks.

The correct fix is to add a NULL pointer check to protect
qdisc\_refcount\_inc inside htb\_parent\_to\_leaf\_offload.

## Affected and fixed versions

- Linux: \>= ae81feb7338c89cee4e6aa0424bdab2ce2b52da2, \< 2411c02d03892a5057499f8102d0cc1e0f852416; \>= ae81feb7338c89cee4e6aa0424bdab2ce2b52da2, \< 944d671d5faa0d78980a3da5c0f04960ef1ad893 (cvelist)
- Linux: 5.12 (cvelist)

## Mitigation

- Upgrade Linux to 944d671d5faa0d78980a3da5c0f04960ef1ad893 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2021-47125. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-47125.md
Affected: Linux >= ae81feb7338c89cee4e6aa0424bdab2ce2b52da2, < 2411c02d03892a5057499f8102d0cc1e0f852416; >= ae81feb7338c89cee4e6aa0424bdab2ce2b52da2, < 944d671d5faa0d78980a3da5c0f04960ef1ad893; Linux 5.12
Fixed in: Linux 2411c02d03892a5057499f8102d0cc1e0f852416, Linux 944d671d5faa0d78980a3da5c0f04960ef1ad893

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2021-47125 being exploited?

There is no confirmed exploitation: CVE-2021-47125 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.19% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2021-47125?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2021-47125?

Linux \>= ae81feb7338c89cee4e6aa0424bdab2ce2b52da2, \< 2411c02d03892a5057499f8102d0cc1e0f852416; \>= ae81feb7338c89cee4e6aa0424bdab2ce2b52da2, \< 944d671d5faa0d78980a3da5c0f04960ef1ad893; Linux 5.12.

### Is there a fix for CVE-2021-47125?

Yes. Fixed in Linux 2411c02d03892a5057499f8102d0cc1e0f852416, Linux 944d671d5faa0d78980a3da5c0f04960ef1ad893. Upgrade Linux to 944d671d5faa0d78980a3da5c0f04960ef1ad893 or later.

### How do I check if I'm affected by CVE-2021-47125?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/2411c02d03892a5057499f8102d0cc1e0f852416>
- patch: <https://git.kernel.org/stable/c/944d671d5faa0d78980a3da5c0f04960ef1ad893>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-47125>

HTML: <https://flawdb.com/CVE-2021-47125> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-47125>
