<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/lib/xz, branch v4.14.302</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.14.302</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.14.302'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2021-11-26T10:40:28+00:00</updated>
<entry>
<title>lib/xz: Validate the value before assigning it to an enum variable</title>
<updated>2021-11-26T10:40:28+00:00</updated>
<author>
<name>Lasse Collin</name>
<email>lasse.collin@tukaani.org</email>
</author>
<published>2021-10-10T21:31:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6fd086ac407a2c3aa595e0889a31179c9aa1935e'/>
<id>urn:sha1:6fd086ac407a2c3aa595e0889a31179c9aa1935e</id>
<content type='text'>
[ Upstream commit 4f8d7abaa413c34da9d751289849dbfb7c977d05 ]

This might matter, for example, if the underlying type of enum xz_check
was a signed char. In such a case the validation wouldn't have caught an
unsupported header. I don't know if this problem can occur in the kernel
on any arch but it's still good to fix it because some people might copy
the XZ code to their own projects from Linux instead of the upstream
XZ Embedded repository.

This change may increase the code size by a few bytes. An alternative
would have been to use an unsigned int instead of enum xz_check but
using an enumeration looks cleaner.

Link: https://lore.kernel.org/r/20211010213145.17462-3-xiang@kernel.org
Signed-off-by: Lasse Collin &lt;lasse.collin@tukaani.org&gt;
Signed-off-by: Gao Xiang &lt;hsiangkao@linux.alibaba.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>lib/xz: Avoid overlapping memcpy() with invalid input with in-place decompression</title>
<updated>2021-11-26T10:40:28+00:00</updated>
<author>
<name>Lasse Collin</name>
<email>lasse.collin@tukaani.org</email>
</author>
<published>2021-10-10T21:31:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f1e0a848a9ab317fd813d84d467a121f96a09756'/>
<id>urn:sha1:f1e0a848a9ab317fd813d84d467a121f96a09756</id>
<content type='text'>
[ Upstream commit 83d3c4f22a36d005b55f44628f46cc0d319a75e8 ]

With valid files, the safety margin described in lib/decompress_unxz.c
ensures that these buffers cannot overlap. But if the uncompressed size
of the input is larger than the caller thought, which is possible when
the input file is invalid/corrupt, the buffers can overlap. Obviously
the result will then be garbage (and usually the decoder will return
an error too) but no other harm will happen when such an over-run occurs.

This change only affects uncompressed LZMA2 chunks and so this
should have no effect on performance.

