# CVE-2024-35921: media: mediatek: vcodec: Fix oops when HEVC init fails

> 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.33% (percentile 18, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2024-05-19T10:10:33.053Z
- **Modified:** 2026-08-05T11:31:00.628Z

## Who should check

- Anyone running Linux \>= 2674486aac7d9c95ceb77daf7c30f862d4295c1c, \< ec25fc3c2c1e8958a51abcfed614f81446d918c4; \>= 2674486aac7d9c95ceb77daf7c30f862d4295c1c, \< 521ce0ea7418298d754494fe53263c23c4c78a8e; \>= 2674486aac7d9c95ceb77daf7c30f862d4295c1c, \< 97c75ee5de060d271d80109b0c47cb6008439e5b
- Anyone running Linux 6.5

## Description

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

media: mediatek: vcodec: Fix oops when HEVC init fails

The stateless HEVC decoder saves the instance pointer in the context
regardless if the initialization worked or not. This caused a use after
free, when the pointer is freed in case of a failure in the deinit
function.
Only store the instance pointer when the initialization was successful,
to solve this issue.

 Hardware name: Acer Tomato (rev3 - 4) board (DT)
 pstate: 80400009 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
 pc : vcodec\_vpu\_send\_msg+0x4c/0x190 \[mtk\_vcodec\_dec\]
 lr : vcodec\_send\_ap\_ipi+0x78/0x170 \[mtk\_vcodec\_dec\]
 sp : ffff80008750bc20
 x29: ffff80008750bc20 x28: ffff1299f6d70000 x27: 0000000000000000
 x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000
 x23: ffff80008750bc98 x22: 000000000000a003 x21: ffffd45c4cfae000
 x20: 0000000000000010 x19: ffff1299fd668310 x18: 000000000000001a
 x17: 000000040044ffff x16: ffffd45cb15dc648 x15: 0000000000000000
 x14: ffff1299c08da1c0 x13: ffffd45cb1f87a10 x12: ffffd45cb2f5fe80
 x11: 0000000000000001 x10: 0000000000001b30 x9 : ffffd45c4d12b488
 x8 : 1fffe25339380d81 x7 : 0000000000000001 x6 : ffff1299c9c06c00
 x5 : 0000000000000132 x4 : 0000000000000000 x3 : 0000000000000000
 x2 : 0000000000000010 x1 : ffff80008750bc98 x0 : 0000000000000000
 Call trace:
  vcodec\_vpu\_send\_msg+0x4c/0x190 \[mtk\_vcodec\_dec\]
  vcodec\_send\_ap\_ipi+0x78/0x170 \[mtk\_vcodec\_dec\]
  vpu\_dec\_deinit+0x1c/0x30 \[mtk\_vcodec\_dec\]
  vdec\_hevc\_slice\_deinit+0x30/0x98 \[mtk\_vcodec\_dec\]
  vdec\_if\_deinit+0x38/0x68 \[mtk\_vcodec\_dec\]
  mtk\_vcodec\_dec\_release+0x20/0x40 \[mtk\_vcodec\_dec\]
  fops\_vcodec\_release+0x64/0x118 \[mtk\_vcodec\_dec\]
  v4l2\_release+0x7c/0x100
  \_\_fput+0x80/0x2d8
  \_\_fput\_sync+0x58/0x70
  \_\_arm64\_sys\_close+0x40/0x90
  invoke\_syscall+0x50/0x128
  el0\_svc\_common.constprop.0+0x48/0xf0
  do\_el0\_svc+0x24/0x38
  el0\_svc+0x38/0xd8
  el0t\_64\_sync\_handler+0xc0/0xc8
  el0t\_64\_sync+0x1a8/0x1b0
 Code: d503201f f9401660 b900127f b900227f (f9400400)

## Affected and fixed versions

- Linux: \>= 2674486aac7d9c95ceb77daf7c30f862d4295c1c, \< ec25fc3c2c1e8958a51abcfed614f81446d918c4; \>= 2674486aac7d9c95ceb77daf7c30f862d4295c1c, \< 521ce0ea7418298d754494fe53263c23c4c78a8e; \>= 2674486aac7d9c95ceb77daf7c30f862d4295c1c, \< 97c75ee5de060d271d80109b0c47cb6008439e5b (cvelist)
- Linux: 6.5 (cvelist)

## Mitigation

- Upgrade Linux to 97c75ee5de060d271d80109b0c47cb6008439e5b or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2024-35921.md
Affected: Linux >= 2674486aac7d9c95ceb77daf7c30f862d4295c1c, < ec25fc3c2c1e8958a51abcfed614f81446d918c4; >= 2674486aac7d9c95ceb77daf7c30f862d4295c1c, < 521ce0ea7418298d754494fe53263c23c4c78a8e; >= 2674486aac7d9c95ceb77daf7c30f862d4295c1c, < 97c75ee5de060d271d80109b0c47cb6008439e5b; Linux 6.5
Fixed in: Linux 521ce0ea7418298d754494fe53263c23c4c78a8e, Linux 97c75ee5de060d271d80109b0c47cb6008439e5b

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-2024-35921 being exploited?

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

### How serious is CVE-2024-35921?

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

### Which versions are affected by CVE-2024-35921?

Linux \>= 2674486aac7d9c95ceb77daf7c30f862d4295c1c, \< ec25fc3c2c1e8958a51abcfed614f81446d918c4; \>= 2674486aac7d9c95ceb77daf7c30f862d4295c1c, \< 521ce0ea7418298d754494fe53263c23c4c78a8e; \>= 2674486aac7d9c95ceb77daf7c30f862d4295c1c, \< 97c75ee5de060d271d80109b0c47cb6008439e5b; Linux 6.5.

### Is there a fix for CVE-2024-35921?

Yes. Fixed in Linux 521ce0ea7418298d754494fe53263c23c4c78a8e, Linux 97c75ee5de060d271d80109b0c47cb6008439e5b. Upgrade Linux to 97c75ee5de060d271d80109b0c47cb6008439e5b or later.

### How do I check if I'm affected by CVE-2024-35921?

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/ec25fc3c2c1e8958a51abcfed614f81446d918c4>
- patch: <https://git.kernel.org/stable/c/521ce0ea7418298d754494fe53263c23c4c78a8e>
- patch: <https://git.kernel.org/stable/c/97c75ee5de060d271d80109b0c47cb6008439e5b>

## 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-2024-35921>

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