CVE-2022-50845
Description
In the Linux kernel, the following vulnerability has been resolved:
ext4: fix inode leak in ext4_xattr_inode_create() on an error path
There is issue as follows when do setxattr with inject fault:
[localhost]# fsck.ext4 -fn /dev/sda e2fsck 1.46.6-rc1 (12-Sep-2022) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Unattached zero-length inode 15. Clear? no
Unattached inode 15 Connect to /lost+found? no
Pass 5: Checking group summary information
/dev/sda: ******** WARNING: Filesystem still has errors ********
/dev/sda: 15/655360 files (0.0% non-contiguous), 66755/2621440 blocks
This occurs in 'ext4_xattr_inode_create()'. If 'ext4_mark_inode_dirty()' fails, dropping i_nlink of the inode is needed. Or will lead to inode leak.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A missing inode cleanup in ext4_xattr_inode_create() can cause an inode leak when ext4 leak when ext4_mark_inode_dirty() fails.
Vulnerability
Description
In the Linux kernel's ext4 filesystem, the function ext4_xattr_inode_create() is responsible for creating an inode to store extended attributes (xattrs). An error path in this function fails to properly decrement the inode's link count (i_nlink) when ext4_mark_inode_dirty() returns a failure. This oversight leads to an inode leak, where the newly allocated inode remains referenced but is not attached to any directory, resulting in an "unattached zero-length inode" as reported by fsck.ext4 [1].
Exploitation
An attacker with the ability to trigger extended attribute operations (e.g., via setxattr syscall) on an ext4 filesystem could intentionally cause the error condition by injecting faults or exhausting resources, causing ext4_mark_inode_dirty() to fail. No special privileges beyond the ability to set extended attributes on-disk extended attributes are required; the attack surface is local, requiring access to the filesystem. The vulnerability manifests during the creation of an xattr inode, and the resulting inode leak persists across reboots until the filesystem is checked and repaired [1].
Impact
Each successful exploitation leaks one inode from the filesystem's inode table. Over time, repeated exploitation could exhaust the available inode pool, potentially leading to denial of service (DoS) conditions where new files or directories cannot be created. The leaked inode is zero-length and unattached, consuming an inode number without providing any storage. The filesystem will report errors during consistency checks (e.g., fsck) and may require manual intervention to clear the orphaned inode [1].
Mitigation
The fix has been applied to the Linux kernel stable tree. The commit 9ef603086c5b (and backports) ensures that when ext4_mark_inode_dirty() fails, the inode's link count is decremented via iput() or similar cleanup, preventing the leak [1]. Users should apply the latest stable kernel updates that include this patch. No workaround exists other than avoiding the error path entirely; the only mitigation is to patch the kernel.
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
2Patches
80f709e08caffeab94a46560f9ef603086c5b9882601ee689322cf639b0b7fdaaf45786dc70e5b46beba6e4db04f7d3dbVulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- git.kernel.org/stable/c/0f709e08caffb41bbc9b38b9a4c1bd0769794007nvd
- git.kernel.org/stable/c/322cf639b0b7f137543072c55545adab782b3a25nvd
- git.kernel.org/stable/c/70e5b46beba64706430a87a6d516054225e8ac8anvd
- git.kernel.org/stable/c/9882601ee689975c1c0076ee65bf222a2a35e535nvd
- git.kernel.org/stable/c/9ef603086c5b796fde1c7f22a17d0fc826ba54cbnvd
- git.kernel.org/stable/c/e4db04f7d3dbbe16680e0ded27ea2a65b10f766anvd
- git.kernel.org/stable/c/eab94a46560f68d4bcd15222701ced479f84f427nvd
- git.kernel.org/stable/c/fdaaf45786dc8c17a72901021772520fceb18f8cnvd
News mentions
0No linked articles in our index yet.