# CVE-2024-50031: drm/v3d: Stop the active perfmon before being destroyed

> 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)
- **Published:** 2024-10-21T19:39:33.795Z
- **Modified:** 2026-08-05T11:41:07.577Z

## Who should check

- Anyone running Linux \>= 26a4dc29b74a137f45665089f6d3d633fcc9b662, \< 24ab54a066d2ef671b03eb909ca2114c0c9ac1e7; \>= 26a4dc29b74a137f45665089f6d3d633fcc9b662, \< 0c9e9a3a4873705740b19300cadc6599170646ef; \>= 26a4dc29b74a137f45665089f6d3d633fcc9b662, \< 07c51108d9e278831c16191d1223ee49986e7890; \>= 26a4dc29b74a137f45665089f6d3d633fcc9b662, \< 333767cbce6ac20ec794c76eec82ed0ef55022db; \>= 26a4dc29b74a137f45665089f6d3d633fcc9b662, \< 7d1fd3638ee3a9f9bca4785fffb638ca19120718
- Anyone running Linux 5.15

## Description

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

drm/v3d: Stop the active perfmon before being destroyed

When running \`kmscube\` with one or more performance monitors enabled
via \`GALLIUM\_HUD\`, the following kernel panic can occur:

\[   55.008324\] Unable to handle kernel paging request at virtual address 00000000052004a4
\[   55.008368\] Mem abort info:
\[   55.008377\]   ESR = 0x0000000096000005
\[   55.008387\]   EC = 0x25: DABT (current EL), IL = 32 bits
\[   55.008402\]   SET = 0, FnV = 0
\[   55.008412\]   EA = 0, S1PTW = 0
\[   55.008421\]   FSC = 0x05: level 1 translation fault
\[   55.008434\] Data abort info:
\[   55.008442\]   ISV = 0, ISS = 0x00000005, ISS2 = 0x00000000
\[   55.008455\]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
\[   55.008467\]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
\[   55.008481\] user pgtable: 4k pages, 39-bit VAs, pgdp=00000001046c6000
\[   55.008497\] \[00000000052004a4\] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000
\[   55.008525\] Internal error: Oops: 0000000096000005 \[\#1\] PREEMPT SMP
\[   55.008542\] Modules linked in: rfcomm \[...\] vc4 v3d snd\_soc\_hdmi\_codec drm\_display\_helper
gpu\_sched drm\_shmem\_helper cec drm\_dma\_helper drm\_kms\_helper i2c\_brcmstb
drm drm\_panel\_orientation\_quirks snd\_soc\_core snd\_compress snd\_pcm\_dmaengine snd\_pcm snd\_timer snd backlight
\[   55.008799\] CPU: 2 PID: 166 Comm: v3d\_bin Tainted: G         C         6.6.47+rpt-rpi-v8 \#1  Debian 1:6.6.47-1+rpt1
\[   55.008824\] Hardware name: Raspberry Pi 4 Model B Rev 1.5 (DT)
\[   55.008838\] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
\[   55.008855\] pc : \_\_mutex\_lock.constprop.0+0x90/0x608
\[   55.008879\] lr : \_\_mutex\_lock.constprop.0+0x58/0x608
\[   55.008895\] sp : ffffffc080673cf0
\[   55.008904\] x29: ffffffc080673cf0 x28: 0000000000000000 x27: ffffff8106188a28
\[   55.008926\] x26: ffffff8101e78040 x25: ffffff8101baa6c0 x24: ffffffd9d989f148
\[   55.008947\] x23: ffffffda1c2a4008 x22: 0000000000000002 x21: ffffffc080673d38
\[   55.008968\] x20: ffffff8101238000 x19: ffffff8104f83188 x18: 0000000000000000
\[   55.008988\] x17: 0000000000000000 x16: ffffffda1bd04d18 x15: 00000055bb08bc90
\[   55.009715\] x14: 0000000000000000 x13: 0000000000000000 x12: ffffffda1bd4cbb0
\[   55.010433\] x11: 00000000fa83b2da x10: 0000000000001a40 x9 : ffffffda1bd04d04
\[   55.011162\] x8 : ffffff8102097b80 x7 : 0000000000000000 x6 : 00000000030a5857
\[   55.011880\] x5 : 00ffffffffffffff x4 : 0300000005200470 x3 : 0300000005200470
\[   55.012598\] x2 : ffffff8101238000 x1 : 0000000000000021 x0 : 0300000005200470
\[   55.013292\] Call trace:
\[   55.013959\]  \_\_mutex\_lock.constprop.0+0x90/0x608
\[   55.014646\]  \_\_mutex\_lock\_slowpath+0x1c/0x30
\[   55.015317\]  mutex\_lock+0x50/0x68
\[   55.015961\]  v3d\_perfmon\_stop+0x40/0xe0 \[v3d\]
\[   55.016627\]  v3d\_bin\_job\_run+0x10c/0x2d8 \[v3d\]
\[   55.017282\]  drm\_sched\_main+0x178/0x3f8 \[gpu\_sched\]
\[   55.017921\]  kthread+0x11c/0x128
\[   55.018554\]  ret\_from\_fork+0x10/0x20
\[   55.019168\] Code: f9400260 f1001c1f 54001ea9 927df000 (b9403401)
\[   55.019776\] ---\[ end trace 0000000000000000 \]---
\[   55.020411\] note: v3d\_bin\[166\] exited with preempt\_count 1

This issue arises because, upon closing the file descriptor (which happens
when we interrupt \`kmscube\`), the active performance monitor is not
stopped. Although all perfmons are destroyed in \`v3d\_perfmon\_close\_file()\`,
the active performance monitor's pointer (\`v3d-\>active\_perfmon\`) is still
retained.

If \`kmscube\` is run again, the driver will attempt to stop the active
performance monitor using the stale pointer in \`v3d-\>active\_perfmon\`.
However, this pointer is no longer valid because the previous process has
already terminated, and all performance monitors associated with it have
been destroyed and freed.

To fix this, when the active performance monitor belongs to a given
process, explicitly stop it before destroying and freeing it.

## Affected and fixed versions

- Linux: \>= 26a4dc29b74a137f45665089f6d3d633fcc9b662, \< 24ab54a066d2ef671b03eb909ca2114c0c9ac1e7; \>= 26a4dc29b74a137f45665089f6d3d633fcc9b662, \< 0c9e9a3a4873705740b19300cadc6599170646ef; \>= 26a4dc29b74a137f45665089f6d3d633fcc9b662, \< 07c51108d9e278831c16191d1223ee49986e7890; \>= 26a4dc29b74a137f45665089f6d3d633fcc9b662, \< 333767cbce6ac20ec794c76eec82ed0ef55022db; \>= 26a4dc29b74a137f45665089f6d3d633fcc9b662, \< 7d1fd3638ee3a9f9bca4785fffb638ca19120718 (cvelist)
- Linux: 5.15 (cvelist)

## Mitigation

- Upgrade Linux to 7d1fd3638ee3a9f9bca4785fffb638ca19120718 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-50031. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-50031.md
Affected: Linux >= 26a4dc29b74a137f45665089f6d3d633fcc9b662, < 24ab54a066d2ef671b03eb909ca2114c0c9ac1e7; >= 26a4dc29b74a137f45665089f6d3d633fcc9b662, < 0c9e9a3a4873705740b19300cadc6599170646ef; >= 26a4dc29b74a137f45665089f6d3d633fcc9b662, < 07c51108d9e278831c16191d1223ee49986e7890; >= 26a4dc29b74a137f4566508…
Fixed in: Linux 24ab54a066d2ef671b03eb909ca2114c0c9ac1e7, Linux 0c9e9a3a4873705740b19300cadc6599170646ef, Linux 07c51108d9e278831c16191d1223ee49986e7890, Linux 333767cbce6ac20ec794c76eec82ed0ef55022db, Linux 7d1fd3638ee3a9f9bca4785fffb638ca19120718

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-50031 being exploited?

There is no confirmed exploitation: CVE-2024-50031 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-2024-50031?

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

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

Linux \>= 26a4dc29b74a137f45665089f6d3d633fcc9b662, \< 24ab54a066d2ef671b03eb909ca2114c0c9ac1e7; \>= 26a4dc29b74a137f45665089f6d3d633fcc9b662, \< 0c9e9a3a4873705740b19300cadc6599170646ef; \>= 26a4dc29b74a137f45665089f6d3d633fcc9b662, \< 07c51108d9e278831c16191d1223ee49986e7890; \>= 26a4dc29b74a137f45665089f6d3d633fcc9b662, \< 333767cbce6ac20ec794c76eec82ed0ef55022db; \>= 26a4dc29b74a137f45665089f6d3d633fcc9b662, \< 7d1fd3638ee3a9f9bca4785fffb638ca19120718; Linux 5.15.

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

Yes. Fixed in Linux 24ab54a066d2ef671b03eb909ca2114c0c9ac1e7, Linux 0c9e9a3a4873705740b19300cadc6599170646ef, Linux 07c51108d9e278831c16191d1223ee49986e7890, Linux 333767cbce6ac20ec794c76eec82ed0ef55022db, Linux 7d1fd3638ee3a9f9bca4785fffb638ca19120718. Upgrade Linux to 7d1fd3638ee3a9f9bca4785fffb638ca19120718 or later.

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

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/24ab54a066d2ef671b03eb909ca2114c0c9ac1e7>
- patch: <https://git.kernel.org/stable/c/0c9e9a3a4873705740b19300cadc6599170646ef>
- patch: <https://git.kernel.org/stable/c/07c51108d9e278831c16191d1223ee49986e7890>
- patch: <https://git.kernel.org/stable/c/333767cbce6ac20ec794c76eec82ed0ef55022db>
- patch: <https://git.kernel.org/stable/c/7d1fd3638ee3a9f9bca4785fffb638ca19120718>
- other: <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.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-2024-50031>

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