CVE-2026-139557

misc: enclosure: fix UAF on device_register() failure

Published Nov 30, 2026 CVSS n/a EPSS < 1% KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

misc: enclosure: fix UAF on device_register() failure

After device_register() fails, the embedded struct device has already been
initialized and must be released with put_device() so that
enclosure_release() can drop the parent reference and free edev.

The error path currently does put_device(parent) + kfree(edev), which
skips the device lifetime rules and can free the object while the device
core still owns a reference (use-after-free).

Analysis

AI-generated

Technical impact

The vulnerability resides in the Linux kernel enclosure subsystem where a device registration failure triggers an improper cleanup. The embedded struct device is initialized but the failure path releases only the parent reference and frees the device with kfree(edev), bypassing the required put_device() call. This allows the kernel to free memory that is still referenced by the device core, creating a use‑after‑free condition that can corrupt kernel memory or cause a kernel crash. The flaw is a classic arena‑based memory corruption vulnerability of type CWE‑416.

Affected Systems

Any Linux kernel build that contains the enclosure subsystem code before the commits listed in the advisory is potentially affected. The vulnerability applies generically across Linux distributions that ship the affected kernel source; no specific kernel version is enumerated.

Risk and Exploitability

Exploitation requires the attacker to trigger a device_register() failure for an enclosure device. The CVE description does not specify the exact conditions needed to induce such a failure. It is inferred that an attacker would need to achieve local privileged access or be able to load a kernel module that exercises the vulnerable path. Deployment of the vulnerable code path could allow an attacker to gain ring‑0 privileges, potentially enabling arbitrary code execution. The EPSS score is not available, and the vulnerability is not listed in CISA’s KEV catalog. The absence of automated mitigations and the nature of the flaw suggest a high severity if trigger conditions are met.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply a Linux kernel update that incorporates the proofs‑of‑concept commits referenced in the advisory, such as 0f3b12bab74e13a2b8686a49c5b83099da61e032, to restore proper reference counting and cleanup logic.
  • If an upgrade is not immediately possible, disable or unload any kernel modules that depend on the enclosure subsystem to prevent the vulnerable code path from being exercised.
  • Enable kernel hardening options such as CONFIG_RANDOMIZE_FULL_VMA and enforce SELinux/AppArmor profiles that restrict interactions with device drivers; configure kdump or crash dumps to capture kernel panics for forensic analysis.

Generated by OpenCVE AI on December 1, 2026 at 17:52 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-416
Type Values Removed Values Added
Weaknesses CWE-416
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: misc: enclosure: fix UAF on device_register() failure After device_register() fails, the embedded struct device has already been initialized and must be released with put_device() so that enclosure_release() can drop the parent reference and free edev. The error path currently does put_device(parent) + kfree(edev), which skips the device lifetime rules and can free the object while the device core still owns a reference (use-after-free).
Title misc: enclosure: fix UAF on device_register() failure
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

No weakness.

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:35 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:19 PM
Modified
Nov 30, 2026, 2:19 PM