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

Commit bc113f15 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-linus:
  squashfs: fix potential buffer over-run on 4K block file systems
  squashfs: add missing buffer free
  squashfs: fix warn_on when root inode is corrupted
  squashfs: fix locking bug in zlib wrapper
parents 93a9248a e0d1f700
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -87,9 +87,8 @@ int squashfs_read_data(struct super_block *sb, void **buffer, u64 index,
	u64 cur_index = index >> msblk->devblksize_log2;
	int bytes, compressed, b = 0, k = 0, page = 0, avail;


	bh = kcalloc((msblk->block_size >> msblk->devblksize_log2) + 1,
				sizeof(*bh), GFP_KERNEL);
	bh = kcalloc(((srclength + msblk->devblksize - 1)
		>> msblk->devblksize_log2) + 1, sizeof(*bh), GFP_KERNEL);
	if (bh == NULL)
		return -ENOMEM;

+3 −1
Original line number Diff line number Diff line
@@ -275,7 +275,8 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)

	err = squashfs_read_inode(root, root_inode);
	if (err) {
		iget_failed(root);
		make_bad_inode(root);
		iput(root);
		goto failed_mount;
	}
	insert_inode_hash(root);
@@ -353,6 +354,7 @@ static void squashfs_put_super(struct super_block *sb)
		kfree(sbi->id_table);
		kfree(sbi->fragment_index);
		kfree(sbi->meta_index);
		kfree(sbi->inode_lookup_table);
		kfree(sb->s_fs_info);
		sb->s_fs_info = NULL;
	}
+2 −1
Original line number Diff line number Diff line
@@ -128,8 +128,9 @@ static int zlib_uncompress(struct squashfs_sb_info *msblk, void **buffer,
		goto release_mutex;
	}

	length = stream->total_out;
	mutex_unlock(&msblk->read_data_mutex);
	return stream->total_out;
	return length;

release_mutex:
	mutex_unlock(&msblk->read_data_mutex);