<feed xmlns='http://www.w3.org/2005/Atom'>
<title>squashfs-tools-ng.git/lib/fstree, branch fixes-1.1.0</title>
<subtitle>A new set of tools and libraries for working with SquashFS images</subtitle>
<id>https://git.infraroot.at/squashfs-tools-ng.git/atom?h=fixes-1.1.0</id>
<link rel='self' href='https://git.infraroot.at/squashfs-tools-ng.git/atom?h=fixes-1.1.0'/>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/'/>
<updated>2022-08-19T16:54:24+00:00</updated>
<entry>
<title>Fix: libfstree: double free in error path</title>
<updated>2022-08-19T16:54:24+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2022-08-19T16:54:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=b5477cf2abdd76e22d227bd3959c7150251fafc0'/>
<id>urn:sha1:b5477cf2abdd76e22d227bd3959c7150251fafc0</id>
<content type='text'>
If fstree_mknode fails, because the parent link count would overflow,
the function fails and cleans up behind it. The problem arises because
the function does this check *after* inserting the node in the parent
node, so it is later free'd again, when destroying the rest of the
tree.

This patch moves the insertion after the check to mitigate the problem.

Reported-by: Marvin Renich &lt;mrvn@renich.org&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Fix: libfstree: actually use a full 32 bit hard link counter</title>
<updated>2022-08-19T16:47:52+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2022-07-08T15:08:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=ce3a783daaa9b8f50d71cb3ac108e39002358a1e'/>
<id>urn:sha1:ce3a783daaa9b8f50d71cb3ac108e39002358a1e</id>
<content type='text'>
The squashfs on-disk format uses 32 bit link counters, but the fstree
used 16 bit ones. Because the link count also includes child nodes,
this artificially limited the number of entries in a directory to ~64k
files.

This patch removes the limit by switching libfstree to 32 bit counters.

Reported-by: Marvin Renich &lt;mrvn@renich.org&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>libfstree: guard against possible overflow in readlink()</title>
<updated>2021-06-25T13:12:41+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-06-24T14:04:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=b409ddcec8c7ae304a7985e450b723fbb95cf4e9'/>
<id>urn:sha1:b409ddcec8c7ae304a7985e450b723fbb95cf4e9</id>
<content type='text'>
*in theory*, say on a 32 bit system, we could have a 32 bit size_t and
a 64 bit off_t. If the filesystem permitted this, we *could* then have
a symlink with a target &gt; 4G. Or the target is exacetely 4G, but
adding a null-terminator could exceed addressable memory.

This commit adds a check to guard against such an overflow and throw
an error, instead of silently wrapping around.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>libfstree: guard against link count and inode number overflow</title>
<updated>2021-06-25T13:12:41+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-06-24T12:47:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=e567e9c5df1b0b9781d9e2a625c22302005cd95e'/>
<id>urn:sha1:e567e9c5df1b0b9781d9e2a625c22302005cd95e</id>
<content type='text'>
If the hard link counter or the inode number counter overflow the
maximum representable value (for SquashFS 16 bit and 32 bit
respecitively), abort with an error message.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>libfstree: allow the glob path to be empty</title>
<updated>2021-03-25T15:37:41+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-03-25T15:33:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=7d2b3b077d7e204e64a1c57845524250c5b4a142'/>
<id>urn:sha1:7d2b3b077d7e204e64a1c57845524250c5b4a142</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>libfstree: add an assertion that root is not NULL</title>
<updated>2021-03-25T13:49:52+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-03-25T13:49:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=b0f6ab7ff26c1152ee4894a86f69b183cfabe94f'/>
<id>urn:sha1:b0f6ab7ff26c1152ee4894a86f69b183cfabe94f</id>
<content type='text'>
If the path argument is "", we assume that referes to root and set
the *existing* target node to the root node and skip ahead across
the tree search. This leaves "name" uninitialized, which makes
coverity panic, because fs-&gt;root could be NULL, going down the wrong
path.

Obviously, this should never, *ever* happen and there is no reasonable
recovery strategy if it suddenly does, so simply add an assertion.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>libfstree: Allow / as argument for "glob" and "dir" commands</title>
<updated>2021-03-25T13:35:39+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-03-25T13:23:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=b0b88d26c9df6d336167f87ce926bba9b56f6af0'/>
<id>urn:sha1:b0b88d26c9df6d336167f87ce926bba9b56f6af0</id>
<content type='text'>
This allows putting globbed files &amp; directories into the filesystem
root, as well as explicitly setting attributes of the root directory
from the file lisiting.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>libfstree: implement directory scanning code for Windows</title>
<updated>2021-03-24T08:59:07+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-03-20T22:42:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=42214e1bd028f68b6194d3588d09899015ea163c'/>
<id>urn:sha1:42214e1bd028f68b6194d3588d09899015ea163c</id>
<content type='text'>
It's rather simplistic and doesn't account for junction/reparse
points, which is the closest thing Windows has to symlinks, hard
links and mount points, but it's consistent with the unpacking code
that assumes Windows only has files and directories.

Using the 32 bit mingw toolchain, this seems to satisfy the unit
tests on wine.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Add libcompat fallback implementation for fnmatch</title>
<updated>2021-03-20T16:46:14+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-03-20T16:35:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=e678bd4b4289e536e998057bf9a9cf415f21b74c'/>
<id>urn:sha1:e678bd4b4289e536e998057bf9a9cf415f21b74c</id>
<content type='text'>
This has basically been copied over from Musl and slightly modifed.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Fix: libfstree: add an assert the canonicalize_name return value</title>
<updated>2021-02-19T18:51:58+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-02-19T18:51:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=711650ee7c0799c56c177dd363fe43dc9492c3aa'/>
<id>urn:sha1:711650ee7c0799c56c177dd363fe43dc9492c3aa</id>
<content type='text'>
Since the canonicalize_name function only fails if the path
contains ".." and the one we are constructing from the scanned
fstree (built using canonicalized names), it should NEVER fail.

However, coverity does get concerned, because we are checking the
return value elesewhere. So do what we do at other, similar locations
and add an assert().

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
</feed>
