[openwrt/openwrt] uboot-lantiq: danube: fix hanging lzma kernel uncompression #2

LEDE Commits lede-commits at lists.infradead.org
Sat Nov 27 13:52:53 PST 2021


mkresin pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/b7befd8d8126a8d90601b32a41ba32d4099e0d19

commit b7befd8d8126a8d90601b32a41ba32d4099e0d19
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sat Nov 27 21:43:40 2021 +0100

    uboot-lantiq: danube: fix hanging lzma kernel uncompression #2
    
    Follow up to commit 565b62cca2fc7d27f1f1584c44830a6e5c4f0f61. Managed to
    hit the very same issue again while playing with the NOR SPL builds.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 .../boot/uboot-lantiq/patches/0030-lzma-force-8bit-reads.patch   | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/package/boot/uboot-lantiq/patches/0030-lzma-force-8bit-reads.patch b/package/boot/uboot-lantiq/patches/0030-lzma-force-8bit-reads.patch
index dc7d9ed7ee..a934dab5cd 100644
--- a/package/boot/uboot-lantiq/patches/0030-lzma-force-8bit-reads.patch
+++ b/package/boot/uboot-lantiq/patches/0030-lzma-force-8bit-reads.patch
@@ -37,6 +37,15 @@ Signed-off-by: Mathias Kresin <dev at kresin.me>
  
  #define kNumTopBits 24
  #define kTopValue ((UInt32)1 << kNumTopBits)
+@@ -703,7 +704,7 @@ static ELzmaDummy LzmaDec_TryDummy(const
+ 
+ static void LzmaDec_InitRc(CLzmaDec *p, const Byte *data)
+ {
+-  p->code = ((UInt32)data[1] << 24) | ((UInt32)data[2] << 16) | ((UInt32)data[3] << 8) | ((UInt32)data[4]);
++  p->code = ((UInt32)readb(&data[1]) << 24) | ((UInt32)readb(&data[2]) << 16) | ((UInt32)readb(&data[3]) << 8) | ((UInt32)readb(&data[4]));
+   p->range = 0xFFFFFFFF;
+   p->needFlush = 0;
+ }
 @@ -929,7 +930,7 @@ SRes LzmaProps_Decode(CLzmaProps *p, con
    if (size < LZMA_PROPS_SIZE)
      return SZ_ERROR_UNSUPPORTED;



More information about the lede-commits mailing list