<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/fs/squashfs, branch v2022.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=v2022.04</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/fs/squashfs?h=v2022.04'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2022-01-29T12:46:46Z</updated>
<entry>
<title>squashfs: show an error message if the inode_table can't be, allocated</title>
<updated>2022-01-29T12:46:46Z</updated>
<author>
<name>Lars Weber</name>
<email>weber@weber-software.com</email>
</author>
<published>2022-01-13T13:28:45Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1e69db57e64249f7f7a5a282a3a2f1b053be3f6f'/>
<id>urn:sha1:1e69db57e64249f7f7a5a282a3a2f1b053be3f6f</id>
<content type='text'>
Signed-off-by: Lars Weber &lt;weber@weber-software.com&gt;
</content>
</entry>
<entry>
<title>sqfs: Suppress the message about missing filesystem</title>
<updated>2021-09-16T17:19:25Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2021-08-19T03:40:27Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ad6ddc57eeecbcad62177b47b1e2b63027bcf6a9'/>
<id>urn:sha1:ad6ddc57eeecbcad62177b47b1e2b63027bcf6a9</id>
<content type='text'>
This message comes up a lot when scanning filesystems. It suggests to the
user that there is some sort of error, but in fact there is no reason to
expect that a particular partition has a sqfs filesystem. Other
filesystems don't print this error.

Turn it into a debug message.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
</entry>
<entry>
<title>fs/squashfs: Fix some hardlinks reading the wrong inode</title>
<updated>2021-08-04T19:58:31Z</updated>
<author>
<name>Campbell Suter</name>
<email>campbell@snapit.group</email>
</author>
<published>2021-04-30T04:45:46Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=a1ff2cb4d433f983b25a2b2920dbfcea5dc4555c'/>
<id>urn:sha1:a1ff2cb4d433f983b25a2b2920dbfcea5dc4555c</id>
<content type='text'>
In SquashFS, the contents of a directory is stored by
squashfs_directory_entry structures which contain the file's name, inode
and position within the filesystem.

The inode number is not stored directly; instead each directory has one
or more headers which set a base inode number, and files store the
offset from that to the file's inode number.

In mksquashfs, each inode is allocated a number in the same order as
they are written to the directory table; thus the offset from the
header's base inode number to the file's inode number is usually
positive.

Hardlinks are simply stored with two directory entries referencing the
same file. This means the second entry will thus have an inode number
much lower than the surrounding files. Since the header's base inode
number comes from the first entry that uses the header, this delta will
usually be negative.

Previously, U-Boot's squashfs_directory_entry.inode_offset field was
declared as an unsigned value. Thus when a negative value was found, it
would either resolve to an invalid inode number or to that of an
unrelated file.

A squashfs image to test this can be created like so:

    echo hi &gt; sqfs_test_files/001-root-file
    mkdir     sqfs_test_files/002-subdir
    touch     sqfs_test_files/002-subdir/003-file
    ln        sqfs_test_files/{001-root-file,002-subdir/004-link}
    mksquashfs sqfs_test_files/ test.sqfs -noappend

Note that squashfs sorts the files ASCIIbetacally, so we can use the
names to control the order they appear in. The ordering is important -
the first reference to the file must have a lower inode number than the
directory in which the second reference resides, and the second
reference cannot be the first file in the directory.

Listing this sample image in U-Boot results in:

=&gt; sqfsls virtio 2 002-subdir
         0   003-file
Inode not found.
         0   004-link

Signed-off-by: Campbell Suter &lt;campbell@snapit.group&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
</entry>
<entry>
<title>fs/squashfs: fix reading of fragmented files</title>
<updated>2021-06-10T00:58:20Z</updated>
<author>
<name>Joao Marcos Costa</name>
<email>jmcosta944@gmail.com</email>
</author>
<published>2021-05-17T21:20:38Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0008d8086649d3bb3afd0c4697f5b73ccf6f293d'/>
<id>urn:sha1:0008d8086649d3bb3afd0c4697f5b73ccf6f293d</id>
<content type='text'>
The fragmented files were not correctly read because of two issues:

- The squashfs_file_info struct has a field named 'comp', which tells if
the file's fragment is compressed or not. This field was always set to
'true' in sqfs_get_regfile_info and sqfs_get_lregfile_info. It should
actually take sqfs_frag_lookup's return value. This patch addresses
these two assignments.

- In sqfs_read, the fragments (compressed or not) were copied to the
output buffer through a for loop which was reading data at the wrong
offset. Replace these loops by equivalent calls to memcpy, with the
right parameters.

I tested this patch by comparing the MD5 checksum of a few fragmented
files with the respective md5sum output in sandbox, considering both
compressed and uncompressed fragments.

