# CVE-2024-39495: greybus: Fix use-after-free bug in gb_interface_release due to race condition.

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.32%, higher than 27% of CVEs (2026-12-01)
- Published: 2024-07-12T12:20:31.022Z
- Modified: 2026-08-05T11:33:44.931Z
- Weaknesses: CWE-416
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: Linux

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

(As written by CVE List.)

## Affected

- Linux Linux: from 55742d2a071a569bf20f90d37b1b5b8a25a3f882 before 74cd0a421896b2e07eafe7da4275302bfecef201; from 55742d2a071a569bf20f90d37b1b5b8a25a3f882 before 2b6bb0b4abfd79b8698ee161bb73c0936a2aaf83; from 55742d2a071a569bf20f90d37b1b5b8a25a3f882 before fb071f5c75d4b1c177824de74ee75f9dd34123b9; from 55742d2a071a569bf20f90d37b1b5b8a25a3f882 before 9a733d69a4a59c2d08620e6589d823c24be773dc; from 55742d2a071a569bf20f90d37b1b5b8a25a3f882 before 0b8fba38bdfb848fac52e71270b2aa3538c996ea; from 55742d2a071a569bf20f90d37b1b5b8a25a3f882 before 03ea2b129344152157418929f06726989efc0445; from 55742d2a071a569bf20f90d37b1b5b8a25a3f882 before 5c9c5d7f26acc2c669c1dcf57d1bb43ee99220ce; 4.9 (not affected: before 4.9; from 5.4.279 up to 5.4.*; from 5.10.221 up to 5.10.*; from 5.15.162 up to 5.15.*; from 6.1.95 up to 6.1.*; from 6.6.35 up to 6.6.*; from 6.9.6 up to 6.9.*; from 6.10 up to *)
- linux linux_kernel: before 74cd0a421896; from 1da177e4c3f4 before 2b6bb0b4abfd; from 1da177e4c3f4 before fb071f5c75d4; from 1da177e4c3f4 before 9a733d69a4a5; from 1da177e4c3f4 before 0b8fba38bdfb; from 1da177e4c3f4 before 03ea2b129344; from 1da177e4c3f4 before 5c9c5d7f26ac; before 5.4.279; from 5.5 before 5.10.221; from 5.11 before 5.15.162; from 5.16 before 6.1.95; from 6.2 before 6.6.35; and 1 more

## Every score

- Linux: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- CISA-ADP: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`

## References

- <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> (patch)
- <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html>

## Sources

- CVE List: [CVE-2024-39495](https://www.cve.org/CVERecord?id=CVE-2024-39495), CVE Terms of Use, modified 2026-08-05
- NVD: [CVE-2024-39495](https://nvd.nist.gov/vuln/detail/CVE-2024-39495), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-39495 · Whole record: https://cve.day/CVE-2024-39495.json · Rebuilt by cve.day 2026-11-25T22:58:42.816Z
