]> git.itanic.dy.fi Git - linux-stable/commit
ext4: improve error recovery code paths in __ext4_remount()
authorTheodore Ts'o <tytso@mit.edu>
Sat, 6 May 2023 02:20:29 +0000 (22:20 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 12:02:06 +0000 (14:02 +0200)
commit536ecbd569cb99b2e8a4422c43926590c7893aef
tree836ab75c97f8ba6a62c1b6ec08ac27cdc7bd8959
parent118e484989b9f1fb5e2b0c6bf57cb5b28b99add5
ext4: improve error recovery code paths in __ext4_remount()

commit 4c0b4818b1f636bc96359f7817a2d8bab6370162 upstream.

If there are failures while changing the mount options in
__ext4_remount(), we need to restore the old mount options.

This commit fixes two problem.  The first is there is a chance that we
will free the old quota file names before a potential failure leading
to a use-after-free.  The second problem addressed in this commit is
if there is a failed read/write to read-only transition, if the quota
has already been suspended, we need to renable quota handling.

Cc: stable@kernel.org
Link: https://lore.kernel.org/r/20230506142419.984260-2-tytso@mit.edu
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/super.c