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 2213D2210DA; Thu, 12 Dec 2024 15:39:25 +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=1734017965; cv=none; b=D6XOuhI9yOWos4G4Ostx26/bLkugv/Y0cREVljzM4rJXWJFOizd5SG9LnpDI+i/FnpKgQkiVuZ8hY6jcJn/ljcRxVJy4furIjO65DUBmvnJ2YQf5KbhXOY6KsZ1GMzYtyic1f1JIVCJhSwFbKfQypYk5VE3fkWORcKati3FwFGg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734017965; c=relaxed/simple; bh=ex33IXlBmEN1ay6BL9UppMK7TPnXpWLz2F6e9nHJiyA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XYTqrXsvhATNHwFRzXJSXj/97yvycMvHfngFRhUnwre8fM52+lhR/HKhFbciB9txYiOoFeczyDTGXdnbayppo0/2HBLkcBA6ynqJ6hWYWNFr2DEax/mJfNF+AsEBEIwVsOuPdM2n4PXRfNlF2H3L6qfOmte/dsDB681A7Uky/3Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=q+EkrFqi; 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="q+EkrFqi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53B3CC4CECE; Thu, 12 Dec 2024 15:39:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1734017965; bh=ex33IXlBmEN1ay6BL9UppMK7TPnXpWLz2F6e9nHJiyA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q+EkrFqiz2GesyFIK8gIoVziG/zlvYBQSHcFes1Figz8/xkGljMj5olpsi6jJY5oY N/O93hucK3Jdtbc+3mxqGkXNGhEuXUWxYdPZbFwswWfTXGamcP0GUA9WywSPwOK6ob cowYRxxbQmxJJaWgne0NPFacefq/hdPB12NWbJnc= 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 6.6 130/356] ocfs2: free inode when ocfs2_get_init_inode() fails Date: Thu, 12 Dec 2024 15:57:29 +0100 Message-ID: <20241212144249.788559708@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241212144244.601729511@linuxfoundation.org> References: <20241212144244.601729511@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 6.6-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 21b3d5b9be603..4e6d8a3f727df 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c @@ -200,8 +200,10 @@ static struct inode *ocfs2_get_init_inode(struct inode *dir, umode_t mode) mode = mode_strip_sgid(&nop_mnt_idmap, dir, mode); inode_init_owner(&nop_mnt_idmap, inode, dir, mode); status = dquot_initialize(inode); - if (status) + if (status) { + iput(inode); return ERR_PTR(status); + } return inode; } -- 2.43.0