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 0291B2C026C; Sat, 17 Oct 2026 16:28:10 +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=1792254491; cv=none; b=tQnNpcdT4m9YaJRjqKq5DW/Bp6zDrSjG4VkiLIGBFAinG9PYuoA84tlSak4o3i/6rGUt+h/rWH8Q0sEZxVRvKrj7TON//PJalNpICpO9J72sICR84Q8W/qH14gmUO1L4Hr0TPNHCqNwMC6fYk5cndAUvpQrD1KmKKA1jA7W2hnw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792254491; c=relaxed/simple; bh=FaUmaHTqR2K2c7mFlwjT+2MiyagAqm6XZiEuOGlyBFM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NPcoV2Vey7Xii/VUB9crEu0y88O8THku8wEpGNxz39fb2Ly2RkCBpZ0ODvef7XRMq4XOmxTJ2nK5U5TBl5U2LoTKMuLYLKN0LrNduLS51rytJlt3rxgDuMXddC0QE9t//Z/67Xv4Zu4fkr42AuqAspLsuJ5fdCDzdMvfWsshx5o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=bGjCC9tD; 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="bGjCC9tD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A5471F000C4; Sat, 17 Oct 2026 16:28:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792254489; bh=IrlUGn8gThHIcAIyUav2VJqLm6VhavsbKxBHce69GxE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bGjCC9tD5h3WZsTUQ70feKm33owvmyImoQSkGfcrDbRXCQNDlChqmfr/B/H7xKkbk N8d4LyiEfxw3bc56uxxEBzLRS4wT3RnEcSWP8cJ53NY+vL1L9/sN2Ifa96smAdCsoY 2Z8aMMf3sCF/QHW7roRScuCSKhZaUIoBl4V7kgfY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dmitry Antipov , syzbot+900962ac9bf1860033f2@syzkaller.appspotmail.com, Joseph Qi , Mark Fasheh , Joel Becker , Junxiao Bi , Changwei Ge , Jun Piao , Andrew Morton , Sasha Levin Subject: [PATCH 6.12 427/869] ocfs2: add suballoc slot check in ocfs2_validate_inode_block() Date: Sat, 17 Oct 2026 17:54:28 +0200 Message-ID: <20261017160048.084963657@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261017160036.979869304@linuxfoundation.org> References: <20261017160036.979869304@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 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dmitry Antipov [ Upstream commit fe7a283b39160153b6d1bd7f61b0a9d5d44987a8 ] In 'ocfs2_validate_inode_block()', add suballoc slot check similar to one in 'ocfs2_get_suballoc_slot_bit()', thus preventing an out-of-bounds accesses for 'local_system_inodes' in 'get_local_system_inode()'. Most likely this fixes https://syzkaller.appspot.com/bug?extid=a77d690840e60bc2ddd8 as well. Link: https://lkml.kernel.org/r/20250826095106.666980-1-dmantipov@yandex.ru Signed-off-by: Dmitry Antipov Reported-by: syzbot+900962ac9bf1860033f2@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=900962ac9bf1860033f2 Reviewed-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Jun Piao Signed-off-by: Andrew Morton Stable-dep-of: 452a8467be81 ("ocfs2: fix UBSAN array-index-out-of-bounds in ocfs2_sum_rightmost_rec") 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 5c540d0af8aa2..9104f088c86d8 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c @@ -1577,6 +1577,14 @@ int ocfs2_validate_inode_block(struct super_block *sb, } } + if (le16_to_cpu(di->i_suballoc_slot) != (u16)OCFS2_INVALID_SLOT && + (u32)le16_to_cpu(di->i_suballoc_slot) > OCFS2_SB(sb)->max_slots - 1) { + rc = ocfs2_error(sb, "Invalid dinode %llu: suballoc slot %u\n", + (unsigned long long)bh->b_blocknr, + le16_to_cpu(di->i_suballoc_slot)); + goto bail; + } + rc = 0; bail: -- 2.53.0