# CVE-2024-39486: drm/drm\_file: Fix pid refcounting race

> 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-416
- **Published:** 2024-07-06T09:25:21.514Z
- **Modified:** 2026-08-05T11:33:38.384Z

## Who should check

- Anyone running Linux \>= 031ddd28008971cce0b5626379b910d0a05fb4dd, \< 16682588ead4a593cf1aebb33b36df4d1e9e4ffa; \>= 1c7a387ffef894b1ab3942f0482dac7a6e0a909c, \< 0acce2a5c619ef1abdee783d7fea5eac78ce4844; \>= 1c7a387ffef894b1ab3942f0482dac7a6e0a909c, \< 4f2a129b33a2054e62273edd5a051c34c08d96e9; \>= 6.6.9, \< 6.6.37
- Anyone running Linux 6.7

## Description

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

drm/drm\_file: Fix pid refcounting race

\<maarten.lankhorst@linux.intel.com\>, Maxime Ripard
\<mripard@kernel.org\>, Thomas Zimmermann \<tzimmermann@suse.de\>

filp-\>pid is supposed to be a refcounted pointer; however, before this
patch, drm\_file\_update\_pid() only increments the refcount of a struct
pid after storing a pointer to it in filp-\>pid and dropping the
dev-\>filelist\_mutex, making the following race possible:

process A               process B
=========               =========
                        begin drm\_file\_update\_pid
                        mutex\_lock(&dev-\>filelist\_mutex)
                        rcu\_replace\_pointer(filp-\>pid, \<pid B\>, 1)
                        mutex\_unlock(&dev-\>filelist\_mutex)
begin drm\_file\_update\_pid
mutex\_lock(&dev-\>filelist\_mutex)
rcu\_replace\_pointer(filp-\>pid, \<pid A\>, 1)
mutex\_unlock(&dev-\>filelist\_mutex)
get\_pid(\<pid A\>)
synchronize\_rcu()
put\_pid(\<pid B\>)   \*\*\* pid B reaches refcount 0 and is freed here \*\*\*
                        get\_pid(\<pid B\>)   \*\*\* UAF \*\*\*
                        synchronize\_rcu()
                        put\_pid(\<pid A\>)

As far as I know, this race can only occur with CONFIG\_PREEMPT\_RCU=y
because it requires RCU to detect a quiescent state in code that is not
explicitly calling into the scheduler.

This race leads to use-after-free of a "struct pid".
It is probably somewhat hard to hit because process A has to pass
through a synchronize\_rcu() operation while process B is between
mutex\_unlock() and get\_pid().

Fix it by ensuring that by the time a pointer to the current task's pid
is stored in the file, an extra reference to the pid has been taken.

This fix also removes the condition for synchronize\_rcu(); I think
that optimization is unnecessary complexity, since in that case we
would usually have bailed out on the lockless check above.

## Affected and fixed versions

- Linux: \>= 031ddd28008971cce0b5626379b910d0a05fb4dd, \< 16682588ead4a593cf1aebb33b36df4d1e9e4ffa; \>= 1c7a387ffef894b1ab3942f0482dac7a6e0a909c, \< 0acce2a5c619ef1abdee783d7fea5eac78ce4844; \>= 1c7a387ffef894b1ab3942f0482dac7a6e0a909c, \< 4f2a129b33a2054e62273edd5a051c34c08d96e9; \>= 6.6.9, \< 6.6.37 (cvelist)
- Linux: 6.7 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2024-39486.md
Affected: Linux >= 031ddd28008971cce0b5626379b910d0a05fb4dd, < 16682588ead4a593cf1aebb33b36df4d1e9e4ffa; >= 1c7a387ffef894b1ab3942f0482dac7a6e0a909c, < 0acce2a5c619ef1abdee783d7fea5eac78ce4844; >= 1c7a387ffef894b1ab3942f0482dac7a6e0a909c, < 4f2a129b33a2054e62273edd5a051c34c08d96e9; >= 6.6.9, < 6.6.37; Linux …
Fixed in: Linux 16682588ead4a593cf1aebb33b36df4d1e9e4ffa, Linux 0acce2a5c619ef1abdee783d7fea5eac78ce4844, Linux 4f2a129b33a2054e62273edd5a051c34c08d96e9, Linux 6.6.37

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

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

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

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

Linux \>= 031ddd28008971cce0b5626379b910d0a05fb4dd, \< 16682588ead4a593cf1aebb33b36df4d1e9e4ffa; \>= 1c7a387ffef894b1ab3942f0482dac7a6e0a909c, \< 0acce2a5c619ef1abdee783d7fea5eac78ce4844; \>= 1c7a387ffef894b1ab3942f0482dac7a6e0a909c, \< 4f2a129b33a2054e62273edd5a051c34c08d96e9; \>= 6.6.9, \< 6.6.37; Linux 6.7.

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

Yes. Fixed in Linux 16682588ead4a593cf1aebb33b36df4d1e9e4ffa, Linux 0acce2a5c619ef1abdee783d7fea5eac78ce4844, Linux 4f2a129b33a2054e62273edd5a051c34c08d96e9, Linux 6.6.37. Upgrade Linux to 6.6.37 or later.

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

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/16682588ead4a593cf1aebb33b36df4d1e9e4ffa>
- patch: <https://git.kernel.org/stable/c/0acce2a5c619ef1abdee783d7fea5eac78ce4844>
- patch: <https://git.kernel.org/stable/c/4f2a129b33a2054e62273edd5a051c34c08d96e9>

## 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-39486>

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