<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/lib/lz4, branch linux-4.3.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.3.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.3.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2015-05-24T18:56:29Z</updated>
<entry>
<title>lz4: fix system halt at boot kernel on x86_64</title>
<updated>2015-05-24T18:56:29Z</updated>
<author>
<name>Krzysztof Kolasa</name>
<email>kkolasa@winsoft.pl</email>
</author>
<published>2015-05-04T03:58:59Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=99b7e93c95c78952724a9783de6c78def8fbfc3f'/>
<id>urn:sha1:99b7e93c95c78952724a9783de6c78def8fbfc3f</id>
<content type='text'>
Sometimes, on x86_64, decompression fails with the following
error:

Decompressing Linux...

Decoding failed

 -- System halted

This condition is not needed for a 64bit kernel(from commit d5e7caf):

if( ... ||
    (op + COPYLENGTH) &gt; oend)
    goto _output_error

macro LZ4_SECURE_COPY() tests op and does not copy any data
when op exceeds the value.

added by analogy to lz4_uncompress_unknownoutputsize(...)

Signed-off-by: Krzysztof Kolasa &lt;kkolasa@winsoft.pl&gt;
Tested-by: Alexander Kuleshov &lt;kuleshovmail@gmail.com&gt;
Tested-by: Caleb Jorden &lt;cjorden@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>lib/lz4: Pull out constant tables</title>
<updated>2015-03-25T14:04:57Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2015-02-10T10:12:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=bea2b592fd18eb8ffa3fc4ad380610632d03a38f'/>
<id>urn:sha1:bea2b592fd18eb8ffa3fc4ad380610632d03a38f</id>
<content type='text'>
There's no reason to allocate the dec{32,64}table on the stack; it
just wastes a bunch of instructions setting them up and, of course,
also consumes quite a bit of stack. Using size_t for such small
integers is a little excessive.

$ scripts/bloat-o-meter /tmp/built-in.o lib/built-in.o
add/remove: 2/2 grow/shrink: 2/0 up/down: 1304/-1548 (-244)
function                                     old     new   delta
lz4_decompress_unknownoutputsize              55     718    +663
lz4_decompress                                55     632    +577
dec64table                                     -      32     +32
dec32table                                     -      32     +32
lz4_uncompress                               747       -    -747
lz4_uncompress_unknownoutputsize             801       -    -801

The now inlined lz4_uncompress functions used to have a stack
footprint of 176 bytes (according to -fstack-usage); their inlinees
have increased their stack use from 32 bytes to 48 and 80 bytes,
respectively.

Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>LZ4 : fix the data abort issue</title>
<updated>2015-03-16T20:55:35Z</updated>
<author>
<name>JeHyeon Yeon</name>
<email>tom.yeon@windriver.com</email>
</author>
<published>2015-03-16T01:03:19Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d5e7cafd69da24e6d6cc988fab6ea313a2577efc'/>
<id>urn:sha1:d5e7cafd69da24e6d6cc988fab6ea313a2577efc</id>
<content type='text'>
If the part of the compression data are corrupted, or the compression
data is totally fake, the memory access over the limit is possible.

This is the log from my system usning lz4 decompression.
   [6502]data abort, halting
   [6503]r0  0x00000000 r1  0x00000000 r2  0xdcea0ffc r3  0xdcea0ffc
   [6509]r4  0xb9ab0bfd r5  0xdcea0ffc r6  0xdcea0ff8 r7  0xdce80000
   [6515]r8  0x00000000 r9  0x00000000 r10 0x00000000 r11 0xb9a98000
   [6522]r12 0xdcea1000 usp 0x00000000 ulr 0x00000000 pc  0x820149bc
   [6528]spsr 0x400001f3
and the memory addresses of some variables at the moment are
    ref:0xdcea0ffc, op:0xdcea0ffc, oend:0xdcea1000

