fs: fix UAF/GPF bug in nilfs_mdt_destroy
Published Sep 17, 2025
7.8
HIGHCVSS 3.1
EPSS 0.22%
Description
In alloc_inode, inode_init_always() could return -ENOMEM if security_inode_alloc() fails, which causes inode->i_private uninitialized. Then nilfs_is_metadata_file_inode() returns true and nilfs_free_inode() wrongly calls nilfs_mdt_destroy(), which frees the uninitialized inode->i_private and leads to crashes(e.g., UAF/GPF).
Fix this by moving security_inode_alloc just prior to this_cpu_inc(nr_inodes)
Affected products
-
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version
-
- Version 2.6.12StatusaffectedConstraints-
- Version 0StatusunaffectedConstraints<2.6.12
- Version 4.14.296StatusunaffectedConstraints<=4.14.*
- Version 4.19.262StatusunaffectedConstraints<=4.19.*
- Version 4.9.331StatusunaffectedConstraints<=4.9.*
- Version 5.10.148StatusunaffectedConstraints<=5.10.*
- Version 5.15.73StatusunaffectedConstraints<=5.15.*
- Version 5.19.15StatusunaffectedConstraints<=5.19.*
- Version 5.4.218StatusunaffectedConstraints<=5.4.*
- Version 6.0.1StatusunaffectedConstraints<=6.0.*
- Version 6.1StatusunaffectedConstraints<=*
- Version
Default status is the baseline for the product, each version can override it (e.g. patched versions marked unaffected).
| Vendor | Product | Default status | Versions | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Linux | Linux | unaffected |
| ||||||||||||||||||||||||||||||||||||
| Linux | Linux | affected |
|
- < 4.9.331
- ≥ 4.10 · < 4.14.296
- ≥ 4.15 · < 4.19.262
- ≥ 4.20 · < 5.4.218
- ≥ 5.5 · < 5.10.148
- ≥ 5.11 · < 5.15.73
- ≥ 5.16 · < 5.19.15
- ≥ 6.0 · < 6.0.1
No data.
Red Hat Enterprise Linux 7 Extended Lifecycle Support
kernel-0:3.10.0-1160.144.1.el7
Fixed · RHSA-2025:23947
Red Hat Enterprise Linux 7 Extended Lifecycle Support
kernel-rt-0:3.10.0-1160.144.1.rt56.1296.el7
Fixed · RHSA-2025:23960
Red Hat Enterprise Linux 8
kernel-0:4.18.0-553.83.1.el8_10
Fixed · RHSA-2025:19931
Red Hat Enterprise Linux 8
kernel-rt-0:4.18.0-553.83.1.rt7.424.el8_10
Fixed · RHSA-2025:19932
Red Hat Enterprise Linux 8.2 Advanced Update Support
kernel-0:4.18.0-193.178.1.el8_2
Fixed · RHSA-2025:23445
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support
kernel-0:4.18.0-305.179.1.el8_4
Fixed · RHSA-2025:22752
Red Hat Enterprise Linux 8.4 Extended Update Support Long-Life Add-On
kernel-0:4.18.0-305.179.1.el8_4
Fixed · RHSA-2025:22752
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Support
kernel-0:4.18.0-372.168.1.el8_6
Fixed · RHSA-2025:21084
Red Hat Enterprise Linux 8.6 Telecommunications Update Service
kernel-0:4.18.0-372.168.1.el8_6
Fixed · RHSA-2025:21084
Red Hat Enterprise Linux 8.6 Update Services for SAP Solutions
kernel-0:4.18.0-372.168.1.el8_6
Fixed · RHSA-2025:21084
Red Hat Enterprise Linux 8.8 Telecommunications Update Service
kernel-0:4.18.0-477.118.1.el8_8
Fixed · RHSA-2025:21083
Red Hat Enterprise Linux 8.8 Update Services for SAP Solutions
kernel-0:4.18.0-477.118.1.el8_8
Fixed · RHSA-2025:21083
Red Hat Enterprise Linux 9
kernel-0:5.14.0-570.60.1.el9_6
Fixed · RHSA-2025:19409
Red Hat Enterprise Linux 9
kernel-0:5.14.0-570.60.1.el9_6
Fixed · RHSA-2025:19409
Red Hat Enterprise Linux 9
kernel-0:5.14.0-611.7.1.el9_7
Fixed · RHSA-2025:21112
Red Hat Enterprise Linux 9
kernel-0:5.14.0-611.7.1.el9_7
Fixed · RHSA-2025:21112
Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions
kernel-0:5.14.0-70.153.1.el9_0
Fixed · RHSA-2025:21091
Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions
kernel-rt-0:5.14.0-70.153.1.rt21.225.el9_0
Fixed · RHSA-2025:21136
Red Hat Enterprise Linux 9.2 Update Services for SAP Solutions
kernel-0:5.14.0-284.146.1.el9_2
Fixed · RHSA-2025:21051
Red Hat Enterprise Linux 9.2 Update Services for SAP Solutions
kernel-rt-0:5.14.0-284.146.1.rt14.431.el9_2
Fixed · RHSA-2025:21128
Red Hat Enterprise Linux 9.4 Extended Update Support
kernel-0:5.14.0-427.97.1.el9_4
Fixed · RHSA-2025:19886
Red Hat Enterprise Linux 10
kernel
Not affected
Red Hat Enterprise Linux 6
kernel
Out of support scope
Red Hat Enterprise Linux 9
kernel-rt
Affected
| Product | Package | State | Advisory |
|---|---|---|---|
| Red Hat Enterprise Linux 7 Extended Lifecycle Support | kernel-0:3.10.0-1160.144.1.el7 | Fixed | RHSA-2025:23947 |
| Red Hat Enterprise Linux 7 Extended Lifecycle Support | kernel-rt-0:3.10.0-1160.144.1.rt56.1296.el7 | Fixed | RHSA-2025:23960 |
| Red Hat Enterprise Linux 8 | kernel-0:4.18.0-553.83.1.el8_10 | Fixed | RHSA-2025:19931 |
| Red Hat Enterprise Linux 8 | kernel-rt-0:4.18.0-553.83.1.rt7.424.el8_10 | Fixed | RHSA-2025:19932 |
| Red Hat Enterprise Linux 8.2 Advanced Update Support | kernel-0:4.18.0-193.178.1.el8_2 | Fixed | RHSA-2025:23445 |
| Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support | kernel-0:4.18.0-305.179.1.el8_4 | Fixed | RHSA-2025:22752 |
| Red Hat Enterprise Linux 8.4 Extended Update Support Long-Life Add-On | kernel-0:4.18.0-305.179.1.el8_4 | Fixed | RHSA-2025:22752 |
| Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Support | kernel-0:4.18.0-372.168.1.el8_6 | Fixed | RHSA-2025:21084 |
| Red Hat Enterprise Linux 8.6 Telecommunications Update Service | kernel-0:4.18.0-372.168.1.el8_6 | Fixed | RHSA-2025:21084 |
| Red Hat Enterprise Linux 8.6 Update Services for SAP Solutions | kernel-0:4.18.0-372.168.1.el8_6 | Fixed | RHSA-2025:21084 |
| Red Hat Enterprise Linux 8.8 Telecommunications Update Service | kernel-0:4.18.0-477.118.1.el8_8 | Fixed | RHSA-2025:21083 |
| Red Hat Enterprise Linux 8.8 Update Services for SAP Solutions | kernel-0:4.18.0-477.118.1.el8_8 | Fixed | RHSA-2025:21083 |
| Red Hat Enterprise Linux 9 | kernel-0:5.14.0-570.60.1.el9_6 | Fixed | RHSA-2025:19409 |
| Red Hat Enterprise Linux 9 | kernel-0:5.14.0-570.60.1.el9_6 | Fixed | RHSA-2025:19409 |
| Red Hat Enterprise Linux 9 | kernel-0:5.14.0-611.7.1.el9_7 | Fixed | RHSA-2025:21112 |
| Red Hat Enterprise Linux 9 | kernel-0:5.14.0-611.7.1.el9_7 | Fixed | RHSA-2025:21112 |
| Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions | kernel-0:5.14.0-70.153.1.el9_0 | Fixed | RHSA-2025:21091 |
| Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions | kernel-rt-0:5.14.0-70.153.1.rt21.225.el9_0 | Fixed | RHSA-2025:21136 |
| Red Hat Enterprise Linux 9.2 Update Services for SAP Solutions | kernel-0:5.14.0-284.146.1.el9_2 | Fixed | RHSA-2025:21051 |
| Red Hat Enterprise Linux 9.2 Update Services for SAP Solutions | kernel-rt-0:5.14.0-284.146.1.rt14.431.el9_2 | Fixed | RHSA-2025:21128 |
| Red Hat Enterprise Linux 9.4 Extended Update Support | kernel-0:5.14.0-427.97.1.el9_4 | Fixed | RHSA-2025:19886 |
| Red Hat Enterprise Linux 10 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 6 | kernel | Out of support scope | n/a |
| Red Hat Enterprise Linux 9 | kernel-rt | Affected | n/a |
No package ranges for this CVE.
Remediation
Red Hat statement
This patch fixes a use-after-free/GPF bug in the NILFS2 metadata handling. When security_inode_alloc() failed, an uninitialized inode->i_private pointer could later be freed by nilfs_mdt_destroy(), leading to memory corruption or crashes. You can reproduce this issue on systems using NILFS, because the crash path involves nilfs_mdt_destroy() freeing inode->i_private when security_inode_alloc() fails. On other filesystems the same cleanup path does not run, so accidental freeing of that uninitialized field is far less likely. Consequently, systems not using NILFS are at much lower risk unless they have other code that similarly frees inode->i_private. For the all versions of the Red Hat Enterprise Linux the config param CONFIG_NILFS2_FS disabled, so with the known scenario of attack it is not affected.
Red Hat mitigation
Mitigation for this issue is either not available or the currently available options don't meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.
References (14)
- https://access.redhat.com/security/cve/CVE-2022-50367 Vendor Advisory
- https://bugzilla.redhat.com/show_bug.cgi?id=2396114 Issue Tracking
- https://git.kernel.org/stable/c/1e555c3ed1fce4b278aaebe18a64a934cece57d8 Patch
- https://git.kernel.org/stable/c/2a96b532098284ecf8e4849b8b9e5fc7a28bdee9 Patch
- https://git.kernel.org/stable/c/2e488f13755ffbb60f307e991b27024716a33b29 Patch
- https://git.kernel.org/stable/c/64b79e632869ad3ef6c098a4731d559381da1115 Patch
- https://git.kernel.org/stable/c/70e4f70d54e0225f91814e8610477d65f33cefe4 Patch
- https://git.kernel.org/stable/c/81de80330fa6907aec32eb54c5619059e6e36452 Patch
- https://git.kernel.org/stable/c/c0aa76b0f17f59dd9c9d3463550a2986a1d592e4 Patch
- https://git.kernel.org/stable/c/d1ff475d7c83289d0a7faef346ea3bbf90818bad Patch
- https://git.kernel.org/stable/c/ec2aab115eb38ac4992ea2fcc2a02fbe7af5cf48 Patch
- https://lore.kernel.org/linux-cve-announce/2025091716-CVE-2022-50367-651c@gregkh/T
- https://nvd.nist.gov/vuln/detail/CVE-2022-50367
- https://www.cve.org/CVERecord?id=CVE-2022-50367
Change history (0)
No recorded changes yet.