Bug 2120664 (CVE-2022-2978) - CVE-2022-2978 kernel: use-after-free in nilfs_mdt_destroy
Summary: CVE-2022-2978 kernel: use-after-free in nilfs_mdt_destroy
Alias: CVE-2022-2978
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
Depends On: 2121049 2121052 2121054
Blocks: 2119315
TreeView+ depends on / blocked
Reported: 2022-08-23 13:51 UTC by Alex
Modified: 2022-11-30 22:28 UTC (History)
54 users (show)

Fixed In Version: Linux kernel 6.0-rc3
Doc Type: If docs needed, set a value
Doc Text:
A use-after-free flaw was found in the Linux kernel’s NILFS file system in the way a user triggers the security_inode_alloc function to fail with the following call to the nilfs_mdt_destroy function. This flaw allows a local user to crash or potentially escalate their privileges on the system.
Clone Of:
Last Closed: 2022-11-27 12:56:15 UTC

Attachments (Terms of Use)

Description Alex 2022-08-23 13:51:19 UTC
A flaw use after free in the Linux Kernel found in fs/inode.c.
If security_inode_alloc fails, then in alloc_inode the inode_init_always could return -NOMEM.
In its error handling, i_callback and nilfs_free_inode will be called.
However, because inode->i_private is not initialized due to the failure of security_inode_alloc, the function nilfs_is_metadata_file_inode can return true and nilfs_free_inode() wrongly calls nilfs_mdt_destroy(), which frees the uninitialized inode->i_private and leads to crash.


Comment 2 Alex 2022-08-24 10:45:08 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 2121049]

Comment 9 Rohit Keshri 2022-09-16 05:19:40 UTC
There was no shipped kernel version that was seen affected by this problem. These files are not built in our source code.

Comment 11 Product Security DevOps Team 2022-11-27 12:56:10 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):


Comment 12 Justin M. Forbes 2022-11-30 22:28:12 UTC
This was fixed for Fedora with the 6.0 stable kernel rebases.

Note You need to log in before you can comment on or make changes to this bug.