]> git.proxmox.com Git - mirror_ubuntu-kernels.git/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)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 9 Aug 2023 09:37:50 +0000 (11:37 +0200)
commit662e50b49d12f36c159a3df3836d7e7c5dbf1080
tree529cd38a6f156a29c16ca3d9f1c9994b787a81b1
parent63ab0b3e22443135f2fcd782761f94392fb6fc7b
ext4: improve error recovery code paths in __ext4_remount()

BugLink: https://bugs.launchpad.net/bugs/2028580
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
fs/ext4/super.c