SecurityContext

CVE-2025-22126: Linux Kernel - Use After Free

  • Cve: CVE-2025-22126
  • Name: Linux Kernel - Use After Free
  • Description: In the Linux kernel, the following vulnerability has been resolved: md: fix mddev uaf while iterating all_mddevs list While iterating all_mddevs list from md_notify_reboot() and md_exit(), list_for_each_entry_safe is used, and this can race with deletint the next mddev, causing UAF: t1: spin_lock //list_for_each_entry_safe(mddev, n, ...) mddev_get(mddev1) // assume mddev2 is the next entry spin_unlock t2: //remove mddev2 ... mddev_free spin_lock list_del spin_unlock kfree(mddev2) mddev_put(mddev1) spin_lock //continue dereference mddev2->all_mddevs The old helper for_each_mddev() actually grab the reference of mddev2 while holding the lock, to prevent from being freed. This problem can be fixed the same way, however, the code will be complex. Hence switch to use list_for_each_entry, in this case mddev_put() can free the mddev1 and it's not safe as well. Refer to md_seq_show(), also factor out a helper mddev_put_locked() to fix this problem.
  • Impact: Potential use-after-free leading to kernel panic, privilege escalation, or arbitrary code execution.
  • Remediation: Apply the patch that switches to list_for_each_entry and uses mddev_put_locked() to prevent use-after-free issues.
  • Vulnerability type: use_after_free
  • Vulnerability impact: privilege_escalation, remote_code_execution
  • Requirements: Exploit requires concurrent list modification causing race condition.
  • Labels source: projectdiscovery
  • Severity: high
  • Cvss score: 7.8
  • Cvss vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Epss score: 0.00201
  • Epss percentile: 0.09882
  • Assignee: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
  • Published at: 2025-04-16T15:16:06Z
  • Age in days: 587
  • Modified at: 2026-06-17T08:45:12Z
  • Patch available: yes
  • References total: 6
  • Products total: 1
  • Oss: yes
  • Projects total: 1
  • Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2025-22126
  • Nvd status: modified
  • Checked, none or zero: known exploited entries, nuclei templates, public exploits total, public exploits capped, public exploits, rejected by nvd
  • Not known: requirement type, hackerone

Cwe

IdName
CWE-416Use After Free

References

Same in every row:

  • Source: nvd
UrlTags
https://git.kernel.org/stable/c/5462544ccbad3fc938a71b01fa5bd3a0dc2b750aPatch
https://git.kernel.org/stable/c/8542870237c3a48ff049b6c5df5f50c8728284faPatch
https://git.kernel.org/stable/c/ca9f84de76723b358dfc0606668efdca54afc2e5Patch
https://git.kernel.org/stable/c/d69a23d8e925f8052d657652a6875ec2712c7e33Patch
https://git.kernel.org/stable/c/e2a9f73ee408a460f4c9dfe03b4741d6b11652b8Patch
https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html

Products

ProductAffectedPlatform boundSourcesUrl
linux:linux_kernel>= 6.13, < 6.14.2; >= 6.7, < 6.12.25; >= 6.2, < 6.6.88; >= 6.0, < 6.1.135nonvd/v1/products/linux/linux_kernel

Projects

RepositoryLink kindsIndexedUrl
torvalds/linuxcna_commit, commityes/v1/repositories/torvalds/linux

Index

  • Checked, none or zero: repositories, repositories high signal, packages

Exploitation

  • Authentication required: yes
  • Exposed hosts: 10038339
  • Checked, none or zero: known exploited, known exploited by, exploitation seen, public exploit, public exploit count, initial access, remote
  • Not known: known exploited since, vulncheck known exploited since, public exploit first date, nuclei template, initial access since, hackerone reports