rpms/kernel/devel squashfs-fix-page-aligned-data.patch,1.1,1.2

Kyle McMartin kyle at fedoraproject.org
Wed Mar 11 19:34:29 UTC 2009


Author: kyle

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv28858

Modified Files:
	squashfs-fix-page-aligned-data.patch 
Log Message:
proper squashfs fs

squashfs-fix-page-aligned-data.patch:

Index: squashfs-fix-page-aligned-data.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/squashfs-fix-page-aligned-data.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- squashfs-fix-page-aligned-data.patch	11 Mar 2009 03:25:00 -0000	1.1
+++ squashfs-fix-page-aligned-data.patch	11 Mar 2009 19:33:58 -0000	1.2
@@ -1,13 +1,70 @@
+commit 7dacdd0d86a70564cd56e49cd9432d68e0a58916
+Author: Phillip Lougher <phillip at lougher.demon.co.uk>
+Date:   Wed Mar 11 17:55:28 2009 +0000
+
+Squashfs: Valid filesystems are flagged as bad by the corrupted fs patch
+
+The problem arises due to an unexpected corner-case with zlib which the
+corrupted filesystems patch didn't address.  Very occasionally zlib
+exits needing a couple of extra bytes of input (up to 6 seen bytes in the
+test filesystems), but with avail_out == 0 and no more output buffer
+space available.  This situation was incorrectly flagged as an output buffer
+overrun by the corrupted filesystems patch.
+
+Signed-off-by: Phillip Lougher <phillip at lougher.demon.co.uk>
+Reported-by: Stefan Lippers-Hollmann <s.L-H at gmx.de>
+Tested-by: Geert Uytterhoeven <Geert.Uytterhoeven at sonycom.com>
+---
+ fs/squashfs/block.c |   29 ++++++++++++++++-------------
+ 1 files changed, 16 insertions(+), 13 deletions(-)
+
 diff --git a/fs/squashfs/block.c b/fs/squashfs/block.c
-index 321728f..2b7598e 100644
+index 321728f..b85173f 100644
 --- a/fs/squashfs/block.c
 +++ b/fs/squashfs/block.c
-@@ -185,7 +185,7 @@ int squashfs_read_data(struct super_block *sb, void **buffer, u64 index,
+@@ -166,6 +166,22 @@ int squashfs_read_data(struct super_block *sb, void **buffer, u64 index,
+ 
+ 		bytes = length;
+ 		do {
++			if (msblk->stream.avail_out == 0) {
++				if (page < pages) {
++					msblk->stream.next_out = buffer[page++];
++					msblk->stream.avail_out =
++								PAGE_CACHE_SIZE;
++				} else if (msblk->stream.avail_in > 0
++								|| bytes == 0) {
++					ERROR("zlib_inflate tried to "
++						"decompress too much data, "
++						"expected %d bytes.  Zlib "
++						"data probably corrupt\n",
++						srclength);
++					goto release_mutex;
++				}
++			}
++
+ 			if (msblk->stream.avail_in == 0 && k < b) {
+ 				avail = min(bytes, msblk->devblksize - offset);
+ 				bytes -= avail;
+@@ -184,19 +200,6 @@ int squashfs_read_data(struct super_block *sb, void **buffer, u64 index,
+ 				offset = 0;
  			}
  
- 			if (msblk->stream.avail_out == 0) {
+-			if (msblk->stream.avail_out == 0) {
 -				if (page == pages) {
-+				if (page > pages) {
- 					ERROR("zlib_inflate tried to "
- 						"decompress too much data, "
- 						"expected %d bytes.  Zlib "
+-					ERROR("zlib_inflate tried to "
+-						"decompress too much data, "
+-						"expected %d bytes.  Zlib "
+-						"data probably corrupt\n",
+-						srclength);
+-					goto release_mutex;
+-				}
+-				msblk->stream.next_out = buffer[page++];
+-				msblk->stream.avail_out = PAGE_CACHE_SIZE;
+-			}
+-
+ 			if (!zlib_init) {
+ 				zlib_err = zlib_inflateInit(&msblk->stream);
+ 				if (zlib_err != Z_OK) {
+-- 
+1.5.6.3
+




More information about the fedora-extras-commits mailing list