media: i2c: ov02a10: fix endpoint parsing use-after-free
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 91807efbe8ec7f591085067d9f96a112e015274b · < 6e13784452785cd8402b228bea53bc6a027ade84| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
media: i2c: ov02a10: fix endpoint parsing use-after-free
The ov02a10_check_hwcfg() function calls fwnode_handle_put(ep) immediately after allocating and parsing the endpoint. However, it subsequently calls fwnode_property_read_u32() using the same 'ep' handle, leading to a potential use-after-free.
Additionally, reading the optional 'ovti,mipi-clock-voltage' property used to overwrite the 'ret' variable. If the property was missing, 'ret' would become negative, and this failure code would be incorrectly returned at the end of the function, causing probe to fail entirely.
Fix the use-after-free by moving fwnode_property_read_u32() before the endpoint is parsed and freed. Avoid the error leak by not assigning the result of fwnode_property_read_u32() to 'ret'.
From the CVE record · Linux
The Linux kernel’s ov02a10 media driver can use an endpoint handle after freeing it. The input does not specify how an attacker could exploit this or whether network access, authentication, or user interaction is required. A missing optional property can also cause device probe to fail.
Engineers running Linux kernels with the ov02a10 media driver should check their kernel versions; affected versions were not provided.