Re: [PATCH v2 1/5] efi/memattr: Fix thinko in table size sanity check

Breno Leitao
2026-04-01T12:46:08Z

On Wed, Apr 01, 2026 at 02:23:53PM +0200, Ard Biesheuvel wrote:
> + if (tbl->desc_size < sizeof(efi_memory_desc_t) ||
> + tbl->desc_size > efi.memmap.desc_size) {
> + pr_warn("Unexpected EFI Memory Attributes descriptor size %d (expected: %ld)\n",
> + tbl->desc_size, efi.memmap.desc_size);

Should tbl->desc_size be printed as %u and %lu? tbl->desc_size is u32
and. The pr_warn a few lines below already uses %u for the same field:

> pr_warn(FW_BUG "Corrupted EFI Memory Attributes Table detected! (version == %u, desc_size == %u, num_entries == %u)\n",
> tbl->version, tbl->desc_size, tbl->num_entries);