<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/lib/lz4, branch v4.7</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.7</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.7'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2016-04-13T16:22:49Z</updated>
<entry>
<title>lib: lz4: cleanup unaligned access efficiency detection</title>
<updated>2016-04-13T16:22:49Z</updated>
<author>
<name>Rui Salvaterra</name>
<email>rsalvaterra@gmail.com</email>
</author>
<published>2016-04-09T21:05:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=dea5c24a14047b7d6b6b269434a85ffd05f1d2cb'/>
<id>urn:sha1:dea5c24a14047b7d6b6b269434a85ffd05f1d2cb</id>
<content type='text'>
These identifiers are bogus. The interested architectures should define
HAVE_EFFICIENT_UNALIGNED_ACCESS whenever relevant to do so. If this
isn't true for some arch, it should be fixed in the arch definition.

Signed-off-by: Rui Salvaterra &lt;rsalvaterra@gmail.com&gt;
Reviewed-by: Sergey Senozhatsky &lt;sergey.senozhatsky@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>lib: lz4: fixed zram with lz4 on big endian machines</title>
<updated>2016-04-13T16:22:49Z</updated>
<author>
<name>Rui Salvaterra</name>
<email>rsalvaterra@gmail.com</email>
</author>
<published>2016-04-09T21:05:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3e26a691fe3fe1e02a76e5bab0c143ace4b137b4'/>
<id>urn:sha1:3e26a691fe3fe1e02a76e5bab0c143ace4b137b4</id>
<content type='text'>
Based on Sergey's test patch [1], this fixes zram with lz4 compression
on big endian cpus.

Note that the 64-bit preprocessor test is not a cleanup, it's part of
the fix, since those identifiers are bogus (for example, __ppc64__
isn't defined anywhere else in the kernel, which means we'd fall into
the 32-bit definitions on ppc64).

Tested on ppc64 with no regression on x86_64.

[1] http://marc.info/?l=linux-kernel&amp;m=145994470805853&amp;w=4

Cc: stable@vger.kernel.org
Suggested-by: Sergey Senozhatsky &lt;sergey.senozhatsky@gmail.com&gt;
Signed-off-by: Rui Salvaterra &lt;rsalvaterra@gmail.com&gt;
Reviewed-by: Sergey Senozhatsky &lt;sergey.senozhatsky@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<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://git.stealer.net/cgit.cgi/user/sven/linux.git/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://git.stealer.net/cgit.cgi/user/sven/linux.git/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://git.stealer.net/cgit.cgi/user/sven/linux.git/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://git.stealer.net/cgit.cgi/user/sven/linux.git/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://git.stealer.net/cgit.cgi/user/sven/linux.git/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://git.stealer.net/cgit.cgi/user/sven/linux.git/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://git.stealer.net/cgit.cgi/user/sven/linux.git/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://git.stealer.net/cgit.cgi/user/sven/linux.git/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>
</feed>