Link: https://lore.kernel.org/r/20211010213145.17462-2-xiang@kernel.org
Signed-off-by: Lasse Collin &lt;lasse.collin@tukaani.org&gt;
Signed-off-by: Gao Xiang &lt;hsiangkao@linux.alibaba.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>lib/xz: enable all filters by default in Kconfig</title>
<updated>2014-06-04T23:54:18+00:00</updated>
<author>
<name>Lasse Collin</name>
<email>lasse.collin@tukaani.org</email>
</author>
<published>2014-06-04T23:11:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bf4d064d89aebe3cc43d875c0803478a6a1dde12'/>
<id>urn:sha1:bf4d064d89aebe3cc43d875c0803478a6a1dde12</id>
<content type='text'>
This restores the old behavior that existed before 2013-02-22, when
changes were made by 64dbfb444c150 ("decompressors: drop dependency on
CONFIG_EXPERT") and 5dc49c75a2 ("decompressors: make the default
XZ_DEC_* config match the selected architecture").

Disabling the filters only makes sense on embedded systems.

Signed-off-by: Lasse Collin &lt;lasse.collin@tukaani.org&gt;
Acked-by: Kyle McMartin &lt;kyle@infradead.org&gt;
Cc: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Cc: Phillip Lougher &lt;phillip@lougher.demon.co.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/xz: add comments for the intentionally missing break statements</title>
<updated>2014-06-04T23:54:18+00:00</updated>
<author>
<name>Lasse Collin</name>
<email>lasse.collin@tukaani.org</email>
</author>
<published>2014-06-04T23:11:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=84d517f3e56f7d0d305c14a701cee8f7372ebe1e'/>
<id>urn:sha1:84d517f3e56f7d0d305c14a701cee8f7372ebe1e</id>
<content type='text'>
Signed-off-by: Lasse Collin &lt;lasse.collin@tukaani.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>decompressors: fix typo "POWERPC"</title>
<updated>2013-03-13T22:21:48+00:00</updated>
<author>
<name>Paul Bolle</name>
<email>pebolle@tiscali.nl</email>
</author>
<published>2013-03-13T21:59:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=97da55fcec6e3898f50010a6847dfa64f7c085e6'/>
<id>urn:sha1:97da55fcec6e3898f50010a6847dfa64f7c085e6</id>
<content type='text'>
Commit 5dc49c75a26b ("decompressors: make the default XZ_DEC_* config
match the selected architecture") added

	default y if POWERPC

to lib/xz/Kconfig.  But there is no Kconfig symbol POWERPC.  The most
general Kconfig symbol for the powerpc architecture is PPC.  So let's
use that.

Signed-off-by: Paul Bolle &lt;pebolle@tiscali.nl&gt;
Cc: Florian Fainelli &lt;florian@openwrt.org&gt;
Cc: Lasse Collin &lt;lasse.collin@tukaani.org&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>decompressors: make the default XZ_DEC_* config match the selected architecture</title>
<updated>2013-02-22T01:22:26+00:00</updated>
<author>
<name>Florian Fainelli</name>
<email>florian@openwrt.org</email>
</author>
<published>2013-02-22T00:44:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5dc49c75a26b99e86a18441e0b64c1f7c7c6a500'/>
<id>urn:sha1:5dc49c75a26b99e86a18441e0b64c1f7c7c6a500</id>
<content type='text'>
Change the defautl XZ_DEC_* config symbol to match the configured
architecture.  It is perfectly legitimate to support multiple XZ BCJ
filters for different architectures (e.g.: to mount foreign squashfs/xz
compressed filesystems), it is however more natural not to select them all
by default, but only the one matching the configured architecture.

Signed-off-by: Florian Fainelli &lt;florian@openwrt.org&gt;
Acked-by: Lasse Collin &lt;lasse.collin@tukaani.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>decompressors: drop dependency on CONFIG_EXPERT</title>
<updated>2013-02-22T01:22:26+00:00</updated>
<author>
<name>Florian Fainelli</name>
<email>florian@openwrt.org</email>
</author>
<published>2013-02-22T00:44:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=64dbfb444c150f5b64979323a197dedc2ec3e02c'/>
<id>urn:sha1:64dbfb444c150f5b64979323a197dedc2ec3e02c</id>
<content type='text'>
Remove the XZ_DEC_* depedencey on CONFIG_EXPERT as recommended by Lasse
Colin.

Signed-off-by: Florian Fainelli &lt;florian@openwrt.org&gt;
Acked-by: Lasse Collin &lt;lasse.collin@tukaani.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>decompressors: group XZ_DEC_* symbols under an if XZ_BCJ / endif</title>
<updated>2013-02-22T01:22:26+00:00</updated>
<author>
<name>Florian Fainelli</name>
<email>florian@openwrt.org</email>
</author>
<published>2013-02-22T00:44:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9d7496296590d57e0745286711aa31ed1b828917'/>
<id>urn:sha1:9d7496296590d57e0745286711aa31ed1b828917</id>
<content type='text'>
Group all architecture-specific BCJ filter configuration symbols under an
if XZ_BCJ / endif statement.

Signed-off-by: Florian Fainelli &lt;florian@openwrt.org&gt;
Acked-by: Lasse Collin &lt;lasse.collin@tukaani.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>XZ: Fix incorrect XZ_BUF_ERROR</title>
<updated>2011-09-21T20:39:59+00:00</updated>
<author>
<name>Lasse Collin</name>
<email>lasse.collin@tukaani.org</email>
</author>
<published>2011-09-21T14:30:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9c1f8594df4814ebfd6822ca3c9444fb3445888d'/>
<id>urn:sha1:9c1f8594df4814ebfd6822ca3c9444fb3445888d</id>
<content type='text'>
xz_dec_run() could incorrectly return XZ_BUF_ERROR if all of the
following was true:

 - The caller knows how many bytes of output to expect and only provides
   that much output space.

 - When the last output bytes are decoded, the caller-provided input
   buffer ends right before the LZMA2 end of payload marker.  So LZMA2
   won't provide more output anymore, but it won't know it yet and thus
   won't return XZ_STREAM_END yet.

 - A BCJ filter is in use and it hasn't left any unfiltered bytes in the
   temp buffer.  This can happen with any BCJ filter, but in practice
   it's more likely with filters other than the x86 BCJ.

This fixes &lt;https://bugzilla.redhat.com/show_bug.cgi?id=735408&gt; where
Squashfs thinks that a valid file system is corrupt.

This also fixes a similar bug in single-call mode where the uncompressed
size of a block using BCJ + LZMA2 was 0 bytes and caller provided no
output space.  Many empty .xz files don't contain any blocks and thus
don't trigger this bug.

This also tweaks a closely related detail: xz_dec_bcj_run() could call
xz_dec_lzma2_run() to decode into temp buffer when it was known to be
useless.  This was harmless although it wasted a minuscule number of CPU
cycles.

Signed-off-by: Lasse Collin &lt;lasse.collin@tukaani.org&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>XZ: Fix missing &lt;linux/kernel.h&gt; include</title>
<updated>2011-07-24T17:00:08+00:00</updated>
<author>
<name>Lasse Collin</name>
<email>lasse.collin@tukaani.org</email>
</author>
<published>2011-07-24T16:54:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=81d67439855a7f928d90965d832aa4f2fb677342'/>
<id>urn:sha1:81d67439855a7f928d90965d832aa4f2fb677342</id>
<content type='text'>
&lt;linux/kernel.h&gt; is needed for min_t. The old version
happened to work on x86 because &lt;asm/unaligned.h&gt;
indirectly includes &lt;linux/kernel.h&gt;, but it didn't
work on ARM.

&lt;linux/kernel.h&gt; includes &lt;asm/byteorder.h&gt; so it's
not necessary to include it explicitly anymore.

Signed-off-by: Lasse Collin &lt;lasse.collin@tukaani.org&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