As you can see, COPYLENGH is 8bytes, so @ref and @op can access the momory
over @oend.

Signed-off-by: JeHyeon Yeon &lt;tom.yeon@windriver.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>lz4: add overrun checks to lz4_uncompress_unknownoutputsize()</title>
<updated>2014-07-03T23:12:04Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2014-07-03T23:06:57Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4a3a99045177369700c60d074c0e525e8093b0fc'/>
<id>urn:sha1:4a3a99045177369700c60d074c0e525e8093b0fc</id>
<content type='text'>
Jan points out that I forgot to make the needed fixes to the
lz4_uncompress_unknownoutputsize() function to mirror the changes done
in lz4_decompress() with regards to potential pointer overflows.

The only in-kernel user of this function is the zram code, which only
takes data from a valid compressed buffer that it made itself, so it's
not a big issue.  But due to external kernel modules using this
function, it's better to be safe here.

Reported-by: Jan Beulich &lt;JBeulich@suse.com&gt;
Cc: "Don A. Bailey" &lt;donb@securitymouse.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>lz4: fix another possible overrun</title>
<updated>2014-06-27T18:21:07Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2014-06-24T20:59:01Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4148c1f67abf823099b2d7db6851e4aea407f5ee'/>
<id>urn:sha1:4148c1f67abf823099b2d7db6851e4aea407f5ee</id>
<content type='text'>
There is one other possible overrun in the lz4 code as implemented by
Linux at this point in time (which differs from the upstream lz4
codebase, but will get synced at in a future kernel release.)  As
pointed out by Don, we also need to check the overflow in the data
itself.

While we are at it, replace the odd error return value with just a
"simple" -1 value as the return value is never used for anything other
than a basic "did this work or not" check.

Reported-by: "Don A. Bailey" &lt;donb@securitymouse.com&gt;
Reported-by: Willy Tarreau &lt;w@1wt.eu&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>lz4: ensure length does not wrap</title>
<updated>2014-06-23T18:12:01Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2014-06-21T05:01:41Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=206204a1162b995e2185275167b22468c00d6b36'/>
<id>urn:sha1:206204a1162b995e2185275167b22468c00d6b36</id>
<content type='text'>
Given some pathologically compressed data, lz4 could possibly decide to
wrap a few internal variables, causing unknown things to happen.  Catch
this before the wrapping happens and abort the decompression.

Reported-by: "Don A. Bailey" &lt;donb@securitymouse.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>lz4: fix compression/decompression signedness mismatch</title>
<updated>2013-09-11T22:59:45Z</updated>
<author>
<name>Sergey Senozhatsky</name>
<email>sergey.senozhatsky@gmail.com</email>
</author>
<published>2013-09-11T21:26:32Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b34081f1cd59585451efaa69e1dff1b9507e6c89'/>
<id>urn:sha1:b34081f1cd59585451efaa69e1dff1b9507e6c89</id>
<content type='text'>
LZ4 compression and decompression functions require different in
signedness input/output parameters: unsigned char for compression and
signed char for decompression.

Change decompression API to require "(const) unsigned char *".

Signed-off-by: Sergey Senozhatsky &lt;sergey.senozhatsky@gmail.com&gt;
Cc: Kyungsik Lee &lt;kyungsik.lee@lge.com&gt;
Cc: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Cc: Yann Collet &lt;yann.collet.73@gmail.com&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/lz4: correct the LZ4 license</title>
<updated>2013-08-23T16:51:22Z</updated>
<author>
<name>Richard Laager</name>
<email>rlaager@wiktel.com</email>
</author>
<published>2013-08-22T23:35:47Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ee8a99bdb47f32327bdfaffe35b900ca7161ba4e'/>
<id>urn:sha1:ee8a99bdb47f32327bdfaffe35b900ca7161ba4e</id>
<content type='text'>
The LZ4 code is listed as using the "BSD 2-Clause License".

