CVE-2025-21887: ovl: fix UAF in ovl_dentry_update_reval by moving dput() in ovl_link_up

Published Mar 27, 2025
·
Updated

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

ovl: fix UAF in ovldentryupdatereval by moving dput() in ovllinkup

The issue was caused by dput(upper) being called before ovldentryupdatereval(), while upper->dflags was still accessed in ovldentryremote().

Move dput(upper) after its last use to prevent use-after-free.

BUG: KASAN: slab-use-after-free in ovldentryremote fs/overlayfs/util.c:162 [inline] BUG: KASAN: slab-use-after-free in ovldentryupdatereval+0xd2/0xf0 fs/overlayfs/util.c:167

Call Trace: <TASK> dumpstack lib/dumpstack.c:88 [inline] dumpstacklvl+0x116/0x1f0 lib/dumpstack.c:114 printaddressdescription mm/kasan/report.c:377 [inline] printreport+0xc3/0x620 mm/kasan/report.c:488 kasanreport+0xd9/0x110 mm/kasan/report.c:601 ovldentryremote fs/overlayfs/util.c:162 [inline] ovldentryupdatereval+0xd2/0xf0 fs/overlayfs/util.c:167 ovllinkup fs/overlayfs/copyup.c:610 [inline] ovlcopyupone+0x2105/0x3490 fs/overlayfs/copyup.c:1170 ovlcopyupflags+0x18d/0x200 fs/overlayfs/copyup.c:1223 ovlrename+0x39e/0x18c0 fs/overlayfs/dir.c:1136 vfsrename+0xf84/0x20a0 fs/namei.c:4893 ... </TASK>

Affected Software

16 affected componentsFixes available
Linux Kernel
Linux Linux kernel>=5.10.188<5.11
Linux Linux kernel>=5.15.121<5.15.179
Linux Linux kernel>=6.1.39<6.1.130
Linux Linux kernel>=6.3.13<6.4
Linux Linux kernel>=6.4.4<6.6.81
Linux Linux kernel>=6.7<6.12.18
Linux Linux kernel>=6.13<6.13.6
Linux Linux kernel=6.14-rc1
Linux Linux kernel=6.14-rc2
Linux Linux kernel=6.14-rc3
Linux Linux kernel=6.14-rc4
Microsoft azl3 kernel 6.6.82.1-1<6.6.82.1-1
6.6.82.1-1
Microsoft cbl2 kernel 5.15.180.1-1<5.15.180.1-1
5.15.180.1-1
Microsoft azl3 kernel 6.6.78.1-3<6.6.82.1-1
6.6.82.1-1
Microsoft cbl2 kernel 5.15.176.3-3<5.15.180.1-1
5.15.180.1-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 6.6.82.1-1
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 5.15.180.1-1

Event History

Mar 27, 2025
CVE Published
via MITRE·02:57 PM
Data Sourced
via MITRE·02:57 PM
DescriptionSeverity
Data Sourced
via NVD·03:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via Red Hat·04:01 PM
DescriptionSeverityAffected Software
Apr 9, 2025
Data Sourced
via Microsoft·07:00 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·07:00 AM
Affected Software
Updated
via Microsoft·07:00 AM
Affected Software
Updated
via Microsoft·07:00 AM
SeverityAffected Software
Updated
via Microsoft·07:00 AM
DescriptionSeverity

Frequently Asked Questions

1

What is the severity of CVE-2025-21887?

CVE-2025-21887 has been rated with a medium severity level due to the potential for user-after-free vulnerabilities.

2

How do I fix CVE-2025-21887?

To fix CVE-2025-21887, update your Linux kernel to the latest version where the vulnerability has been patched.

3

Which systems are affected by CVE-2025-21887?

CVE-2025-21887 affects the Linux kernel, specifically the components dealing with overlay filesystems.

4

What are the potential consequences of CVE-2025-21887?

The potential consequences of CVE-2025-21887 include denial of service and exploitation through crafted filesystem operations.

5

When was CVE-2025-21887 disclosed?

CVE-2025-21887 was disclosed in early 2025 as part of the ongoing security assessment of the Linux kernel.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203