<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/fs/squashfs/sqfs.c, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/fs/squashfs/sqfs.c?h=main</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/fs/squashfs/sqfs.c?h=main'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2026-04-24T17:28:10Z</updated>
<entry>
<title>fs/squashfs: Set ret to 0 on successful read</title>
<updated>2026-04-24T17:28:10Z</updated>
<author>
<name>Michael Zimmermann</name>
<email>sigmaepsilon92@gmail.com</email>
</author>
<published>2026-04-20T16:35:31Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=30885b01aaa4bcdfa3fee9ca3066d3af563e6688'/>
<id>urn:sha1:30885b01aaa4bcdfa3fee9ca3066d3af563e6688</id>
<content type='text'>
It might still be a positive number due to the call to sqfs_disk_read.
This only happens when reading a file from an uncompressed squashfs.

I found this by trying to boot using the extlinux bootmethod, where
positive values are treated as errors.

Signed-off-by: Michael Zimmermann &lt;sigmaepsilon92@gmail.com&gt;
Acked-by: Richard Genoud &lt;richard.genoud@bootlin.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>spl: add squashfs support</title>
<updated>2026-03-26T17:04:28Z</updated>
<author>
<name>Richard Genoud</name>
<email>richard.genoud@bootlin.com</email>
</author>
<published>2026-03-13T10:42:26Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6494e823b46ced400764b6203d7480c9e3badc20'/>
<id>urn:sha1:6494e823b46ced400764b6203d7480c9e3badc20</id>
<content type='text'>
Implement spl_load_image_sqfs() in spl code.

This will be used in MMC to read a file from a squashfs partition.

Also, loosen squashfs read checks on file size by not failing when a
bigger size than the actual file size is requested. (Just read the file)
This is needed for FIT loading, because the length is ALIGNed.

Signed-off-by: Richard Genoud &lt;richard.genoud@bootlin.com&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Reviewed-by: João Marcos Costa &lt;joaomarcos.costa@bootlin.com&gt;
</content>
</entry>
<entry>
<title>fs/squashfs: fix heap buffer overflow in sqfs_frag_lookup()</title>
<updated>2026-02-23T18:45:50Z</updated>
<author>
<name>Eric Kilmer</name>
<email>eric.kilmer@trailofbits.com</email>
</author>
<published>2026-02-20T19:48:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=e365a269df5d01307390bdf7d6a1081d94b06470'/>
<id>urn:sha1:e365a269df5d01307390bdf7d6a1081d94b06470</id>
<content type='text'>
sqfs_frag_lookup() reads a 16-bit metadata block header whose lower
15 bits encode the data size. Unlike sqfs_read_metablock() in
sqfs_inode.c, this function does not validate that the decoded size is
within SQFS_METADATA_BLOCK_SIZE (8192). A malformed SquashFS image can
set the size field to any value up to 32767, causing memcpy to write
past the 8192-byte 'entries' heap buffer.

Add the same bounds check used by sqfs_read_metablock(): reject any
metadata block header with SQFS_METADATA_SIZE(header) exceeding
SQFS_METADATA_BLOCK_SIZE.

Found by fuzzing with libFuzzer + AddressSanitizer.

Signed-off-by: Eric Kilmer &lt;eric.kilmer@trailofbits.com&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
</entry>
<entry>
<title>fs: prevent integer overflow in sqfs_concat</title>
<updated>2026-01-16T19:04:40Z</updated>
<author>
<name>Timo tp Preißl</name>
<email>t.preissl@proton.me</email>
</author>
<published>2026-01-09T11:24:59Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=870aff99a279ed428c5a2560b2441b3079ddb34b'/>
<id>urn:sha1:870aff99a279ed428c5a2560b2441b3079ddb34b</id>
<content type='text'>
An integer overflow in length calculation could lead to
under-allocation and buffer overcopy.

