<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/squashfs, branch linux-6.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-06-19T13:40:11Z</updated>
<entry>
<title>Squashfs: check return result of sb_min_blocksize</title>
<updated>2025-06-19T13:40:11Z</updated>
<author>
<name>Phillip Lougher</name>
</author>
<published>2025-04-09T02:47:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=295ab18c2dbce8d0ac6ecf7c5187e16e1ac8b282'/>
<id>urn:sha1:295ab18c2dbce8d0ac6ecf7c5187e16e1ac8b282</id>
<content type='text'>
[ Upstream commit 734aa85390ea693bb7eaf2240623d41b03705c84 ]

Syzkaller reports an "UBSAN: shift-out-of-bounds in squashfs_bio_read" bug.

Syzkaller forks multiple processes which after mounting the Squashfs
filesystem, issues an ioctl("/dev/loop0", LOOP_SET_BLOCK_SIZE, 0x8000).
Now if this ioctl occurs at the same time another process is in the
process of mounting a Squashfs filesystem on /dev/loop0, the failure
occurs.  When this happens the following code in squashfs_fill_super()
fails.

----
msblk-&gt;devblksize = sb_min_blocksize(sb, SQUASHFS_DEVBLK_SIZE);
msblk-&gt;devblksize_log2 = ffz(~msblk-&gt;devblksize);
----

sb_min_blocksize() returns 0, which means msblk-&gt;devblksize is set to 0.

As a result, ffz(~msblk-&gt;devblksize) returns 64, and msblk-&gt;devblksize_log2
is set to 64.

This subsequently causes the

UBSAN: shift-out-of-bounds in fs/squashfs/block.c:195:36
shift exponent 64 is too large for 64-bit type 'u64' (aka
'unsigned long long')

This commit adds a check for a 0 return by sb_min_blocksize().

Link: https://lkml.kernel.org/r/20250409024747.876480-1-phillip@squashfs.org.uk
Fixes: 0aa666190509 ("Squashfs: super block operations")
Reported-by: syzbot+65761fc25a137b9c8c6e@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/67f0dd7a.050a0220.0a13.0230.GAE@google.com/
Signed-off-by: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>squashfs: fix invalid pointer dereference in squashfs_cache_delete</title>
<updated>2025-03-17T00:40:24Z</updated>
<author>
<name>Zhiyu Zhang</name>
</author>
<published>2025-03-06T13:28:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d7147a33570ce07965d76e4491c7c9d8d38006f4'/>
<id>urn:sha1:d7147a33570ce07965d76e4491c7c9d8d38006f4</id>
<content type='text'>
When mounting a squashfs fails, squashfs_cache_init() may return an error
pointer (e.g., -ENOMEM) instead of NULL.  However, squashfs_cache_delete()
only checks for a NULL cache, and attempts to dereference the invalid
pointer.  This leads to a kernel crash (BUG: unable to handle kernel
paging request in squashfs_cache_delete).

This patch fixes the issue by checking IS_ERR(cache) before accessing it.

Link: https://lkml.kernel.org/r/20250306132855.2030-1-zhiyuzhang999@gmail.com
Fixes: 49ff29240ebb ("squashfs: make squashfs_cache_init() return ERR_PTR(-ENOMEM)")
Signed-off-by: Zhiyu Zhang &lt;zhiyuzhang999@gmail.com&gt;
Reported-by: Zhiyu Zhang &lt;zhiyuzhang999@gmail.com&gt;
Closes: https://lore.kernel.org/linux-fsdevel/CALf2hKvaq8B4u5yfrE+BYt7aNguao99mfWxHngA+=o5hwzjdOg@mail.gmail.com/
Tested-by: Zhiyu Zhang &lt;zhiyuzhang999@gmail.com&gt;
Reviewed-by: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>squashfs: convert squashfs_fill_page() to take a folio</title>
<updated>2025-01-25T06:47:22Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
</author>
<published>2024-12-20T22:46:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5748be3e9ef4659f9adf7e1ad454fafb0868cd88'/>
<id>urn:sha1:5748be3e9ef4659f9adf7e1ad454fafb0868cd88</id>
<content type='text'>
squashfs_fill_page is only used in this file, so make it static.
Use kmap_local instead of kmap_atomic, and return a bool so that
the caller can use folio_end_read() which saves an atomic operation
over calling folio_mark_uptodate() followed by folio_unlock().

[willy@infradead.org: fix polarity of "uptodate" Thanks to Ryan for testing]
  Link: https://lkml.kernel.org/r/20250110163300.3346321-2-willy@infradead.org
Link: https://lkml.kernel.org/r/20241220224634.723899-5-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Tested-by: Ryan Roberts &lt;ryan.roberts@arm.com&gt;
Cc: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>squashfs; convert squashfs_copy_cache() to take a folio</title>
<updated>2025-01-25T06:47:22Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
</author>
<published>2024-12-20T22:46:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5641371fd0b3703d11809a0ae249aed270cb8add'/>
<id>urn:sha1:5641371fd0b3703d11809a0ae249aed270cb8add</id>
<content type='text'>
Remove accesses to page-&gt;index and page-&gt;mapping.  Also use folio
APIs where available.  This code still assumes order 0 folios.

