<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/arch/arm/boot/compressed/decompress.c, branch linux-4.4.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.4.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.4.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2021-11-02T16:38:11+00:00</updated>
<entry>
<title>ARM: 9134/1: remove duplicate memcpy() definition</title>
<updated>2021-11-02T16:38:11+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2021-10-18T14:30:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4126bca85a041fd4ed61834e0096c857685db025'/>
<id>urn:sha1:4126bca85a041fd4ed61834e0096c857685db025</id>
<content type='text'>
commit eaf6cc7165c9c5aa3c2f9faa03a98598123d0afb upstream.

Both the decompressor code and the kasan logic try to override
the memcpy() and memmove()  definitions, which leading to a clash
in a KASAN-enabled kernel with XZ decompression:

arch/arm/boot/compressed/decompress.c:50:9: error: 'memmove' macro redefined [-Werror,-Wmacro-redefined]
 #define memmove memmove
        ^
arch/arm/include/asm/string.h:59:9: note: previous definition is here
 #define memmove(dst, src, len) __memmove(dst, src, len)
        ^
arch/arm/boot/compressed/decompress.c:51:9: error: 'memcpy' macro redefined [-Werror,-Wmacro-redefined]
 #define memcpy memcpy
        ^
arch/arm/include/asm/string.h:58:9: note: previous definition is here
 #define memcpy(dst, src, len) __memcpy(dst, src, len)
        ^

Here we want the set of functions from the decompressor, so undefine
the other macros before the override.

Link: https://lore.kernel.org/linux-arm-kernel/CACRpkdZYJogU_SN3H9oeVq=zJkRgRT1gDz3xp59gdqWXxw-B=w@mail.gmail.com/
Link: https://lore.kernel.org/lkml/202105091112.F5rmd4By-lkp@intel.com/

Fixes: d6d51a96c7d6 ("ARM: 9014/2: Replace string mem* functions for KASan")
Fixes: a7f464f3db93 ("ARM: 7001/2: Wire up support for the XZ decompressor")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>lib/decompressors: use real out buf size for gunzip with kernel</title>
<updated>2015-09-10T20:29:01+00:00</updated>
<author>
<name>Yinghai Lu</name>
<email>yinghai@kernel.org</email>
</author>
<published>2015-09-09T22:39:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2d3862d26e67a59340ba1cf1748196c76c5787de'/>
<id>urn:sha1:2d3862d26e67a59340ba1cf1748196c76c5787de</id>
<content type='text'>
When loading x86 64bit kernel above 4GiB with patched grub2, got kernel
gunzip error.

| early console in decompress_kernel
| decompress_kernel:
|       input: [0x807f2143b4-0x807ff61aee]
|      output: [0x807cc00000-0x807f3ea29b] 0x027ea29c: output_len
| boot via startup_64
| KASLR using RDTSC...
|  new output: [0x46fe000000-0x470138cfff] 0x0338d000: output_run_size
|  decompress: [0x46fe000000-0x47007ea29b] &lt;=== [0x807f2143b4-0x807ff61aee]
|
| Decompressing Linux... gz...
|
| uncompression error
|
| -- System halted

the new buffer is at 0x46fe000000ULL, decompressor_gzip is using
0xffffffb901ffffff as out_len.  gunzip in lib/zlib_inflate/inflate.c cap
that len to 0x01ffffff and decompress fails later.

We could hit this problem with crashkernel booting that uses kexec loading
kernel above 4GiB.

We have decompress_* support:
    1. inbuf[]/outbuf[] for kernel preboot.
    2. inbuf[]/flush() for initramfs
    3. fill()/flush() for initrd.
This bug only affect kernel preboot path that use outbuf[].

Add __decompress and take real out_buf_len for gunzip instead of guessing
wrong buf size.

Fixes: 1431574a1c4 (lib/decompressors: fix "no limit" output buffer length)
Signed-off-by: Yinghai Lu &lt;yinghai@kernel.org&gt;
Cc: Alexandre Courbot &lt;acourbot@nvidia.com&gt;
Cc: Jon Medhurst &lt;tixy@linaro.org&gt;
Cc: Stephen Warren &lt;swarren@wwwdotorg.org&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: &lt;stable@vger.kernel.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>arm: add support for LZ4-compressed kernel</title>
<updated>2013-07-09T17:33:30+00:00</updated>
<author>
<name>Kyungsik Lee</name>
<email>kyungsik.lee@lge.com</email>
</author>
<published>2013-07-08T23:01:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f9b493ac9b833fd9dd3bbd50460adb33f29e1238'/>
<id>urn:sha1:f9b493ac9b833fd9dd3bbd50460adb33f29e1238</id>
<content type='text'>
Integrates the LZ4 decompression code to the arm pre-boot code.

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>
<entry>
<title>ARM: decompress: remove unused ARCH_HAS_DECOMP_WDOG</title>
<updated>2013-01-11T02:53:55+00:00</updated>
<author>
<name>Shawn Guo</name>
<email>shawn.guo@linaro.org</email>
</author>
<published>2012-12-12T12:51:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=07b16021619a9f7e4fb87881205c15c107c066d9'/>
<id>urn:sha1:07b16021619a9f7e4fb87881205c15c107c066d9</id>
<content type='text'>
ARCH_HAS_DECOMP_WDOG is only used in lib/inflate.c which is not
included in arch/arm/boot/compressed/decompress.c now.  That said,
ARCH_HAS_DECOMP_WDOG is not used at all.  Let's remove it.

