Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc9bc72e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-linus:
  Squashfs: update email address
  Squashfs: add extra sanity checks at mount time
  Squashfs: add sanity checks to fragment reading at mount time
  Squashfs: add sanity checks to lookup table reading at mount time
  Squashfs: add sanity checks to id reading at mount time
  Squashfs: add sanity checks to xattr reading at mount time
  Squashfs: reverse order of filesystem table reading
  Squashfs: move table allocation into squashfs_read_table()
parents 968d803c d7f2ff67
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -6001,7 +6001,7 @@ F: Documentation/filesystems/spufs.txt
F:	arch/powerpc/platforms/cell/spufs/
F:	arch/powerpc/platforms/cell/spufs/


SQUASHFS FILE SYSTEM
SQUASHFS FILE SYSTEM
M:	Phillip Lougher <phillip@lougher.demon.co.uk>
M:	Phillip Lougher <phillip@squashfs.org.uk>
L:	squashfs-devel@lists.sourceforge.net (subscribers-only)
L:	squashfs-devel@lists.sourceforge.net (subscribers-only)
W:	http://squashfs.org.uk
W:	http://squashfs.org.uk
S:	Maintained
S:	Maintained
+1 −1
Original line number Original line Diff line number Diff line
@@ -2,7 +2,7 @@
 * Squashfs - a compressed read only filesystem for Linux
 * Squashfs - a compressed read only filesystem for Linux
 *
 *
 * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008
 * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008
 * Phillip Lougher <phillip@lougher.demon.co.uk>
 * Phillip Lougher <phillip@squashfs.org.uk>
 *
 *
 * This program is free software; you can redistribute it and/or
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * modify it under the terms of the GNU General Public License
+24 −7
Original line number Original line Diff line number Diff line
@@ -2,7 +2,7 @@
 * Squashfs - a compressed read only filesystem for Linux
 * Squashfs - a compressed read only filesystem for Linux
 *
 *
 * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008
 * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008
 * Phillip Lougher <phillip@lougher.demon.co.uk>
 * Phillip Lougher <phillip@squashfs.org.uk>
 *
 *
 * This program is free software; you can redistribute it and/or
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * modify it under the terms of the GNU General Public License
@@ -393,19 +393,36 @@ struct squashfs_cache_entry *squashfs_get_datablock(struct super_block *sb,
/*
/*
 * Read a filesystem table (uncompressed sequence of bytes) from disk
 * Read a filesystem table (uncompressed sequence of bytes) from disk
 */
 */
int squashfs_read_table(struct super_block *sb, void *buffer, u64 block,
void *squashfs_read_table(struct super_block *sb, u64 block, int length)
	int length)
{
{
	int pages = (length + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
	int pages = (length + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
	int i, res;
	int i, res;
	void **data = kcalloc(pages, sizeof(void *), GFP_KERNEL);
	void *table, *buffer, **data;
	if (data == NULL)

		return -ENOMEM;
	table = buffer = kmalloc(length, GFP_KERNEL);
	if (table == NULL)
		return ERR_PTR(-ENOMEM);

	data = kcalloc(pages, sizeof(void *), GFP_KERNEL);
	if (data == NULL) {
		res = -ENOMEM;
		goto failed;
	}


	for (i = 0; i < pages; i++, buffer += PAGE_CACHE_SIZE)
	for (i = 0; i < pages; i++, buffer += PAGE_CACHE_SIZE)
		data[i] = buffer;
		data[i] = buffer;

	res = squashfs_read_data(sb, data, block, length |
	res = squashfs_read_data(sb, data, block, length |
		SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, length, pages);
		SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, length, pages);

	kfree(data);
	kfree(data);
	return res;

	if (res < 0)
		goto failed;

	return table;

failed:
	kfree(table);
	return ERR_PTR(res);
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -2,7 +2,7 @@
 * Squashfs - a compressed read only filesystem for Linux
 * Squashfs - a compressed read only filesystem for Linux
 *
 *
 * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
 * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
 * Phillip Lougher <phillip@lougher.demon.co.uk>
 * Phillip Lougher <phillip@squashfs.org.uk>
 *
 *
 * This program is free software; you can redistribute it and/or
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * modify it under the terms of the GNU General Public License
+1 −1
Original line number Original line Diff line number Diff line
@@ -4,7 +4,7 @@
 * Squashfs - a compressed read only filesystem for Linux
 * Squashfs - a compressed read only filesystem for Linux
 *
 *
 * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
 * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
 * Phillip Lougher <phillip@lougher.demon.co.uk>
 * Phillip Lougher <phillip@squashfs.org.uk>
 *
 *
 * This program is free software; you can redistribute it and/or
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * modify it under the terms of the GNU General Public License
Loading