[dan.carpenter@linaro.org: fix a NULL vs IS_ERR() bug]
  Link: https://lkml.kernel.org/r/7b7f44d6-9153-4d7c-b65b-2d78febe6c7a@stanley.mountain
Link: https://lkml.kernel.org/r/20241220224634.723899-4-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Signed-off-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Cc: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Cc: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>squashfs: convert squashfs_readpage_block() to take a folio</title>
<updated>2025-01-25T06:47:22Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
</author>
<published>2024-12-20T22:46:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2a7aea59cf4dd4a070c4550fddaffc5a73312cad'/>
<id>urn:sha1:2a7aea59cf4dd4a070c4550fddaffc5a73312cad</id>
<content type='text'>
Remove a few accesses to page-&gt;mapping.

Link: https://lkml.kernel.org/r/20241220224634.723899-3-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Cc: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>squashfs: pass a folio to squashfs_readpage_fragment()</title>
<updated>2025-01-25T06:47:22Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
</author>
<published>2024-12-20T22:46:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8c1565fcf6392d2f962b7cbc9fde43bfcd175c2f'/>
<id>urn:sha1:8c1565fcf6392d2f962b7cbc9fde43bfcd175c2f</id>
<content type='text'>
Remove an access to page-&gt;mapping.

Link: https://lkml.kernel.org/r/20241220224634.723899-2-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Cc: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>squashfs: use a folio throughout squashfs_read_folio()</title>
<updated>2025-01-25T06:47:22Z</updated>
<author>
<name>Matthew Wilcox (Oracle)</name>
</author>
<published>2024-12-20T22:46:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=608c2501675cd37260312d35daa2fd6dc6d56e96'/>
<id>urn:sha1:608c2501675cd37260312d35daa2fd6dc6d56e96</id>
<content type='text'>
Use modern folio APIs where they exist and convert back to struct
page for the internal functions.

Link: https://lkml.kernel.org/r/20241220224634.723899-1-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) &lt;willy@infradead.org&gt;
Cc: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>squashfs: update Kconfig information</title>
<updated>2025-01-25T06:47:22Z</updated>
<author>
<name>Phillip Lougher</name>
</author>
<published>2024-12-29T23:37:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d7f4b23c6702e2afbdfe33fe77eedc1584761242'/>
<id>urn:sha1:d7f4b23c6702e2afbdfe33fe77eedc1584761242</id>
<content type='text'>
Update the compression algorithms supported, and the Squashfs website
location.

Link: https://lkml.kernel.org/r/20241229233752.54481-5-phillip@squashfs.org.uk
Signed-off-by: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>squashfs: don't allocate read_page cache if SQUASHFS_FILE_DIRECT configured</title>
<updated>2025-01-25T06:47:21Z</updated>
<author>
<name>Phillip Lougher</name>
</author>
<published>2024-12-29T23:37:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f5cc08737507f227e5e7e2df52d26ed1f0a7e315'/>
<id>urn:sha1:f5cc08737507f227e5e7e2df52d26ed1f0a7e315</id>
<content type='text'>
If Squashfs has been configured to directly read datablocks into the page
cache (SQUASHFS_FILE_DIRECT), then the read_page cache is unnecessary.

This improvement is due to the following two commits, which added the
ability to read datablocks into the page cache when pages were missing,
enabling the fallback which used an intermediate buffer to be removed.

commit f268eedddf359 ("squashfs: extend "page actor" to handle missing pages")
commit 1bb1a07afad97 ("squashfs: don't use intermediate buffer if pages missing")

This reduces the amount of memory used when mounting a filesystem by
block_size * maximum number of threads.

Link: https://lkml.kernel.org/r/20241229233752.54481-3-phillip@squashfs.org.uk
Signed-off-by: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>squashfs: make squashfs_cache_init() return ERR_PTR(-ENOMEM)</title>
<updated>2025-01-25T06:45:34Z</updated>
<author>
<name>Phillip Lougher</name>
</author>
<published>2024-12-29T23:37:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=49ff29240ebb13bc0efa4623d4379650e68fcb35'/>
<id>urn:sha1:49ff29240ebb13bc0efa4623d4379650e68fcb35</id>
<content type='text'>
Patch series "squashfs: reduce memory usage and update docs".

This patchset reduces the amount of memory that Squashfs uses when
CONFIG_FILE_DIRECT is configured, and updates various out of date
information in the documentation and Kconfig.

This patch (of 4):

Make squashfs_cache_init() return an ERR_PTR(-ENOMEM) on failure rather
than NULL.

This tidies up some calling code, but, it also allows NULL to be returned
as a valid result when a cache hasn't be allocated.

Link: https://lkml.kernel.org/r/20241229233752.54481-1-phillip@squashfs.org.uk
Link: https://lkml.kernel.org/r/20241229233752.54481-2-phillip@squashfs.org.uk
Signed-off-by: Phillip Lougher &lt;phillip@squashfs.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
</feed>