Signed-off-by: Shawn Guo &lt;shawn.guo@linaro.org&gt;
Acked-by: Nicolas Pitre &lt;nico@linaro.org&gt;
</content>
</entry>
<entry>
<title>ARM: 7492/1: add strstr declaration for decompressors</title>
<updated>2012-08-25T08:22:30+00:00</updated>
<author>
<name>Rob Herring</name>
<email>rob.herring@calxeda.com</email>
</author>
<published>2012-08-15T15:28:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ef1c2096fcf390f2f6a6a835d9d26105e82abda5'/>
<id>urn:sha1:ef1c2096fcf390f2f6a6a835d9d26105e82abda5</id>
<content type='text'>
With the generic unaligned.h, more kernel headers get pulled in including
dynamic_debug.h which needs strstr. As it is not really used, we only need
a declaration here.

Signed-off-by: Rob Herring &lt;rob.herring@calxeda.com&gt;
Tested-by: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
Reviewed-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: 7001/2: Wire up support for the XZ decompressor</title>
<updated>2012-03-24T09:38:52+00:00</updated>
<author>
<name>Imre Kaloz</name>
<email>kaloz@openwrt.org</email>
</author>
<published>2012-01-26T12:08:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a7f464f3db93ae5492bee6f6e48939fd8a45fa99'/>
<id>urn:sha1:a7f464f3db93ae5492bee6f6e48939fd8a45fa99</id>
<content type='text'>
Wire up support for the XZ decompressor

Signed-off-by: Imre Kaloz &lt;kaloz@openwrt.org&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: zImage: don't ignore error returned from decompress()</title>
<updated>2011-05-07T04:08:01+00:00</updated>
<author>
<name>Nicolas Pitre</name>
<email>nicolas.pitre@linaro.org</email>
</author>
<published>2011-04-22T01:59:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ccc1c7c6c25661f0071a7ebe997abcbf529df3e9'/>
<id>urn:sha1:ccc1c7c6c25661f0071a7ebe997abcbf529df3e9</id>
<content type='text'>
If decompress() returns an error without calling error(), we must
not attempt to boot the resulting kernel.

Signed-off-by: Nicolas Pitre &lt;nicolas.pitre@linaro.org&gt;
Tested-by: Shawn Guo &lt;shawn.guo@linaro.org&gt;
Tested-by: Tony Lindgren &lt;tony@atomide.com&gt;
</content>
</entry>
<entry>
<title>ARM: 6026/1: ARM: Add support for LZMA-compressed kernel images</title>
<updated>2010-04-14T11:05:36+00:00</updated>
<author>
<name>Albin Tonnerre</name>
<email>albin.tonnerre@free-electrons.com</email>
</author>
<published>2010-04-03T10:40:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6e8699f7d68589e0e9ab324f598a3357bceb40bc'/>
<id>urn:sha1:6e8699f7d68589e0e9ab324f598a3357bceb40bc</id>
<content type='text'>
This patch allows using a kernel image compressed with LZMA on ARM.
Extracting the image is fairly slow, but it might be useful on machines
with a very limited amount of storage, as the size benefit is quite
significant (about 25% smaller with LZMA compared to GZIP)

Tested-by: Martin Michlmayr &lt;tbm@cyrius.com&gt;
Tested-by: Paulius Zaleckas &lt;paulius.zaleckas@gmail.com&gt;
Signed-off-by: Albin Tonnerre &lt;albin.tonnerre@free-electrons.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: Add final piece to fix XIP decompressor in read-only memory</title>
<updated>2010-03-15T14:29:22+00:00</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2010-03-15T14:29:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b89ebadc3421f8ff85030768ec14144794984877'/>
<id>urn:sha1:b89ebadc3421f8ff85030768ec14144794984877</id>
<content type='text'>
This defines STATIC_RW_DATA, which prevents the read/write malloc
management data being declared with a static attribute.

Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: Eliminate decompressor -Dstatic= PIC hack</title>
<updated>2010-02-25T19:34:31+00:00</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2010-02-25T12:14:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5de813b6cd06460b337f9da9afe316823cf3ef45'/>
<id>urn:sha1:5de813b6cd06460b337f9da9afe316823cf3ef45</id>
<content type='text'>
We used to build decompressors with -Dstatic= to avoid any local data
being generated.  The problem is that local data generates GOTOFF
relocations, which means we can't relocate the data relative to the
text segment.

Global data, on the other hand, goes through the GOT, and can be
relocated anywhere.

Unfortunately, with the new decompressors, this presents a problem
since they declare static data within functions, and this leads to
stack overflow.

Fix this by separating out the decompressor code into a separate file,
and removing 'static' from BSS data in misc.c.

Also, discard the .data section - this means that should we end up
with read/write initialized data, the decompressor will fail to link
and the problem will be obvious.

Acked-by: Nicolas Pitre &lt;nico@fluxnic.net&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
</feed>
