Skip to contentSkip to conversation

squashfs-check-metadata-block-offset-is-within-range.patch removed from -mm tree

merged mm-hotfixes-stable Andrew Morton 1 participant 1 message Feb 24 Stable branch

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: Squashfs: check metadata block offset is within range
has been removed from the -mm tree. Its filename was
squashfs-check-metadata-block-offset-is-within-range.patch

This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Phillip Lougher <[email protected]>
Subject: Squashfs: check metadata block offset is within range
Date: Tue, 17 Feb 2026 05:09:55 +0000

Syzkaller reports a "general protection fault in squashfs_copy_data"

This is ultimately caused by a corrupted index look-up table, which produces a negative metadata block offset.

This is subsequently passed to squashfs_copy_data (via squashfs_read_metadata) where the negative offset causes an out of bounds access.

The fix is to check that the offset is within range in squashfs_read_metadata. This will trap this and other cases.

---

 fs/squashfs/cache.c |    3 +++
 1 file changed, 3 insertions(+)
fs/squashfs/cache.c renamed from fs/squashfs/cache.c~squashfs-check-metadata-block-offset-is-within-range +3 -0
@@ -344,6 +344,9 @@ int squashfs_read_metadata(struct super_
 	if (unlikely(length < 0))
 		return -EIO;
 
+	if (unlikely(*offset < 0 || *offset >= SQUASHFS_METADATA_SIZE))
+		return -EIO;
+
 	while (length) {
 		entry = squashfs_cache_get(sb, msblk->block_cache, *block, 0);
 		if (entry->error) {

_

Patches currently in -mm which might be from [email protected] are

squashfs-check-xz-dictionary-size-isnt-zero.patch