]> git.itanic.dy.fi Git - linux-stable/commit
ext4: Fix possible corruption when moving a directory
authorJan Kara <jack@suse.cz>
Thu, 26 Jan 2023 11:22:21 +0000 (12:22 +0100)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 25 Feb 2023 20:39:07 +0000 (15:39 -0500)
commit0813299c586b175d7edb25f56412c54b812d0379
tree4f93755d40686123b5c038424c7fd8e8e8c1064f
parent172e344e6f82dc266cb65a69f4bed03428ea8a05
ext4: Fix possible corruption when moving a directory

When we are renaming a directory to a different directory, we need to
update '..' entry in the moved directory. However nothing prevents moved
directory from being modified and even converted from the inline format
to the normal format. When such race happens the rename code gets
confused and we crash. Fix the problem by locking the moved directory.

CC: stable@vger.kernel.org
Fixes: 32f7f22c0b52 ("ext4: let ext4_rename handle inline dir")
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230126112221.11866-1-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/namei.c