CVE-2022-50377: ext4: check and assert if marking an no_delete evicting inode dirty
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
ext4: check and assert if marking an no_delete evicting inode dirty
In ext4_evict_inode(), if we evicting an inode in the 'no_delete' path, it cannot be raced by another mark_inode_dirty(). If it happens, someone else may accidentally dirty it without holding inode refcount and probably cause use-after-free issues in the writeback procedure. It's indiscoverable and hard to debug, so add an WARN_ON_ONCE() to check and detect this issue in advance.
The Linux kernel CVE team has assigned CVE-2022-50377 to this issue.
Affected and fixed versions
===========================
Fixed in 5.10.163 with commit 9020f56a3cad1c97b81c7dab2aa67027b59c8f73 Fixed in 5.15.87 with commit 91009e361e8cb2cbd1dc9496cb5fb4f8de3f4b11 Fixed in 6.0.18 with commit 0c026f975d24701766cf4ac63995ead9f6d57a59 Fixed in 6.1.4 with commit f1ec687ebd1bf146333955b7e209d21508c3ba9f Fixed in 6.2 with commit 318cdc822c63b6e2befcfdc2088378ae6fa18def
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2022-50377
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
fs/ext4/inode.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/9020f56a3cad1c97b81c7dab2aa67027b59c8f73 https://git.kernel.org/stable/c/91009e361e8cb2cbd1dc9496cb5fb4f8de3f4b11 https://git.kernel.org/stable/c/0c026f975d24701766cf4ac63995ead9f6d57a59 https://git.kernel.org/stable/c/f1ec687ebd1bf146333955b7e209d21508c3ba9f https://git.kernel.org/stable/c/318cdc822c63b6e2befcfdc2088378ae6fa18def