# CVE-2025-23158: media: venus: hfi: add check to handle incorrect queue size

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

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; 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.32% (percentile 18, 2026-11-26)
- **CWE:** CWE-787
- **Published:** 2025-05-01T12:55:43.804Z
- **Modified:** 2026-08-05T11:57:09.342Z

## Who should check

- Anyone running Linux \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< 1b86c1917e16bafbbb08ab90baaff533aa36c62d; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< a45957bcde529169188929816775a575de77d84f; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< 32af5c1fdb9bc274f52ee0472d3b060b18e4aab4; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< cf5f7bb4e0d786f4d9d50ae6b5963935eab71d75; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< 40084302f639b3fe954398c5ba5ee556b7242b54; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< 679424f8b31446f90080befd0300ea915485b096; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< edb89d69b1438681daaf5ca90aed3242df94cc96; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< 101a86619aab42bb61f2253bbf720121022eab86; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< 69baf245b23e20efda0079238b27fc63ecf13de1
- Anyone running Linux 4.13

## Description

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

media: venus: hfi: add check to handle incorrect queue size

qsize represents size of shared queued between driver and video
firmware. Firmware can modify this value to an invalid large value. In
such situation, empty\_space will be bigger than the space actually
available. Since new\_wr\_idx is not checked, so the following code will
result in an OOB write.
...
qsize = qhdr-\>q\_size

if (wr\_idx \>= rd\_idx)
 empty\_space = qsize - (wr\_idx - rd\_idx)
....
if (new\_wr\_idx \< qsize) {
 memcpy(wr\_ptr, packet, dwords \<\< 2) --\> OOB write

Add check to ensure qsize is within the allocated size while
reading and writing packets into the queue.

## Affected and fixed versions

- Linux: \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< 1b86c1917e16bafbbb08ab90baaff533aa36c62d; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< a45957bcde529169188929816775a575de77d84f; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< 32af5c1fdb9bc274f52ee0472d3b060b18e4aab4; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< cf5f7bb4e0d786f4d9d50ae6b5963935eab71d75; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< 40084302f639b3fe954398c5ba5ee556b7242b54; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< 679424f8b31446f90080befd0300ea915485b096; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< edb89d69b1438681daaf5ca90aed3242df94cc96; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< 101a86619aab42bb61f2253bbf720121022eab86; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< 69baf245b23e20efda0079238b27fc63ecf13de1 (cvelist)
- Linux: 4.13 (cvelist)

## Mitigation

- Upgrade Linux to 69baf245b23e20efda0079238b27fc63ecf13de1 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2025-23158.md
Affected: Linux >= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, < 1b86c1917e16bafbbb08ab90baaff533aa36c62d; >= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, < a45957bcde529169188929816775a575de77d84f; >= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, < 32af5c1fdb9bc274f52ee0472d3b060b18e4aab4; >= d96d3f30c0f2f564f6922bf…
Fixed in: Linux 1b86c1917e16bafbbb08ab90baaff533aa36c62d, Linux 32af5c1fdb9bc274f52ee0472d3b060b18e4aab4, Linux 40084302f639b3fe954398c5ba5ee556b7242b54, Linux 679424f8b31446f90080befd0300ea915485b096, Linux 101a86619aab42bb61f2253bbf720121022eab86, Linux 69baf245b23e20efda0079238b27fc63ecf13de1

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-2025-23158 being exploited?

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

### How serious is CVE-2025-23158?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-23158?

Linux \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< 1b86c1917e16bafbbb08ab90baaff533aa36c62d; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< a45957bcde529169188929816775a575de77d84f; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< 32af5c1fdb9bc274f52ee0472d3b060b18e4aab4; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< cf5f7bb4e0d786f4d9d50ae6b5963935eab71d75; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< 40084302f639b3fe954398c5ba5ee556b7242b54; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< 679424f8b31446f90080befd0300ea915485b096; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< edb89d69b1438681daaf5ca90aed3242df94cc96; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< 101a86619aab42bb61f2253bbf720121022eab86; \>= d96d3f30c0f2f564f6922bf4ccdf4464992e31fb, \< 69baf245b23e20efda0079238b27fc63ecf13de1; Linux 4.13.

### Is there a fix for CVE-2025-23158?

Yes. Fixed in Linux 1b86c1917e16bafbbb08ab90baaff533aa36c62d, Linux 32af5c1fdb9bc274f52ee0472d3b060b18e4aab4, Linux 40084302f639b3fe954398c5ba5ee556b7242b54, Linux 679424f8b31446f90080befd0300ea915485b096, Linux 101a86619aab42bb61f2253bbf720121022eab86, Linux 69baf245b23e20efda0079238b27fc63ecf13de1. Upgrade Linux to 69baf245b23e20efda0079238b27fc63ecf13de1 or later.

### How do I check if I'm affected by CVE-2025-23158?

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/1b86c1917e16bafbbb08ab90baaff533aa36c62d>
- patch: <https://git.kernel.org/stable/c/a45957bcde529169188929816775a575de77d84f>
- patch: <https://git.kernel.org/stable/c/32af5c1fdb9bc274f52ee0472d3b060b18e4aab4>
- patch: <https://git.kernel.org/stable/c/cf5f7bb4e0d786f4d9d50ae6b5963935eab71d75>
- patch: <https://git.kernel.org/stable/c/40084302f639b3fe954398c5ba5ee556b7242b54>
- patch: <https://git.kernel.org/stable/c/679424f8b31446f90080befd0300ea915485b096>
- patch: <https://git.kernel.org/stable/c/edb89d69b1438681daaf5ca90aed3242df94cc96>
- patch: <https://git.kernel.org/stable/c/101a86619aab42bb61f2253bbf720121022eab86>
- patch: <https://git.kernel.org/stable/c/69baf245b23e20efda0079238b27fc63ecf13de1>
- other: <https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html>
- other: <https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html>

## 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-2025-23158>

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