mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-04 19:10:47 -05:00
XZ decompressor stubs in 32-bit ARM Linux zImage (lib/decompress_unxz.c) include the HEADER_MAGIC string literal "\3757zXZ" in .rodata, which appears before the compressed payload. check_fmt previously matched only the first 5 bytes, falsely identifying the .rodata string literal as an XZ payload. Validate the 12-byte XZ stream header by verifying the 6-byte magic, stream flags, and IEEE 802.3 CRC32 of the stream flags. In addition, harden GZIP, BZIP2, and LZOP checks with stricter header validation to prevent false positives when scanning raw binaries. Assisted-by: Gemini 3.8 Flash