diff options
author | Theodore Ts'o <tytso@mit.edu> | 2023-03-18 04:53:52 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-22 15:37:57 +0300 |
commit | 43ce288ab5d7274a4a141d7f5e3ed2ab7b41f8a2 (patch) | |
tree | ce147512283fcac70061cca7fdda39d2f3f06b30 /fs | |
parent | e12b95680821b9880cd9992c0f3555389363604f (diff) | |
download | linux-43ce288ab5d7274a4a141d7f5e3ed2ab7b41f8a2.tar.xz |
ext4: fix possible double unlock when moving a directory
commit 70e42feab2e20618ddd0cbfc4ab4b08628236ecd upstream.
Fixes: 0813299c586b ("ext4: Fix possible corruption when moving a directory")
Link: https://lore.kernel.org/r/5efbe1b9-ad8b-4a4f-b422-24824d2b775c@kili.mountain
Reported-by: Dan Carpenter <error27@gmail.com>
Reported-by: syzbot+0c73d1d8b952c5f3d714@syzkaller.appspotmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/namei.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 7cc3918e2f18..604ee458f31d 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -3884,10 +3884,8 @@ static int ext4_rename(struct user_namespace *mnt_userns, struct inode *old_dir, goto end_rename; } retval = ext4_rename_dir_prepare(handle, &old); - if (retval) { - inode_unlock(old.inode); + if (retval) goto end_rename; - } } /* * If we're renaming a file within an inline_data dir and adding or |