From 2025d41e22c37801644a9c660ef10cae2aae7259 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 20 Mar 2023 09:49:37 +0100 Subject: [PATCH] 6.1-stable patches added patches: ext4-fix-possible-double-unlock-when-moving-a-directory.patch --- ...ouble-unlock-when-moving-a-directory.patch | 33 +++++++++++++++++++ queue-6.1/series | 1 + 2 files changed, 34 insertions(+) create mode 100644 queue-6.1/ext4-fix-possible-double-unlock-when-moving-a-directory.patch diff --git a/queue-6.1/ext4-fix-possible-double-unlock-when-moving-a-directory.patch b/queue-6.1/ext4-fix-possible-double-unlock-when-moving-a-directory.patch new file mode 100644 index 00000000000..3c02a5d8f55 --- /dev/null +++ b/queue-6.1/ext4-fix-possible-double-unlock-when-moving-a-directory.patch @@ -0,0 +1,33 @@ +From 70e42feab2e20618ddd0cbfc4ab4b08628236ecd Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Fri, 17 Mar 2023 21:53:52 -0400 +Subject: ext4: fix possible double unlock when moving a directory + +From: Theodore Ts'o + +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 +Reported-by: syzbot+0c73d1d8b952c5f3d714@syzkaller.appspotmail.com +Signed-off-by: Theodore Ts'o +Signed-off-by: Greg Kroah-Hartman +--- + fs/ext4/namei.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +--- a/fs/ext4/namei.c ++++ b/fs/ext4/namei.c +@@ -3884,10 +3884,8 @@ static int ext4_rename(struct user_names + 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 diff --git a/queue-6.1/series b/queue-6.1/series index b9ac2e3c40c..a76db3935d2 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -113,3 +113,4 @@ loongarch-only-call-get_timer_irq-once-in-constant_c.patch sh-intc-avoid-spurious-sizeof-pointer-div-warning.patch drm-amdgpu-fix-ttm_bo-calltrace-warning-in-psp_hw_fi.patch drm-amd-display-fix-shift-out-of-bounds-in-calculate.patch +ext4-fix-possible-double-unlock-when-moving-a-directory.patch -- 2.47.3