<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/squashfs, branch linux-3.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-08-09T10:20:33Z</updated>
<entry>
<title>squashfs: more metadata hardenings</title>
<updated>2018-08-09T10:20:33Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2018-08-02T15:43:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4a60e5435410a27e7daea64d1ed550dd8238936b'/>
<id>urn:sha1:4a60e5435410a27e7daea64d1ed550dd8238936b</id>
<content type='text'>
commit 71755ee5350b63fb1f283de8561cdb61b47f4d1d upstream.

The squashfs fragment reading code doesn't actually verify that the
fragment is inside the fragment table.  The end result _is_ verified to
be inside the image when actually reading the fragment data, but before
that is done, we may end up taking a page fault because the fragment
table itself might not even exist.

Another report from Anatoly and his endless squashfs image fuzzing.

Reported-by: Анатолий Тросиненко &lt;anatoly.trosinenko@gmail.com&gt;
Acked-by:: Phillip Lougher &lt;phillip.lougher@gmail.com&gt;,
Cc: Willy Tarreau &lt;w@1wt.eu&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>squashfs: more metadata hardening</title>
<updated>2018-08-09T10:20:33Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2018-07-30T21:27:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a220a703b9d844662104f5db3862f12eb426c758'/>
<id>urn:sha1:a220a703b9d844662104f5db3862f12eb426c758</id>
<content type='text'>
commit d512584780d3e6a7cacb2f482834849453d444a1 upstream.

Anatoly reports another squashfs fuzzing issue, where the decompression
parameters themselves are in a compressed block.

This causes squashfs_read_data() to be called in order to read the
decompression options before the decompression stream having been set
up, making squashfs go sideways.

Reported-by: Anatoly Trosinenko &lt;anatoly.trosinenko@gmail.com&gt;
Acked-by: Phillip Lougher &lt;phillip.lougher@gmail.com&gt;
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>squashfs: be more careful about metadata corruption</title>
<updated>2018-08-09T10:20:32Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2018-07-29T19:44:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2474de0a61ad4c3756dd6b834807d929215eb899'/>
<id>urn:sha1:2474de0a61ad4c3756dd6b834807d929215eb899</id>
<content type='text'>
commit 01cfb7937a9af2abb1136c7e89fbf3fd92952956 upstream.

Anatoly Trosinenko reports that a corrupted squashfs image can cause a
kernel oops.  It turns out that squashfs can end up being confused about
negative fragment lengths.

The regular squashfs_read_data() does check for negative lengths, but
squashfs_read_metadata() did not, and the fragment size code just
blindly trusted the on-disk value.  Fix both the fragment parsing and
the metadata reading code.

Reported-by: Anatoly Trosinenko &lt;anatoly.trosinenko@gmail.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>fs/squashfs/super.c: logging cleanup</title>
<updated>2014-08-07T01:01:13Z</updated>
<author>
<name>Fabian Frederick</name>
</author>
<published>2014-08-06T23:03:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c811f5f41e37d16b2839988426ffde78d2273d48'/>
<id>urn:sha1:c811f5f41e37d16b2839988426ffde78d2273d48</id>
<content type='text'>
- Convert printk to pr_foo()
- Add pr_fmt for future logging entries
- Coalesce formats

Signed-off-by: Fabian Frederick &lt;fabf@skynet.be&gt;
Cc: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fs/squashfs/file_direct.c: replace count*size kmalloc by kmalloc_array</title>
<updated>2014-08-07T01:01:13Z</updated>
<author>
<name>Fabian Frederick</name>
</author>
<published>2014-08-06T23:03:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=14694888db2c1f7ba1f2e6172df45813b4db7880'/>
<id>urn:sha1:14694888db2c1f7ba1f2e6172df45813b4db7880</id>
<content type='text'>
kmalloc_array() manages count*sizeof overflow.

Signed-off-by: Fabian Frederick &lt;fabf@skynet.be&gt;
Cc: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Cc: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fs/squashfs/squashfs.h: replace pr_warning by pr_warn</title>
<updated>2014-06-04T23:53:52Z</updated>
<author>
<name>Fabian Frederick</name>
</author>
<published>2014-06-04T23:05:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=220108361f7cef9bc3ac0b4c84cb556d36ec2a6f'/>
<id>urn:sha1:220108361f7cef9bc3ac0b4c84cb556d36ec2a6f</id>
<content type='text'>
Update the last pr_warning callsite in fs branch

Signed-off-by: Fabian Frederick &lt;fabf@skynet.be&gt;
Cc: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fs: push sync_filesystem() down to the file system's remount_fs()</title>
<updated>2014-03-13T14:14:33Z</updated>
<author>
<name>Theodore Ts'o</name>
</author>
<published>2014-03-13T14:14:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=02b9984d640873b7b3809e63f81a0d7e13496886'/>
<id>urn:sha1:02b9984d640873b7b3809e63f81a0d7e13496886</id>
<content type='text'>
Previously, the no-op "mount -o mount /dev/xxx" operation when the
file system is already mounted read-write causes an implied,
unconditional syncfs().  This seems pretty stupid, and it's certainly
documented or guaraunteed to do this, nor is it particularly useful,
except in the case where the file system was mounted rw and is getting
remounted read-only.

