of/overlay: don't leak fragment references when changeset init fails
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 61b4de4e0b384f4a22c55c3bada604da49cec4e1 · < 7a46f1917b320cc8762183b802301da02a191b6a| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
of/overlay: don't leak fragment references when changeset init fails
init_overlay_changeset() stores the number of initialized fragments in ovcs->count only on full success. When find_target() or the __symbols__ lookup fails partway through, the target and overlay references taken for the fragments initialized so far are never dropped: free_overlay_changeset() bounds its cleanup loop by ovcs->count, which is still 0.
Store the running count on the error path so free_overlay_changeset() puts whatever was set up. The store is guarded by ovcs->fragments because on the allocation-failure path cnt still holds the counting pass total while there is no fragments array; everywhere else cnt only counts fully-initialized fragments.
From the CVE record · Linux
The Linux kernel's OF overlay changeset code can leak fragment references if target resolution or a __symbols__ lookup fails during initialization. The input does not specify how an attacker could trigger the failure, or whether network access, authentication, or user interaction is required.
Engineers running Linux kernels with OF overlay support should check their versions against the vendor advisory; affected versions are not specified.