Signed-off-by: Richard Laager &lt;rlaager@wiktel.com&gt;
Acked-by: Kyungsik Lee &lt;kyungsik.lee@lge.com&gt;
Cc: Chanho Min &lt;chanho.min@lge.com&gt;
Cc: Richard Yao &lt;ryao@gentoo.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
[ The 2-clause BSD can be just converted into GPL, but that's rude and
  pointless, so don't do it   - Linus ]
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib: add lz4 compressor module</title>
<updated>2013-07-09T17:33:30Z</updated>
<author>
<name>Chanho Min</name>
<email>chanho.min@lge.com</email>
</author>
<published>2013-07-08T23:01:49Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c72ac7a1a926dbffb59daf0f275450e5eecce16f'/>
<id>urn:sha1:c72ac7a1a926dbffb59daf0f275450e5eecce16f</id>
<content type='text'>
This patchset is for supporting LZ4 compression and the crypto API using
it.

As shown below, the size of data is a little bit bigger but compressing
speed is faster under the enabled unaligned memory access.  We can use
lz4 de/compression through crypto API as well.  Also, It will be useful
for another potential user of lz4 compression.

lz4 Compression Benchmark:
Compiler: ARM gcc 4.6.4
ARMv7, 1 GHz based board
   Kernel: linux 3.4
   Uncompressed data Size: 101 MB
         Compressed Size  compression Speed
   LZO   72.1MB		  32.1MB/s, 33.0MB/s(UA)
   LZ4   75.1MB		  30.4MB/s, 35.9MB/s(UA)
   LZ4HC 59.8MB		   2.4MB/s,  2.5MB/s(UA)
- UA: Unaligned memory Access support
- Latest patch set for LZO applied

This patch:

Add support for LZ4 compression in the Linux Kernel.  LZ4 Compression APIs
for kernel are based on LZ4 implementation by Yann Collet and were changed
for kernel coding style.

LZ4 homepage : http://fastcompression.blogspot.com/p/lz4.html
LZ4 source repository : http://code.google.com/p/lz4/
svn revision : r90

Two APIs are added:

lz4_compress() support basic lz4 compression whereas lz4hc_compress()
support high compression or CPU performance get lower but compression
ratio get higher.  Also, we require the pre-allocated working memory with
the defined size and destination buffer must be allocated with the size of
lz4_compressbound.

[akpm@linux-foundation.org: make lz4_compresshcctx() static]
Signed-off-by: Chanho Min &lt;chanho.min@lge.com&gt;
Cc: "Darrick J. Wong" &lt;djwong@us.ibm.com&gt;
Cc: Bob Pearson &lt;rpearson@systemfabricworks.com&gt;
Cc: Richard Weinberger &lt;richard@nod.at&gt;
Cc: Herbert Xu &lt;herbert@gondor.hengli.com.au&gt;
Cc: Yann Collet &lt;yann.collet.73@gmail.com&gt;
Cc: Kyungsik Lee &lt;kyungsik.lee@lge.com&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: add support for LZ4-compressed kernel</title>
<updated>2013-07-09T17:33:30Z</updated>
<author>
<name>Kyungsik Lee</name>
<email>kyungsik.lee@lge.com</email>
</author>
<published>2013-07-08T23:01:46Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e76e1fdfa8f8dc1ea6699923cf5d92b5bee9c936'/>
<id>urn:sha1:e76e1fdfa8f8dc1ea6699923cf5d92b5bee9c936</id>
<content type='text'>
Add support for extracting LZ4-compressed kernel images, as well as
LZ4-compressed ramdisk images in the kernel boot process.

Signed-off-by: Kyungsik Lee &lt;kyungsik.lee@lge.com&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Russell King &lt;rmk@arm.linux.org.uk&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Florian Fainelli &lt;florian@openwrt.org&gt;
Cc: Yann Collet &lt;yann.collet.73@gmail.com&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>
</feed>