Signed-off-by: Timo tp Preißl &lt;t.preissl@proton.me&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
Reviewed-by: Simon Glass &lt;simon.glass@canonical.com&gt;
Reviewed-by: João Marcos Costa &lt;joaomarcos.costa@bootlin.com&gt;
</content>
</entry>
<entry>
<title>fs/squashfs: Ensure memory is freed by using unwind goto</title>
<updated>2025-10-10T20:27:49Z</updated>
<author>
<name>Andrew Goodbody</name>
<email>andrew.goodbody@linaro.org</email>
</author>
<published>2025-10-02T10:36:09Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=87b7eaf3244e1a991404602c3422a4ce06bfae55'/>
<id>urn:sha1:87b7eaf3244e1a991404602c3422a4ce06bfae55</id>
<content type='text'>
Returning immediately from sqfs_read_nest is not consistent with other
error checks in this function and can lead to memory leaks. Instead use
the unwind goto used elsewhere to ensure that the memory is freed.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
Acked-by: Quentin Schulz &lt;quentin.schulz@cherry.de&gt;
Reviewed-by: Joao Marcos Costa &lt;joaomarcos.costa@bootlin.com&gt;
</content>
</entry>
<entry>
<title>fs/squashfs: avoid illegal free() in sqfs_opendir()</title>
<updated>2025-04-21T17:08:03Z</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2025-04-14T13:19:24Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=185fdf5e94731df05748b1c576effb52ff7a3ec5'/>
<id>urn:sha1:185fdf5e94731df05748b1c576effb52ff7a3ec5</id>
<content type='text'>
* Use calloc() to allocate token_list. This avoids an illegal free if
  sqfs_tokenize() fails.
* Do not iterate over token_list if it has not been allocated.

Addresses-Coverity-ID: 510453:  Null pointer dereferences  (FORWARD_NULL)
Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Reviewed-by: Joao Marcos Costa &lt;joaomarcos.costa@bootlin.com&gt;
Reviewed-by: Joao Marcos Costa &lt;jmcosta944@gmail.com&gt;
</content>
</entry>
<entry>
<title>fs/squashfs: Fix memory leak in sqfs_size_nest()</title>
<updated>2025-03-05T18:14:31Z</updated>
<author>
<name>Andrea della Porta</name>
<email>andrea.porta@suse.com</email>
</author>
<published>2025-03-02T18:29:31Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=e22b2d778106256b44e8ed32e6ad7a5d8fff3ebd'/>
<id>urn:sha1:e22b2d778106256b44e8ed32e6ad7a5d8fff3ebd</id>
<content type='text'>
In case MAX_SYMLINK_NEST is reached while determining the size
on a symlink node, the function returns immediately.
This would not free the resources after the free_strings: label
causing a memory leak.

Set the ret value and just break out of the switch to fix this.

Signed-off-by: Andrea della Porta &lt;andrea.porta@suse.com&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
</entry>
<entry>
<title>fs/squashfs: fix potential integer overflows</title>
<updated>2025-02-24T14:49:04Z</updated>
<author>
<name>Joao Marcos Costa</name>
<email>joaomarcos.costa@bootlin.com</email>
</author>
<published>2025-02-19T10:16:33Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=59fd62d71c6a04b3ab9db848414a7c386cfd2cfb'/>
<id>urn:sha1:59fd62d71c6a04b3ab9db848414a7c386cfd2cfb</id>
<content type='text'>
The length of buffers used to read inode tables, directory tables, and
reading a file are calculated as: number of blocks * block size, and
such plain multiplication is prone to overflowing (thus unsafe).

Replace it by __builtin_mul_overflow, i.e. safe math.

Signed-off-by: Joao Marcos Costa &lt;joaomarcos.costa@bootlin.com&gt;
</content>
</entry>
<entry>
<title>squashfs: Fix heap corruption in sqfs_search_dir()</title>
<updated>2024-08-15T22:14:36Z</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2024-08-02T20:05:09Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=048d795bb5b3d9c5701b4855f5e74bcf6849bf5e'/>
<id>urn:sha1:048d795bb5b3d9c5701b4855f5e74bcf6849bf5e</id>
<content type='text'>
res needs to be large enough to store both strings rem and target,
plus the path separator and the terminator.
Currently the space for the path separator is not accounted, so
the heap is corrupted by one byte.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
</entry>
<entry>
<title>squashfs: Fix stack overflow while symlink resolving</title>
<updated>2024-08-15T22:14:36Z</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2024-08-02T16:36:47Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=4f5cc096bfd0a591f8a11e86999e3d90a9484c34'/>
<id>urn:sha1:4f5cc096bfd0a591f8a11e86999e3d90a9484c34</id>
<content type='text'>
The squashfs driver blindly follows symlinks, and calls sqfs_size()
recursively. So an attacker can create a crafted filesystem and with
a deep enough nesting level a stack overflow can be achieved.

Fix by limiting the nesting level to 8.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
</entry>
</feed>