Signed-off-by: Joao Marcos Costa &lt;jmcosta944@gmail.com&gt;
Tested-by: Richard Genoud &lt;richard.genoud@posteo.net&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
</entry>
<entry>
<title>fs/squashfs: zero out unused fields in fs_dirent</title>
<updated>2021-05-26T21:26:07Z</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>xypron.glpk@gmx.de</email>
</author>
<published>2021-05-17T06:21:39Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=53ba2c21c2df142b37bb2f0d6850d79dcfd8976f'/>
<id>urn:sha1:53ba2c21c2df142b37bb2f0d6850d79dcfd8976f</id>
<content type='text'>
When reading directories the UEFI sub-system must supply file attributes
and timestamps. These fields will have to be added to struct fs_dirent.
SquashFS should not fill these fields with random data. Ensure that they
are zeroed out.

Signed-off-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
</entry>
<entry>
<title>fs/squashfs: Fix compilation error</title>
<updated>2021-03-04T19:40:52Z</updated>
<author>
<name>Pali Rohár</name>
<email>pali@kernel.org</email>
</author>
<published>2021-03-03T09:52:36Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=612a201d38b5a443665648057941d8c91c069816'/>
<id>urn:sha1:612a201d38b5a443665648057941d8c91c069816</id>
<content type='text'>
Commit 401d1c4f5d2d29c4bc4beaec95402ca23eb63295 ("common: Drop
asm/global_data.h from common header") broke compilation of squashfs
filesystem when CONFIG_CMD_SQUASHFS=y is enabled.

Compilation is failing on error:

    aarch64-linux-gnu-ld.bfd: u-boot/fs/squashfs/sqfs_inode.c:121: undefined reference to `le32_to_cpu'

Fixes: 401d1c4f5d2d29c4bc4beaec95402ca23eb63295 ("common: Drop asm/global_data.h from common header")
Suggested-by: Tom Rini &lt;trini@konsulko.com&gt;
Signed-off-by: Pali Rohár &lt;pali@kernel.org&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
</entry>
<entry>
<title>fs/squashfs: NULL dereference in sqfs_closedir()</title>
<updated>2021-02-24T21:51:48Z</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>xypron.glpk@gmx.de</email>
</author>
<published>2021-02-01T02:28:48Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=220fa478fb1a84e51235b92506ff5d48415f0a8e'/>
<id>urn:sha1:220fa478fb1a84e51235b92506ff5d48415f0a8e</id>
<content type='text'>
sqfs_opendir() called in sqfs_size(), sqfs_read(), sqfs_exists() may fail
leading to sqfs_closedir(NULL) being called. Do not dereference NULL.

Signed-off-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
</content>
</entry>
<entry>
<title>Fix squashfs failing to load sparse files</title>
<updated>2021-01-20T19:01:44Z</updated>
<author>
<name>Campbell Suter</name>
<email>campbell@snapit.group</email>
</author>
<published>2020-11-23T02:40:03Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=9dba07f14304612ed4ee6d827898aa0cb55d4e26'/>
<id>urn:sha1:9dba07f14304612ed4ee6d827898aa0cb55d4e26</id>
<content type='text'>
SquashFS supports sprase blocks in files - that is, if a given block is
composed only of zeros, it's not written to the output file to save
space and it's on-disk length field is set to zero to indicate that.

Previously the squashfs driver did not recognise that, and would attempt
to read and decompress a zero-sized block, which obviously failed.

The following command may be used to create a file for testing:

cat &lt;(dd if=/dev/urandom of=/dev/stdout bs=1M count=1) \
	&lt;(dd if=/dev/zero of=/dev/stdout bs=1M count=1) \
	&lt;(dd if=/dev/urandom of=/dev/stdout bs=1k count=200) &gt;test_file

Signed-off-by: Campbell Suter &lt;campbell@snapit.group&gt;
</content>
</entry>
<entry>
<title>fs/squashfs: sqfs_close/sqfs_read_sblk: set ctxt.sblk to NULL after free</title>
<updated>2020-12-02T21:21:58Z</updated>
<author>
<name>Richard Genoud</name>
<email>richard.genoud@posteo.net</email>
</author>
<published>2020-11-24T17:07:52Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=7e932ac790b3615a67a3c24041c194aa748c0d98'/>
<id>urn:sha1:7e932ac790b3615a67a3c24041c194aa748c0d98</id>
<content type='text'>
This will prevent a double free error if sqfs_close() is called twice.

Signed-off-by: Richard Genoud &lt;richard.genoud@posteo.net&gt;
</content>
</entry>
<entry>
<title>fs/squashfs: implement exists() function</title>
<updated>2020-11-19T14:45:49Z</updated>
<author>
<name>Richard Genoud</name>
<email>richard.genoud@posteo.net</email>
</author>
<published>2020-11-03T11:11:26Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=dd4866b43754b18f0c06672e341d93e16b8bf674'/>
<id>urn:sha1:dd4866b43754b18f0c06672e341d93e16b8bf674</id>
<content type='text'>
This permits to find a file and use the distro_bootcmd

Reviewed-by: Joao Marcos Costa &lt;jmcosta944@gmail.com&gt;
Signed-off-by: Richard Genoud &lt;richard.genoud@posteo.net&gt;
</content>
</entry>
</feed>
