From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 133D4C7618D for ; Mon, 20 Mar 2023 15:13:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232439AbjCTPNV (ORCPT ); Mon, 20 Mar 2023 11:13:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232267AbjCTPMz (ORCPT ); Mon, 20 Mar 2023 11:12:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0A2A2FCE7 for ; Mon, 20 Mar 2023 08:07:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CCA3261570 for ; Mon, 20 Mar 2023 15:07:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D844DC4339E; Mon, 20 Mar 2023 15:07:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1679324876; bh=vj++Liol3/oZfKQWh0cXp5p+3jLKcjVYlNdjmUJ2olM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ma1rj6fDGpGnB+4eLfhiIWKKbxAy3koxtPlyklVgxc0Bd3DNmocsJSSxqW9wF2HWJ euwPqFYV7yK5ZkkmHxIvhFSnJvsWMRSj+ckTGaOHcVJoQfO+t7gNWAjUqGh65oShrN qnS+42chCCM7xTxf/IDW/OWBS5qY39rjA91vVP+E= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dan Carpenter , syzbot+0c73d1d8b952c5f3d714@syzkaller.appspotmail.com, Theodore Tso Subject: [PATCH 5.10 56/99] ext4: fix possible double unlock when moving a directory Date: Mon, 20 Mar 2023 15:54:34 +0100 Message-Id: <20230320145445.733339697@linuxfoundation.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230320145443.333824603@linuxfoundation.org> References: <20230320145443.333824603@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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 @@ -3934,10 +3934,8 @@ static int ext4_rename(struct inode *old 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