# CVE-2024-39495: greybus: Fix use-after-free bug in gb\_interface\_release due to race condition.

> 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.36% (percentile 22, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2024-07-12T12:20:31.022Z
- **Modified:** 2026-08-05T11:33:44.931Z

## Who should check

- Anyone running Linux \>= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, \< 74cd0a421896b2e07eafe7da4275302bfecef201; \>= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, \< 2b6bb0b4abfd79b8698ee161bb73c0936a2aaf83; \>= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, \< fb071f5c75d4b1c177824de74ee75f9dd34123b9; \>= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, \< 9a733d69a4a59c2d08620e6589d823c24be773dc; \>= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, \< 0b8fba38bdfb848fac52e71270b2aa3538c996ea; \>= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, \< 03ea2b129344152157418929f06726989efc0445; \>= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, \< 5c9c5d7f26acc2c669c1dcf57d1bb43ee99220ce
- Anyone running Linux 4.9

## Description

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

greybus: Fix use-after-free bug in gb\_interface\_release due to race condition.

In gb\_interface\_create, &intf-\>mode\_switch\_completion is bound with
gb\_interface\_mode\_switch\_work. Then it will be started by
gb\_interface\_request\_mode\_switch. Here is the relevant code.
if (!queue\_work(system\_long\_wq, &intf-\>mode\_switch\_work)) {
	...
}

If we call gb\_interface\_release to make cleanup, there may be an
unfinished work. This function will call kfree to free the object
"intf". However, if gb\_interface\_mode\_switch\_work is scheduled to
run after kfree, it may cause use-after-free error as
gb\_interface\_mode\_switch\_work will use the object "intf".
The possible execution flow that may lead to the issue is as follows:

CPU0                            CPU1

                            \|   gb\_interface\_create
                            \|   gb\_interface\_request\_mode\_switch
gb\_interface\_release        \|
kfree(intf) (free)          \|
                            \|   gb\_interface\_mode\_switch\_work
                            \|   mutex\_lock(&intf-\>mutex) (use)

Fix it by canceling the work before kfree.

## Affected and fixed versions

- Linux: \>= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, \< 74cd0a421896b2e07eafe7da4275302bfecef201; \>= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, \< 2b6bb0b4abfd79b8698ee161bb73c0936a2aaf83; \>= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, \< fb071f5c75d4b1c177824de74ee75f9dd34123b9; \>= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, \< 9a733d69a4a59c2d08620e6589d823c24be773dc; \>= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, \< 0b8fba38bdfb848fac52e71270b2aa3538c996ea; \>= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, \< 03ea2b129344152157418929f06726989efc0445; \>= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, \< 5c9c5d7f26acc2c669c1dcf57d1bb43ee99220ce (cvelist)
- Linux: 4.9 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2024-39495.md
Affected: Linux >= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, < 74cd0a421896b2e07eafe7da4275302bfecef201; >= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, < 2b6bb0b4abfd79b8698ee161bb73c0936a2aaf83; >= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, < fb071f5c75d4b1c177824de74ee75f9dd34123b9; >= 55742d2a071a569bf20f90d…
Fixed in: Linux 74cd0a421896b2e07eafe7da4275302bfecef201, Linux 2b6bb0b4abfd79b8698ee161bb73c0936a2aaf83, Linux 9a733d69a4a59c2d08620e6589d823c24be773dc, Linux 0b8fba38bdfb848fac52e71270b2aa3538c996ea, Linux 03ea2b129344152157418929f06726989efc0445, Linux 5c9c5d7f26acc2c669c1dcf57d1bb43ee99220ce

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

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

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

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

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

Linux \>= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, \< 74cd0a421896b2e07eafe7da4275302bfecef201; \>= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, \< 2b6bb0b4abfd79b8698ee161bb73c0936a2aaf83; \>= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, \< fb071f5c75d4b1c177824de74ee75f9dd34123b9; \>= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, \< 9a733d69a4a59c2d08620e6589d823c24be773dc; \>= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, \< 0b8fba38bdfb848fac52e71270b2aa3538c996ea; \>= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, \< 03ea2b129344152157418929f06726989efc0445; \>= 55742d2a071a569bf20f90d37b1b5b8a25a3f882, \< 5c9c5d7f26acc2c669c1dcf57d1bb43ee99220ce; Linux 4.9.

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

Yes. Fixed in Linux 74cd0a421896b2e07eafe7da4275302bfecef201, Linux 2b6bb0b4abfd79b8698ee161bb73c0936a2aaf83, Linux 9a733d69a4a59c2d08620e6589d823c24be773dc, Linux 0b8fba38bdfb848fac52e71270b2aa3538c996ea, Linux 03ea2b129344152157418929f06726989efc0445, Linux 5c9c5d7f26acc2c669c1dcf57d1bb43ee99220ce. Upgrade Linux to 5c9c5d7f26acc2c669c1dcf57d1bb43ee99220ce or later.

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

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/74cd0a421896b2e07eafe7da4275302bfecef201>
- patch: <https://git.kernel.org/stable/c/2b6bb0b4abfd79b8698ee161bb73c0936a2aaf83>
- patch: <https://git.kernel.org/stable/c/fb071f5c75d4b1c177824de74ee75f9dd34123b9>
- patch: <https://git.kernel.org/stable/c/9a733d69a4a59c2d08620e6589d823c24be773dc>
- patch: <https://git.kernel.org/stable/c/0b8fba38bdfb848fac52e71270b2aa3538c996ea>
- patch: <https://git.kernel.org/stable/c/03ea2b129344152157418929f06726989efc0445>
- patch: <https://git.kernel.org/stable/c/5c9c5d7f26acc2c669c1dcf57d1bb43ee99220ce>
- 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-39495>

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