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 62A843B95E7 for ; Mon, 13 Apr 2026 15:20:02 +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=1776093602; cv=none; b=jleqesooaxK4kNcoHd1yQFbSTwOiZc69LHvlvQbDCCBE3n1sAgh6fJXyHek0uVSi6JUSwcPGKP6f8btJ9jPdp2sMbVgkP8m98rpkaYo4nCCRTpIXRc1ELvL4PATsLQrWtGzxTPt0tojSUXhtSwNjGuL0yqohUH69JaVMcKzcTFs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776093602; c=relaxed/simple; bh=rjqSedGXaKCsBQr75beZDceStxxCcQwDF6SMh0KJL8A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HyWH+O/ok31+4E+WQ2Vg7plLhDfJXAuskjeH9FV92JuLtHf6fXhhwfN4BxpYrqdQbwyEfAstP23ehddfMVFVLO9CAhkR0pwLT+xwI+CmeJDWvgddpT9VeZ3lAiRPqWCipohq1Y9qAD1H4deH96BmUljwJ+S3dyRevSleLvZokQg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rGkW1yJz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rGkW1yJz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2B18C2BCB7; Mon, 13 Apr 2026 15:20:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776093601; bh=rjqSedGXaKCsBQr75beZDceStxxCcQwDF6SMh0KJL8A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rGkW1yJzW8jwtI6KG0ak0IDNIv5pD9tHfA4g+TP30j3xBLc7SSo9Gp/v+C7Qphc7A EQZwXpz3cQQt04B5gGcOgMNwSW4CaFpoNGnjtW0lQ44CSA+5/k1wQWDBgLy6ThVgj5 AolbPMpAOLPnIXY3xcalPQH71cX5LscLstTu2+CdCovA/1tA2a9QCC2J/1XhwqGnXo 1d1ADvEVcf5dGpcp0X3XQeG6p2noQBQrWXx0p67XC2Sx9mivos+FUBs1fUGfIvjkDM UwQDk+hLMf99aBwgQd1Jq/rDI/E2Q2Iba2GvAmvdrD9HL7B15cvNTvW1yQ9STcHxdC 7kXHLirN9941g== From: Sasha Levin To: stable@vger.kernel.org Cc: Dmitry Antipov , syzbot+c16daba279a1161acfb0@syzkaller.appspotmail.com, Joseph Qi , Joseph Qi , Mark Fasheh , Joel Becker , Junxiao Bi , Changwei Ge , Jun Piao , Heming Zhao , Andrew Morton , Sasha Levin Subject: [PATCH 6.18.y 1/3] ocfs2: add inline inode consistency check to ocfs2_validate_inode_block() Date: Mon, 13 Apr 2026 11:19:56 -0400 Message-ID: <20260413151958.3014725-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026041350-tableware-passover-f18e@gregkh> References: <2026041350-tableware-passover-f18e@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Dmitry Antipov [ Upstream commit a2b1c419ff72ec62ff5831684e30cd1d4f0b09ee ] In 'ocfs2_validate_inode_block()', add an extra check whether an inode with inline data (i.e. self-contained) has no clusters, thus preventing an invalid inode from being passed to 'ocfs2_evict_inode()' and below. Link: https://lkml.kernel.org/r/20251023141650.417129-1-dmantipov@yandex.ru Signed-off-by: Dmitry Antipov Reported-by: syzbot+c16daba279a1161acfb0@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=c16daba279a1161acfb0 Reviewed-by: Joseph Qi Cc: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Jun Piao Cc: Heming Zhao Signed-off-by: Andrew Morton Stable-dep-of: 7bc5da4842be ("ocfs2: fix out-of-bounds write in ocfs2_write_end_inline") Signed-off-by: Sasha Levin --- fs/ocfs2/inode.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index 0a0a96054bfec..ef17f1bc741ef 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c @@ -1505,6 +1505,14 @@ int ocfs2_validate_inode_block(struct super_block *sb, goto bail; } + if ((le16_to_cpu(di->i_dyn_features) & OCFS2_INLINE_DATA_FL) && + le32_to_cpu(di->i_clusters)) { + rc = ocfs2_error(sb, "Invalid dinode %llu: %u clusters\n", + (unsigned long long)bh->b_blocknr, + le32_to_cpu(di->i_clusters)); + goto bail; + } + rc = 0; bail: -- 2.53.0