clk: microchip: fix potential UAF in auxdev release callback
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
clk: microchip: fix potential UAF in auxdev release callback
Similar to commit 1c11289b34ab ("peci: cpu: Fix use-after-free in adev_release()"), the auxiliary device is not torn down in the correct order. If auxiliary_device_add() fails, the release callback will be called twice, resulting in a UAF. Due to timing, the auxdev code in this driver "took inspiration" from the aforementioned commit, and thus its bugs too!
Moving auxiliary_device_uninit() to the unregister callback instead avoids the issue.
From the CVE record · Linux
The Linux kernel’s Microchip clock driver can call an auxiliary device release callback twice if auxiliary_device_add() fails, causing a potential use-after-free. The input does not establish how an attacker could trigger the failure or whether access, authentication, or user interaction is required.
Engineers running Linux kernels with the Microchip clock driver should check their kernel; affected versions are not specified.