Re: [PATCH v5 5/5] x86/CPU/AMD: Print AGESA string from DMI additional information entry

From: Borislav Petkov

Date: Sun Mar 15 2026 - 16:57:05 EST


On Sun, Mar 15, 2026 at 10:14:48AM -0500, Mario Limonciello wrote:
> FYI - you're replying to the v5 not the v6 [1].

Whoops, sorry about that.

It looks I've still used the right set tho:

v6_20260307_superm1_print_agesa_version_at_bootup.mbx

:)

> I did add a check for info->count < 1, but that's not what you were actually
> looking for. Do you have a suggestion for an upper limit to bound things?
>
> I was thinking something like this:
>
> #define DMI_LIMIT 10
> int limit = info -> count > DMI_LIMIT ? DMI_LIMIT : info->count;
> end = (void *)info + limit * info->header.length;

So that Zen5 laptop here says:

[ 0.853836] dmi_scan_additional: next: 0xffffc9000051950c, end: 0xffffc90000519515, hdr length: 14
[ 0.854364] entry 0: length: 9
[ 0.854576] AGESA: StrixPI-FP8 1.0.0.1d

So after that first loop pass we have

next = 0xffffc9000051950c + 9 = 0xffffc90000519515

And we should terminate. So I guess that's not a lot of entries.

In terms of limiting, I'd do something like:

/* A generous max size for the additional DMI entries */
#define MAX_DMI_ADDITIONAL_ENTRIES_LEN 256

if (info->header.length > MAX_DMI_ADDITIONAL_ENTRIES_LEN)
info->header.length = MAX_DMI_ADDITIONAL_ENTRIES_LEN;

And now you have a sane upper limit and we don't rely on any numbers the BIOS
is telling us.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette