From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94781213E6F; Thu, 12 Dec 2024 17:30:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734024619; cv=none; b=PVMek7MVmoKYdZQEldenAVggITr+ht9uy/9RVQfLhIdAZ35R8BiNJpexCLmdsPQHP6/EMLuYYzNV+rlTNE0I9FtWiEmspkSGdfNpG0OTdZ4zMTUxL5dW6+RGUAhZhYI5ed3yALbulmA9QeOmY5lP1yphJTv5sgX+pRdbZXlwxNo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734024619; c=relaxed/simple; bh=VF6L01kejav4lpNjaRnXCzBxq1sdChALZ07zx5FhOXw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bBpVMkdVlQFoibWxGPVTsPoRFuzU2Gc3scbczuHQqYNwh4ike2/pnttSQzycwrRrU7Nb9PzY6ChcopD3Jrlfhak84TFsVexAnzUzvW2G8A3muvc2Yb6vsmnU3DKhlHwu5qc5YHVuBoLbfGXq4YjsM/XhWALtPmBY9u/BLRfg+dg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2sF+5vzi; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="2sF+5vzi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89859C4CECE; Thu, 12 Dec 2024 17:30:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1734024617; bh=VF6L01kejav4lpNjaRnXCzBxq1sdChALZ07zx5FhOXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2sF+5vzimF2PSnVKBImU6SJS6F0+ZlCu26Y1OabM3W3dbwBJRrgX/ZzdptXvhOejt m3OFrKzcTfxYrGrJurLjcy1nIITuEZbPxlZ9HpecSSNwSUxdvTUjSMCHgQAp9+FkRe rxrrJLzvbmAAtSdSkeIqx/CJxG0my81wuJkDyIqw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tetsuo Handa , syzbot+0af00f6a2cba2058b5db@syzkaller.appspotmail.com, Joseph Qi , Mark Fasheh , Joel Becker , Junxiao Bi , Changwei Ge , Jun Piao , Andrew Morton , Sasha Levin Subject: [PATCH 5.10 356/459] ocfs2: free inode when ocfs2_get_init_inode() fails Date: Thu, 12 Dec 2024 16:01:34 +0100 Message-ID: <20241212144307.728989602@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241212144253.511169641@linuxfoundation.org> References: <20241212144253.511169641@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tetsuo Handa [ Upstream commit 965b5dd1894f4525f38c1b5f99b0106a07dbb5db ] syzbot is reporting busy inodes after unmount, for commit 9c89fe0af826 ("ocfs2: Handle error from dquot_initialize()") forgot to call iput() when new_inode() succeeded and dquot_initialize() failed. Link: https://lkml.kernel.org/r/e68c0224-b7c6-4784-b4fa-a9fc8c675525@I-love.SAKURA.ne.jp Fixes: 9c89fe0af826 ("ocfs2: Handle error from dquot_initialize()") Signed-off-by: Tetsuo Handa Reported-by: syzbot+0af00f6a2cba2058b5db@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=0af00f6a2cba2058b5db Tested-by: syzbot+0af00f6a2cba2058b5db@syzkaller.appspotmail.com Reviewed-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Jun Piao Signed-off-by: Andrew Morton Signed-off-by: Sasha Levin --- fs/ocfs2/namei.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 7bdda635ca80e..0e0f844dcf7f4 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c @@ -201,8 +201,10 @@ static struct inode *ocfs2_get_init_inode(struct inode *dir, umode_t mode) mode = mode_strip_sgid(dir, mode); inode_init_owner(inode, dir, mode); status = dquot_initialize(inode); - if (status) + if (status) { + iput(inode); return ERR_PTR(status); + } return inode; } -- 2.43.0