phy: core: Fix race-condition between _of_phy_get() and try_module_get()
No exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 0%. Fixed in Kernel 8a9f16b5237eb5690cc109d37a545f034afa81de, Kernel 090055ee629523092688da42428558ba56d4272f, Kernel 2156c5aefd2c97a60766520bd04f4790f3b38f64 and 4 more.
In the Linux kernel, the following vulnerability has been resolved: phy: core: Fix race-condition between _of_phy_get() and try_module_get() Sashiko asked during a patch review if the existing usage pattern had a race condition; specifically in of_phy_get() if it was possible between returning from _of_phy_get() and running try_module_get() that a module might be unbound leading to use-after-free. Looking at the code this appears to be so, there is no linkage between the phy and module under a synchronisation primitive. Using the phy_provider_mutex in phy_get() will ensure there is a link between the returned phy pointer and the module_get() bumping the module reference count. Amend phy_get(), of_phy_get() and devm_of_phy_get_by_index() to fix the same usage pattern. phy_provider_unregister() must take the phy_provider_mutex so amending phy_get()/of_phy_get() to take that same mutex guarantees there is no use-after-free.
Affected
Vendors, products and packages with version ranges
| Vendor | Product | Versions | Fixed |
|---|---|---|---|
| Linux | Kernel | >=ff764963479a1b18721ab96e531404c50fefe8b1 <8a9f16b5237eb5690cc109d37a545f034afa81de, >=ff764963479a1b18721ab96e531404c50fefe8b1 <090055ee629523092688da42428558ba56d4272f, >=ff764963479a1b18721ab96e531404c50fefe8b1 <2156c5aefd2c97a60766520bd04f4790f3b38f64, >=ff764963479a1b18721ab96e531404c50fefe8b1 <2ea5385758a7cc863d9e2f6b642c8e7820437980, =3.13 | 8a9f16b5237eb5690cc109d37a545f034afa81de, 090055ee629523092688da42428558ba56d4272f, 2156c5aefd2c97a60766520bd04f4790f3b38f64, 2ea5385758a7cc863d9e2f6b642c8e7820437980 |
| linux-kernel: Kernel | >=6.13.0 <6.18.61, >=6.19.0 <7.3.2, >=3.13.0 <6.12.117 | 6.18.61, 7.3.2, 6.12.117 |
Timeline
Every event on this vulnerability
Related
Other vulnerabilities in Kernel, strongest first
Embed
A live severity badge for an advisory, README or ticket