From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 C42EC217704; Sat, 30 May 2026 18:25:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780165520; cv=none; b=Ys/7NuXoy+410672KUZqMXMoHtL6J25IXwQB67iHKQxdgdPAdSiJwHcDjwGkyAf5Jniuqep+NeeC5YoaP1Hzz8vjakU+SCooDj5r8E2KkmlF0UEfDabSqzp4QOAyNcCA250iu8K6ZboK5GctVlOt3ZOpmJE/PF3jCVo3dDQrXEI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780165520; c=relaxed/simple; bh=jrfx24vcy2bxl72x/YYkslksLu5hIWYgFluydn5Vz+k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cdwRk9jlieGSKc7URPOlWYX7pFZtpI9qaGgx4dmUDB2G6BMU7JZLt+lkeAUvt0hOWQNYULbF/C+gSiHcMR6RiP3cTy8FD5LouqIhcUcyyJnMEaF+yLdzU3iqdTH70uh2ac4S7JzKM6WkuU2HKBojTZo0k4avvDjaYeoBUuj3q6k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fAenK7Tk; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="fAenK7Tk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2C0A1F00893; Sat, 30 May 2026 18:25:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780165519; bh=4B93x6S7eyH2PujCdl9lXnb9gKTRQR1CXZUNTP9tkDA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fAenK7TkXjWD5qtFNnX8lnzCcLH9dBu8eO51N/9iDBt4wV308w/7oj8xMa6vkvCM1 f+qQel2WoVxXIsF/1FVok0Vc1iM8r9RXhju5BrqYzdnIvwusQHgNW5anHONcEfN7Sw w+VL1pRL2o7seow2c8olrqn5K9AtTuBP0HI2Unuw= 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 5.10 103/589] ocfs2: add inline inode consistency check to ocfs2_validate_inode_block() Date: Sat, 30 May 2026 17:59:44 +0200 Message-ID: <20260530160227.432822838@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160224.570625122@linuxfoundation.org> References: <20260530160224.570625122@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev 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: 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 @@ -1418,6 +1418,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: