<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/fs/squashfs, branch v2025.04</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/fs/squashfs?h=v2025.04</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/fs/squashfs?h=v2025.04'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2025-03-05T18:14:31Z</updated>
<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 sqfs_inode_size() for xattr related SQFS_LSYMLINK_TYPE</title>
<updated>2025-01-18T14:29:10Z</updated>
<author>
<name>Norbert van Bolhuis</name>
<email>nvbolhuis@gmail.com</email>
</author>
<published>2024-12-24T00:49:04Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=bbfa4fe13ca7645bd3033513dda48920e7c25542'/>
<id>urn:sha1:bbfa4fe13ca7645bd3033513dda48920e7c25542</id>
<content type='text'>
A squashfs filesystem with extended attributes (xattrs) may have
inodes of type SQFS_LSYMLINK_TYPE. This might cause u-boot to fail to
handle the filesystem since it assumes a SYMLINK_TYPE and LSYMLINK_TYPE
inode are the same size. This is wrong, see:
https://github.com/plougher/squashfs-tools/blob/master/squashfs-tools/read_fs.c#L421

Using the mksquashfs '-no-xattrs' argument is probably best, but the
mksquashfs '-xattrs' argument is the default.
This patch fixes squashfs image handling by making sure parsing the
uncompressed inode_table (with sqfs_find_inode) succeeeds. The only change
needed is correctly determining the size of a SQFS_LSYMLINK_TYPE inode.

Signed-off-by: Norbert van Bolhuis &lt;nvbolhuis@gmail.com&gt;
</content>
</entry>
<entry>
<title>global: Rename SPL_ to XPL_</title>
<updated>2024-10-11T17:44:48Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2024-09-30T01:49:53Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c46760d5967d12b6f7d37402878d1607a98b2b84'/>
<id>urn:sha1:c46760d5967d12b6f7d37402878d1607a98b2b84</id>
<content type='text'>
Use XPL_ as the symbol to indicate an SPL build. This means that SPL_ is
no-longer set.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&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>
<entry>
<title>squashfs: Check sqfs_find_inode() return value</title>
<updated>2024-08-15T22:14:36Z</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2024-08-02T16:36:46Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3fb1df1e57ee26f4b92932de804ef265e5ae0d3b'/>
<id>urn:sha1:3fb1df1e57ee26f4b92932de804ef265e5ae0d3b</id>
<content type='text'>
The function can fail and return NULL.

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 integer overflow in sqfs_inode_size()</title>
<updated>2024-08-15T22:14:36Z</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2024-08-02T16:36:45Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c8e929e5758999933f9e905049ef2bf3fe6b140d'/>
<id>urn:sha1:c8e929e5758999933f9e905049ef2bf3fe6b140d</id>
<content type='text'>
A carefully crafted squashfs filesystem can exhibit an extremly large
inode size and overflow the calculation in sqfs_inode_size().
As a consequence, the squashfs driver will read from wrong locations.

Fix by using __builtin_add_overflow() to detect the overflow.

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 integer overflow in sqfs_resolve_symlink()</title>
<updated>2024-08-15T22:14:36Z</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2024-08-02T16:36:44Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=233945eba63e24061dffeeaeb7cd6fe985278356'/>
<id>urn:sha1:233945eba63e24061dffeeaeb7cd6fe985278356</id>
<content type='text'>
A carefully crafted squashfs filesystem can exhibit an inode size of 0xffffffff,
as a consequence malloc() will do a zero allocation.
Later in the function the inode size is again used for copying data.
So an attacker can overwrite memory.
Avoid the overflow by using the __builtin_add_overflow() helper.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
</entry>
<entry>
<title>fs/squashfs: enable LZ4 compression support</title>
<updated>2023-11-16T23:53:09Z</updated>
<author>
<name>David Oberhollenzer</name>
<email>goliath@infraroot.at</email>
</author>
<published>2023-11-06T10:14:03Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=fa894a36a9090c53050cf0e9cf186c4521209974'/>
<id>urn:sha1:fa894a36a9090c53050cf0e9cf186c4521209974</id>
<content type='text'>
The structure is identical to the existing compressor implementations,
trivially adding lz4 decompression to sqfs_decompress.

The changes were tested using a sandbox build. An LZ4 compressed
squashfs image was bound as a host block device.

Signed-off-by: David Oberhollenzer &lt;goliath@infraroot.at&gt;
Reviewed-by: Joao Marcos Costa &lt;jmcosta944@gmail.com&gt;
</content>
</entry>
</feed>
