Re: [GIT PULL] Squashfs fixes for 2.6.29?

From: Stefan Lippers-Hollmann
Date: Mon Mar 09 2009 - 17:39:31 EST


Hi

On Donnerstag, 5. März 2009, Phillip Lougher wrote:
> Hi Linus,
>
> Please consider pulling the following Squashfs fixes. They fix some
> potential oopses when dealing with corrupted filesystems (plus a trivial
> documentation typo fix).
>
> Please pull from
>
> git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-linus.git
>
> Phillip Lougher (2):
> Squashfs: Fix oops when reading fsfuzzer corrupted filesystems
[...]

This patch seems to break squashfs for me on i386 and amd64.

Test environment is a squashed filesystem image (live CD image, but also
tested manually with a loop mounted iso9660 and loop mounted squashfs;
kernel 2.6.29-rc7-git2). The squashfs image has been created with
squashfs-tools CVS[1] as of today (latest commit 2009-03-03).

# mkdir /tmp/pkg
# mount -o loop /var/cache/pyfll/sidux-snapshot-xfce-lite-i386-200903091945.iso /mnt
# mount -t squashfs -o loop /mnt/sidux/sidux.686 /mnt/
# LANG= cp -a /mnt/ /tmp/pkg/
cp: reading `/mnt/lib/modules/2.6.28-7.slh.3-sidux-686/kernel/drivers/media/dvb/ttpci/dvb-ttpci.ko': Input/output error
cp: cannot stat `/mnt/lib/modules/2.6.29-rc7-sidux-686/kernel/drivers/hwmon': Input/output error
cp: cannot stat `/mnt/lib/modules/2.6.29-rc7-sidux-686/kernel/drivers/i2c': Input/output error
cp: cannot stat `/mnt/lib/modules/2.6.29-rc7-sidux-686/kernel/drivers/infiniband': Input/output error
[...]

dmesg shows the following:

ISO 9660 Extensions: Microsoft Joliet Level 3
ISO 9660 Extensions: RRIP_1991A
squashfs: version 4.0 (2009/01/31) Phillip Lougher
SQUASHFS error: zlib_inflate tried to decompress too much data, expected 131072 bytes. Zlib data probably corrupt
SQUASHFS error: squashfs_read_data failed to read block 0xb7781f
SQUASHFS error: Unable to read data cache entry [b7781f]
SQUASHFS error: Unable to read page, block b7781f, size c7e5
SQUASHFS error: Unable to read data cache entry [b7781f]
SQUASHFS error: Unable to read page, block b7781f, size c7e5
SQUASHFS error: Unable to read data cache entry [b7781f]
SQUASHFS error: Unable to read page, block b7781f, size c7e5
SQUASHFS error: Unable to read data cache entry [b7781f]
SQUASHFS error: Unable to read page, block b7781f, size c7e5
SQUASHFS error: Unable to read data cache entry [b7781f]
SQUASHFS error: Unable to read page, block b7781f, size c7e5
SQUASHFS error: zlib_inflate tried to decompress too much data, expected 8192 bytes. Zlib data probably corrupt
SQUASHFS error: squashfs_read_data failed to read block 0x17135aab
SQUASHFS error: Unable to read metadata cache entry [17135aab]
SQUASHFS error: Unable to read inode 0xc37f06f2
[...]

Reverting just this patch[2] results in flawless operations (I have the
same problems [and workaround, by reverting this patch] with the squashfs4
patches applied to 2.6.28.7, so that seems to rule out unrelated breakage).

Regards
Stefan Lippers-Hollmann

[1] cvs -d:pserver:anonymous@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:/cvsroot/squashfs login
cvs -z3 -d:pserver:anonymous@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:/cvsroot/squashfs co -P squashfs/squashfs-tools
[2] From 118e1ef6fabfc023126e6075f6ac0fc729cb5285 Mon Sep 17 00:00:00 2001
From: Phillip Lougher <phillip@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 5 Mar 2009 00:31:12 +0000
Subject: [PATCH 16/17] Squashfs: Fix oops when reading fsfuzzer corrupted filesystems

Attachment: signature.asc
Description: This is a digitally signed message part.