[PATCH] corrupted cramfs filesystems cause kernel oops
[pandora-kernel.git] / fs / cramfs / inode.c
index a624c3e..0509ced 100644 (file)
@@ -481,6 +481,8 @@ static int cramfs_readpage(struct file *file, struct page * page)
                pgdata = kmap(page);
                if (compr_len == 0)
                        ; /* hole */
+               else if (compr_len > (PAGE_CACHE_SIZE << 1))
+                       printk(KERN_ERR "cramfs: bad compressed blocksize %u\n", compr_len);
                else {
                        mutex_lock(&read_mutex);
                        bytes_filled = cramfs_uncompress_block(pgdata,