However, it's possible that there might be some file systems that are
actually depending on this behavior.  In most file systems, it's
probably fine to only call sync_filesystem() when transitioning from
read-write to read-only, and there are some file systems where this is
not needed at all (for example, for a pseudo-filesystem or something
like romfs).

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Cc: linux-fsdevel@vger.kernel.org
Cc: Christoph Hellwig &lt;hch@infradead.org&gt;
Cc: Artem Bityutskiy &lt;dedekind1@gmail.com&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Evgeniy Dushistov &lt;dushistov@mail.ru&gt;
Cc: Jan Kara &lt;jack@suse.cz&gt;
Cc: OGAWA Hirofumi &lt;hirofumi@mail.parknet.co.jp&gt;
Cc: Anders Larsen &lt;al@alarsen.net&gt;
Cc: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Mikulas Patocka &lt;mikulas@artax.karlin.mff.cuni.cz&gt;
Cc: Petr Vandrovec &lt;petr@vandrovec.name&gt;
Cc: xfs@oss.sgi.com
Cc: linux-btrfs@vger.kernel.org
Cc: linux-cifs@vger.kernel.org
Cc: samba-technical@lists.samba.org
Cc: codalist@coda.cs.cmu.edu
Cc: linux-ext4@vger.kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net
Cc: fuse-devel@lists.sourceforge.net
Cc: cluster-devel@redhat.com
Cc: linux-mtd@lists.infradead.org
Cc: jfs-discussion@lists.sourceforge.net
Cc: linux-nfs@vger.kernel.org
Cc: linux-nilfs@vger.kernel.org
Cc: linux-ntfs-dev@lists.sourceforge.net
Cc: ocfs2-devel@oss.oracle.com
Cc: reiserfs-devel@vger.kernel.org
</content>
</entry>
<entry>
<title>Squashfs: fix failure to unlock pages on decompress error</title>
<updated>2013-11-24T01:02:50Z</updated>
<author>
<name>Phillip Lougher</name>
</author>
<published>2013-11-24T00:40:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6d565409503f4e1f74ac30de14e8c91a2b826cd8'/>
<id>urn:sha1:6d565409503f4e1f74ac30de14e8c91a2b826cd8</id>
<content type='text'>
Direct decompression into the page cache.  If we fall back
to using an intermediate buffer (because we cannot grab all the
page cache pages) and we get a decompress fail, we forgot to
release the pages.

Reported-by: Roman Peniaev &lt;r.peniaev@gmail.com&gt;
Signed-off-by: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
</content>
</entry>
<entry>
<title>Squashfs: Check stream is not NULL in decompressor_multi.c</title>
<updated>2013-11-20T03:59:20Z</updated>
<author>
<name>Phillip Lougher</name>
</author>
<published>2013-11-10T00:02:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ed4f381ec15e5f11724cdbc68cffd2c22d1eaebd'/>
<id>urn:sha1:ed4f381ec15e5f11724cdbc68cffd2c22d1eaebd</id>
<content type='text'>
Fix static checker complaint that stream is not checked in
squashfs_decompressor_destroy().

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Reviewed-by: Minchan Kim &lt;minchan@kernel.org&gt;
</content>
</entry>
<entry>
<title>Squashfs: Directly decompress into the page cache for file data</title>
<updated>2013-11-20T03:59:13Z</updated>
<author>
<name>Phillip Lougher</name>
</author>
<published>2013-11-13T02:04:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0d455c12c6428647547bacccaaced3cae0f35570'/>
<id>urn:sha1:0d455c12c6428647547bacccaaced3cae0f35570</id>
<content type='text'>
This introduces an implementation of squashfs_readpage_block()
that directly decompresses into the page cache.

This uses the previously added page handler abstraction to push
down the necessary kmap_atomic/kunmap_atomic operations on the
page cache buffers into the decompressors.  This enables
direct copying into the page cache without using the slow
kmap/kunmap calls.

The code detects when multiple threads are racing in
squashfs_readpage() to decompress the same block, and avoids
this regression by falling back to using an intermediate
buffer.

This patch enhances the performance of Squashfs significantly
when multiple processes are accessing the filesystem simultaneously
because it not only reduces memcopying, but it more importantly
eliminates the lock contention on the intermediate buffer.

Using single-thread decompression.

        dd if=file1 of=/dev/null bs=4096 &amp;
        dd if=file2 of=/dev/null bs=4096 &amp;
        dd if=file3 of=/dev/null bs=4096 &amp;
        dd if=file4 of=/dev/null bs=4096

Before:

629145600 bytes (629 MB) copied, 45.8046 s, 13.7 MB/s

After:

629145600 bytes (629 MB) copied, 9.29414 s, 67.7 MB/s

Signed-off-by: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Reviewed-by: Minchan Kim &lt;minchan@kernel.org&gt;
</content>
</entry>
</feed>
