CVE-2022-49085
Published: 26 February 2025
Summary
CVE-2022-49085 is a high-severity Use After Free (CWE-416) vulnerability in Linux Linux Kernel. Its CVSS base score is 7.8 (High).
Operationally, exploitation aligns with the MITRE ATT&CK technique Exploitation for Privilege Escalation (T1068); ranked at the 5.3th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog.
The strongest mitigations our analysis identified are NIST 800-53 SI-2 (Flaw Remediation) and SI-11 (Error Handling).
Deeper analysis
CVE-2022-49085 is a set of five use-after-free vulnerabilities in the Linux kernel's DRBD (Distributed Replicated Block Device) module, specifically within the get_initial_state function. The primary issue occurs when notify_initial_state_done(skb, ...) is called if cb->args[5]==1; if genlmsg_put() fails in that function, the skb is freed via nlmsg_free(skb), but get_initial_state then accesses the freed skb->len upon returning to out, resulting in a use-after-free. Four additional use-after-free bugs arise in similar scenarios involving notify_*_state_change and notify_*_state calls, where the skb is freed but later dereferenced.
A local attacker with low privileges (PR:L) can exploit these vulnerabilities with low attack complexity (AC:L) and no user interaction (UI:N), as indicated by the CVSS v3.1 base score of 7.8 (AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H). Successful exploitation could grant high impacts on confidentiality, integrity, and availability (C:H/I:H/A:H), potentially allowing arbitrary code execution, data corruption, or denial of service through manipulation of the freed memory in the DRBD state notification paths.
The vulnerability is addressed in Linux kernel stable releases via patches that modify the affected notify functions—such as notify_initial_state_done and notify_*_state_change—to return error codes when failures like genlmsg_put() occur. This propagates errors back to get_initial_state, preventing use-after-free by avoiding dereferences of freed skbs. Relevant commits include 0489700bfeb1e53eb2039c2291c67e71b0b40103, 188fe6b26765edbad4055611c0f788b6870f4024, 226e993c39405292781bfcf4b039a8db56aab362, 594205b4936771a250f9d141e7e0fff21c3dd2d9, and a972c768723359ec995579902473028fe3cd64b1, available in kernel.org stable trees.
EU & UK References
- 🇪🇺 ENISA EUVD: EUVD-2022-55119
Vulnerability details
In the Linux kernel, the following vulnerability has been resolved: drbd: Fix five use after free bugs in get_initial_state In get_initial_state, it calls notify_initial_state_done(skb,..) if cb->args[5]==1. If genlmsg_put() failed in notify_initial_state_done(), the skb will be freed by nlmsg_free(skb). Then get_initial_state…
more
will goto out and the freed skb will be used by return value skb->len, which is a uaf bug. What's worse, the same problem goes even further: skb can also be freed in the notify_*_state_change -> notify_*_state calls below. Thus 4 additional uaf bugs happened. My patch lets the problem callee functions: notify_initial_state_done and notify_*_state_change return an error code if errors happen. So that the error codes could be propagated and the uaf bugs can be avoid. v2 reports a compilation warning. This v3 fixed this warning and built successfully in my local environment with no additional warnings. v2: https://lore.kernel.org/patchwork/patch/1435218/
- CWE(s)
Related Threats
MITRE ATT&CK Enterprise TechniquesAI
Why these techniques?
Local kernel UAF in DRBD directly enables exploitation for privilege escalation to achieve arbitrary code execution.
CVEs Like This One
Affected Assets
Mitigating Controls
Mitigating Controls (NIST 800-53 r5) AI
Timely remediation through kernel patches directly eliminates the five use-after-free vulnerabilities in DRBD's get_initial_state function by propagating error codes and avoiding dereferences of freed skbs.
Kernel memory protection mechanisms restrict unauthorized memory access, mitigating exploitation of use-after-free bugs even if unpatched.
Requires appropriate error handling responses to failures like genlmsg_put(), preventing dereference of freed skbs in DRBD state notification paths.