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 5AC5B280CD2; Mon, 20 Apr 2026 16:04:45 +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=1776701085; cv=none; b=KxkSgvph37RzFaiu47bkrDsVHkcmCdAhYey3IAocOefBbl7W6sxTVW7RixjtqXvaOBfwMLosE/AK/2n0pXVD2uffpB0v5SknVbbfz8iecSyeAx5Zjp0stQdti3ciZ1cmWTgjhPUJSO1l7DEiF0H6WodZjojZzUasDFeXt4ZJK3c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776701085; c=relaxed/simple; bh=H0k+KnFlQy5tgYlBFg/eLlTGq1ZsukSiboRgPLcwH0Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T9hN33OF1VDHMaI7fg/A6wpPAPkE5pu509+Ls2eKb9cBRJ2zN8XRuRZMXE3/btUSLYEprAfmXKm4BrgBQ0gV9UopZmwNBI/op6xFmFVgOtSR9/I1lEzU6ny5Rt9yVRODWNNCXFfWYs9cj5qwpYb1POIJqjYHLhgq12HFPj2jU/4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=YgN5sFib; 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="YgN5sFib" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86EBBC19425; Mon, 20 Apr 2026 16:04:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776701085; bh=H0k+KnFlQy5tgYlBFg/eLlTGq1ZsukSiboRgPLcwH0Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YgN5sFibf1vxcwXXQJGlWe8oV/TSFxmUS+3jsr+EhQtfnPXHjzRZa5OWnB2h3F13d kKLvEreP7D27liNaVMWjanxy5+EPUA5q2YWpmxhxwpV3w4HPxsvZIidfKukkVcTt37 oLtZLiZX96HJvhXPEjvGUMuw5sptw1lJotx2uesc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, 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 174/198] ocfs2: add inline inode consistency check to ocfs2_validate_inode_block() Date: Mon, 20 Apr 2026 17:42:33 +0200 Message-ID: <20260420153941.879142829@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260420153935.605963767@linuxfoundation.org> References: <20260420153935.605963767@linuxfoundation.org> User-Agent: quilt/0.69 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.18-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- fs/ocfs2/inode.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c @@ -1505,6 +1505,14 @@ int ocfs2_validate_inode_block(struct su 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: