<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot/u-boot.git, branch CHECK/v2-check-decomp-header</title>
<subtitle>Das U-Boot Source Tree</subtitle>
<id>https://git.landau.one/pub/scm/bootloaders/u-boot/u-boot.git/atom?h=CHECK%2Fv2-check-decomp-header</id>
<link rel='self' href='https://git.landau.one/pub/scm/bootloaders/u-boot/u-boot.git/atom?h=CHECK%2Fv2-check-decomp-header'/>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/bootloaders/u-boot/u-boot.git/'/>
<updated>2026-08-18T20:36:57+00:00</updated>
<entry>
<title>test: fit: cover the kernel_noload lzma header-size and unknown-size paths</title>
<updated>2026-08-18T20:36:57+00:00</updated>
<author>
<name>Aristo Chen</name>
<email>aristo.chen@canonical.com</email>
</author>
<published>2026-08-18T13:23:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/bootloaders/u-boot/u-boot.git/commit/?id=011f2da25c4d91af5e4a117db32a25158a4f6b90'/>
<id>urn:sha1:011f2da25c4d91af5e4a117db32a25158a4f6b90</id>
<content type='text'>
Exercise bootm_lzma_uncompressed_size() end-to-end on sandbox:

- test_fit_kernel_noload_decomp_lzma_hdr_sized boots a 6 MiB
  kernel_noload payload that lzma compresses far past the 8x fallback
  heuristic, so the boot only succeeds when bootm sizes the buffer
  from the header's uncompressed-size field. Streaming encoders write
  the "unknown" marker into that field, so the test compresses with
  Python's lzma module and patches the real size into the fixed
  8-byte field, matching what LZMA SDK style encoders record.

- test_fit_kernel_noload_decomp_lzma_unknown_size leaves the marker in
  place and checks that bootm falls back to the 8x heuristic buffer
  and still boots the image.

No external tool is required: Python's lzma module is part of the
standard library.

Signed-off-by: Aristo Chen &lt;aristo.chen@canonical.com&gt;
</content>
</entry>
<entry>
<title>bootm: size the noload lzma decompression buffer from the header</title>
<updated>2026-08-18T20:36:57+00:00</updated>
<author>
<name>Aristo Chen</name>
<email>aristo.chen@canonical.com</email>
</author>
<published>2026-08-18T13:23:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/bootloaders/u-boot/u-boot.git/commit/?id=b09cb251ab88a20efbb4b60806fb2479fcb207b0'/>
<id>urn:sha1:b09cb251ab88a20efbb4b60806fb2479fcb207b0</id>
<content type='text'>
Add a small static helper bootm_lzma_uncompressed_size() that reads
the uncompressed size out of the .lzma-alone header, and wire it
into bootm_load_os() alongside gzip, lz4, and zstd.

The .lzma-alone format keeps the uncompressed size in a fixed 8-byte
field right after the 5-byte properties block; a marker of all ones
means the size is unknown, and the caller falls back to the 8x
heuristic in that case. Streaming encoders (xz-utils' 'lzma' shim,
Python's lzma.FORMAT_ALONE) write the unknown marker, while LZMA SDK
style encoders record the real size.

Signed-off-by: Aristo Chen &lt;aristo.chen@canonical.com&gt;
</content>
</entry>
<entry>
<title>test: fit: cover the kernel_noload lz4 header-size path</title>
<updated>2026-08-18T20:36:57+00:00</updated>
<author>
<name>Aristo Chen</name>
<email>aristo.chen@canonical.com</email>
</author>
<published>2026-08-18T13:23:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/bootloaders/u-boot/u-boot.git/commit/?id=f626ba24310c1c2edba80dc1ad945f1146cf4603'/>
<id>urn:sha1:f626ba24310c1c2edba80dc1ad945f1146cf4603</id>
<content type='text'>
Add test_fit_kernel_noload_decomp_lz4_hdr_sized: a 6 MiB payload
whose lz4 compression ratio is past the 8x heuristic decompresses
cleanly because Content_Size is consulted. The tool must be invoked
with --content-size so the frame's FLG bit is set. The test is
guarded by @pytest.mark.requiredtool('lz4') so it skips on hosts
that do not ship the lz4 command.

Signed-off-by: Aristo Chen &lt;aristo.chen@canonical.com&gt;
</content>
</entry>
<entry>
<title>bootm: size the noload lz4 decompression buffer from Content_Size</title>
<updated>2026-08-18T20:36:57+00:00</updated>
<author>
<name>Aristo Chen</name>
<email>aristo.chen@canonical.com</email>
</author>
<published>2026-08-18T13:23:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/bootloaders/u-boot/u-boot.git/commit/?id=e77a42dbe4f945de60fbf59ecf729781e045a4da'/>
<id>urn:sha1:e77a42dbe4f945de60fbf59ecf729781e045a4da</id>
<content type='text'>
Add a small static helper bootm_lz4_uncompressed_size() that parses
the lz4 frame header and returns Content_Size when the FLG bit is
set, and wire it into bootm_load_os() alongside gzip and zstd.

The header parse mirrors ulz4fn()'s validation (magic, version==1,
reserved bits, independent-block flag) so the helper does not accept
a frame the decoder itself would reject. Only Content_Size is
extracted; the full validation still runs inside ulz4fn() during the
actual decompression call.

The lz4 command needs the --content-size option to set the FLG bit
that carries the size; frames produced without it fall back to the
existing 8x heuristic.

Signed-off-by: Aristo Chen &lt;aristo.chen@canonical.com&gt;
</content>
</entry>
<entry>
<title>test: fit: cover the kernel_noload zstd header-size path</title>
<updated>2026-08-18T20:36:57+00:00</updated>
<author>
<name>Aristo Chen</name>
<email>aristo.chen@canonical.com</email>
</author>
<published>2026-08-18T13:23:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/bootloaders/u-boot/u-boot.git/commit/?id=8175fbbccdf3d0a09807a47252f231ff451114be'/>
<id>urn:sha1:8175fbbccdf3d0a09807a47252f231ff451114be</id>
<content type='text'>
Parametrise NOLOAD_ITS on the compression field so a single template
can drive gzip, zstd, and future format tests, and update the
existing gzip callers to pass compression='gzip'.

Add test_fit_kernel_noload_decomp_zstd_hdr_sized: a 6 MiB payload
whose zstd compression ratio is past the 8x heuristic decompresses
cleanly because Frame_Content_Size is consulted. The test is guarded
by @pytest.mark.requiredtool('zstd') so it skips on hosts that do
not ship the zstd command.

Signed-off-by: Aristo Chen &lt;aristo.chen@canonical.com&gt;
</content>
</entry>
<entry>
<title>bootm: size the noload zstd decompression buffer from Frame_Content_Size</title>
<updated>2026-08-18T20:36:57+00:00</updated>
<author>
<name>Aristo Chen</name>
<email>aristo.chen@canonical.com</email>
</author>
<published>2026-08-18T13:23:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/bootloaders/u-boot/u-boot.git/commit/?id=914b7583bb541283ab02f8570cebb90bc3eaa7fd'/>
<id>urn:sha1:914b7583bb541283ab02f8570cebb90bc3eaa7fd</id>
<content type='text'>
Add a small static helper bootm_zstd_uncompressed_size() that returns
the frame's Frame_Content_Size via zstd_get_frame_header(), and wire
it into bootm_load_os() as a new case in the size-hint switch
alongside the existing gzip case.

zstd_get_frame_header() and the frame-parsing code behind it ship
with the zstd decompressor, which is already linked into any board
that enables ZSTD, so calling it here adds no new zstd code to the
image. The returned value is used as an allocation hint only and is
capped by the caller; full validation still runs inside
zstd_decompress() during the actual decompression.

Signed-off-by: Aristo Chen &lt;aristo.chen@canonical.com&gt;
</content>
</entry>
<entry>
<title>test: fit: cover the kernel_noload gzip header-size and lying-header paths</title>
<updated>2026-08-18T20:36:57+00:00</updated>
<author>
<name>Aristo Chen</name>
<email>aristo.chen@canonical.com</email>
</author>
<published>2026-08-18T13:23:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/bootloaders/u-boot/u-boot.git/commit/?id=d097a56a12531c9e42a6dd2de9e469286c0d6e64'/>
<id>urn:sha1:d097a56a12531c9e42a6dd2de9e469286c0d6e64</id>
<content type='text'>
Reshape and extend the kernel_noload decompression pytests to match
the new bootm behaviour that reads ISIZE from the gzip trailer:

  - Rename test_fit_kernel_noload_decomp_overflow to
    test_fit_kernel_noload_decomp_gzip_lying_hdr. Its setup (a 4 MiB
    payload of zeros gzipped) used to force the failure via the 8x
    heuristic starving the buffer; now that bootm reads ISIZE, the
    honest trailer sizes the buffer correctly, so overwrite ISIZE
    with a tiny value instead and verify the resulting decompression
    is still stopped at the buffer boundary. This is the direct test
    of the CONFIG_SYS_BOOTM_LEN cap on the attacker-controlled
    header value.

  - Add test_fit_kernel_noload_decomp_gzip_hdr_sized: a 6 MiB gzipped
    payload whose compression ratio is past the 8x heuristic
    decompresses cleanly because ISIZE is consulted.

  - Rename the pre-existing test_fit_kernel_noload_decomp_boundary to
    test_fit_kernel_noload_decomp_gzip_boundary so every
    noload_decomp test carries the compressor in its name.

Signed-off-by: Aristo Chen &lt;aristo.chen@canonical.com&gt;
</content>
</entry>
<entry>
<title>bootm: size the noload gzip decompression buffer from ISIZE</title>
<updated>2026-08-18T20:36:57+00:00</updated>
<author>
<name>Aristo Chen</name>
<email>aristo.chen@canonical.com</email>
</author>
<published>2026-08-18T13:23:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/bootloaders/u-boot/u-boot.git/commit/?id=0a2e329b829d905889aa9bad0c9f4d28cc302ab1'/>
<id>urn:sha1:0a2e329b829d905889aa9bad0c9f4d28cc302ab1</id>
<content type='text'>
For a compressed kernel_noload image, bootm_load_os() allocates a
per-image decompression buffer of ALIGN(image_len * 8, SZ_1M). The 8x
multiplier is a heuristic that comfortably covers what zstd and xz
achieve on real kernels, but a highly compressible payload (say, a
run of zeros) can exceed it and fail decompression.

gzip carries the original size in the last 4 bytes of the stream
(ISIZE, modulo 2^32). Where the compressed image is a gzip stream,
read ISIZE and use ALIGN(hdr_size, SZ_1M) as the buffer, capped at
CONFIG_SYS_BOOTM_LEN because the value is attacker-controlled. For
non-gzip streams or when ISIZE cannot be trusted, fall back to the
existing 8x multiplier.

The size read is done via a small static helper in bootm.c, wired up
via a switch on os.comp so the same pattern can be extended to other
formats without adding a new public interface. The other formats
U-Boot supports (lzma, lz4, zstd) also carry a size hint and are
added in follow-up patches.

Suggested-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: Aristo Chen &lt;aristo.chen@canonical.com&gt;
</content>
</entry>
<entry>
<title>global_data: Only include driver model fields when DM is enabled</title>
<updated>2026-08-18T00:46:29+00:00</updated>
<author>
<name>Jonas Karlman</name>
<email>jonas@kwiboo.se</email>
</author>
<published>2026-08-10T20:48:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/bootloaders/u-boot/u-boot.git/commit/?id=41541f47a3af93d76d63c2d6d1f1c859fa3dd61a'/>
<id>urn:sha1:41541f47a3af93d76d63c2d6d1f1c859fa3dd61a</id>
<content type='text'>
The struct list_head dmtag_list, struct udevice *dm_root, struct
list_head uclass_root_s and struct list_head *uclass_root fields in
struct global_data takes up 24/48 bytes of memory on ARMv7/AArch64.
However, these fields are only used when $(PHASE_)DM is enabled.

Guard driver model related fields using CONFIG_IS_ENABLED(DM) to save
memory space when U-Boot proper is built with DM=y and xPL is built
without xPL_DM.

Signed-off-by: Jonas Karlman &lt;jonas@kwiboo.se&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>buildman: Differentiate 32-bit and 64-bit LoongArch variants</title>
<updated>2026-08-18T00:46:29+00:00</updated>
<author>
<name>Yao Zi</name>
<email>me@ziyao.cc</email>
</author>
<published>2026-08-06T12:29:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/bootloaders/u-boot/u-boot.git/commit/?id=d2b6f7d9c4b42ce48c83593cdec7ae9780a31057'/>
<id>urn:sha1:d2b6f7d9c4b42ce48c83593cdec7ae9780a31057</id>
<content type='text'>
Similar to RISC-V and ARM, 32-bit and 64-bit LoongArch cannot be
distinguished solely by CONFIG_SYS_ARCH, but require different
toolchains if multilib is disabled in compiler, which is the case of
toolchain provided by kernel.org.

Override the parsed arch parameter for LoongArch configs based on
CONFIG_ARCH_LA64 Kconfig symbol.

Signed-off-by: Yao Zi &lt;me@ziyao.cc&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
</feed>
