CVE-2022-49085

Source
https://cve.org/CVERecord?id=CVE-2022-49085
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49085.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-49085
Downstream
Related
Published
2025-02-26T01:54:43.579Z
Modified
2026-03-12T03:24:40.685714Z
Severity
  • 7.8 (High) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
drbd: Fix five use after free bugs in get_initial_state
Details

In the Linux kernel, the following vulnerability has been resolved:

drbd: Fix five use after free bugs in getinitialstate

In getinitialstate, it calls notifyinitialstatedone(skb,..) if cb->args[5]==1. If genlmsgput() failed in notifyinitialstatedone(), the skb will be freed by nlmsgfree(skb). Then getinitialstate 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_*statechange -> notify_*_state calls below. Thus 4 additional uaf bugs happened.

My patch lets the problem callee functions: notifyinitialstatedone and notify*statechange 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/

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49085.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
a29728463b254ce81ecefdf20c1a02e01d9361da
Fixed
0489700bfeb1e53eb2039c2291c67e71b0b40103
Fixed
dcf6be17b5c53b741898d2223b23e66d682de300
Fixed
188fe6b26765edbad4055611c0f788b6870f4024
Fixed
b6a4055036eed1f5e239ce3d8b0db1ce38bba447
Fixed
594205b4936771a250f9d141e7e0fff21c3dd2d9
Fixed
a972c768723359ec995579902473028fe3cd64b1
Fixed
de63e74da2333b4068bb79983e632db730fea97e
Fixed
226e993c39405292781bfcf4b039a8db56aab362
Fixed
aadb22ba2f656581b2f733deb3a467c48cc618f6

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49085.json"