<feed xmlns='http://www.w3.org/2005/Atom'>
<title>squashfs-tools-ng.git/lib, branch v0.6.1</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=v0.6.1</id>
<link rel='self' href='https://git.infraroot.at/squashfs-tools-ng.git/atom?h=v0.6.1'/>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/'/>
<updated>2019-08-27T11:05:26+00:00</updated>
<entry>
<title>Merge alloc_flex conditionals into one</title>
<updated>2019-08-27T11:05:26+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-08-27T11:05:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=e7234ec4679c70a2f79e60ecb6f7a6fac1772fca'/>
<id>urn:sha1:e7234ec4679c70a2f79e60ecb6f7a6fac1772fca</id>
<content type='text'>
It is shorter and less confusing for coverity.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Tune the paranoia down a bit</title>
<updated>2019-08-26T07:20:31+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-08-26T07:13:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=f5c0f0c75181d5e7fa56d11fa59a32a1c088020a'/>
<id>urn:sha1:f5c0f0c75181d5e7fa56d11fa59a32a1c088020a</id>
<content type='text'>
size_t is guaranteed to be large enough to measure the size of things in
memory, so when doing exactely that (e.g. strlen(a) + strlen(b)), checking
for overflow is pointless since both objects are already in memory. If the
addition would overflow, the two strings would occupy more memory than
addressable.

(Possible exception being some kind of harward style architecture with
the two strings being in different kinds of memory of course.)

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Propperly set errno in read_inode_slink error path</title>
<updated>2019-08-25T11:47:25+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-08-25T08:25:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=14f02a946b875459db8b4290d316e7a99c6d9f75'/>
<id>urn:sha1:14f02a946b875459db8b4290d316e7a99c6d9f75</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Size accounting + alloc() overflow checking, round #3</title>
<updated>2019-08-25T11:47:25+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-08-25T11:47:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=d3e387eb9c38650a0698bbaf39a0621027f92c45'/>
<id>urn:sha1:d3e387eb9c38650a0698bbaf39a0621027f92c45</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Check against format limits in meta_reader_read_dir_header</title>
<updated>2019-08-23T11:44:13+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-08-23T11:25:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=e31c0fcd809a649b70e6bab08a8b89f9ced07510'/>
<id>urn:sha1:e31c0fcd809a649b70e6bab08a8b89f9ced07510</id>
<content type='text'>
The SquashFS kernel implementation insists that a directory header is
followed by no more than an upper bound of entries, way less than what
the filed itself actually supports.

This commit makes sure that the meta_reader_read_dir_header function
also enforces that same limit.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Size accounting + alloc() overflow checking, round #2</title>
<updated>2019-08-23T11:44:13+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-08-23T11:23:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=a38b1cbc5e917d945340a6dd9dba4274a2eb8789'/>
<id>urn:sha1:a38b1cbc5e917d945340a6dd9dba4274a2eb8789</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Do bounds checking in metadata reader</title>
<updated>2019-08-23T10:10:16+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-08-23T10:10:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=029a8db2701afb0653c6e789c878bb768ceb87e1'/>
<id>urn:sha1:029a8db2701afb0653c6e789c878bb768ceb87e1</id>
<content type='text'>
In all cases where metadata blocks are read, we can roughly (in some
cases even preciesly) say in what range those metadata blocks will be,
so it makes sense to throw an error if an attempt is made to wander
outside this range.

Furthermore, when reading from an uncompressed block, it is more reasonable
to check against the actual block bounds than to padd it with 0 bytes.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Some simple search/replace cases for allocation</title>
<updated>2019-08-23T00:09:51+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-08-22T23:33:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=7c028e224978e1d5a4f207cc42b9eb58d81897dd'/>
<id>urn:sha1:7c028e224978e1d5a4f207cc42b9eb58d81897dd</id>
<content type='text'>
This commit exchanges some malloc(x + y * z) patterns that can be found
with a simple git grep and are obvious for the new wrappers.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Add wrappers for calloc style functions with size overflow checking</title>
<updated>2019-08-23T00:06:31+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-08-22T23:29:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=0a5383ccdf8e87d2259d02a9ff44420b3bc3f58d'/>
<id>urn:sha1:0a5383ccdf8e87d2259d02a9ff44420b3bc3f58d</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>deserialize_tree: filter out directory loops</title>
<updated>2019-08-22T16:24:26+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-08-22T14:33:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=8b16efb80d9a863641a0a7395204df038feeb56c'/>
<id>urn:sha1:8b16efb80d9a863641a0a7395204df038feeb56c</id>
<content type='text'>
The tree deserializer does a recursive depth-first search to populate
the directory tree, moving back and forth between the directory listing
containing the inode references and the inode table pointing to the
list of child inodes. It is completely unaware of hard links and creates
duplicate nodes instead.

It is possible to create a malicious SquashFS image that contains a
directory that contains as child a reference to its own inode. This
can also be done transitively (i.e. directory contains its own parent
or grand parent), leading to infinite recursion (actually finite, since
it terminates once all stack memory is exhausted).

This commit adds a simple check to see if a node has the same inode
number as any of its would-be parents. If it does, the node is discarded
and a warning message is emitted.

Other cases with arbitrary layers of indirection could be constructed
as well (e.g. dir 'a' contains hard link to 'b' and 'b' one back to 'a'),
but the sub hierarchies are always expanded, this check should catch that
too.

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