CVE-2024-40903 usb: typec: tcpm: fix use-after-free case in tcpm_register_source_caps
A use-after-free vulnerability in the Linux kernel's USB Type-C driver allows attackers to potentially execute code or cause a system crash.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-40903?
CVE-2024-40903 is a high-severity use after free vulnerability in Linux kernel, published on 12 Jul 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
In the Linux kernel, the following vulnerability has been resolved:
usb: typec: tcpm: fix use-after-free case in tcpm_register_source_caps
There could be a potential use-after-free case in tcpm_register_source_caps(). This could happen when: * new (say invalid) source caps are advertised * the existing source caps are unregistered * tcpm_register_source_caps() returns with an error as usb_power_delivery_register_capabilities() fails
This causes port->partner_source_caps to hold on to the now freed source caps.
Reset port->partner_source_caps value to NULL after unregistering existing source caps.
Weakness: CWE-416
Which versions are affected by CVE-2024-40903?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2024-40903?
Apply the vendor's patch.
Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.
Is CVE-2024-40903 being exploited?
There is no known exploitation of CVE-2024-40903 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as BELL-CVE-2024-40903, DEBIAN-CVE-2024-40903, GHSA-h2pc-hp6x-5m8m, UBUNTU-CVE-2024-40903.