Re: [PATCH v3 10/10] ACPI: extlog: Validate elog record length before walking sections
Alison Schofield <[email protected]>
| Newsgroups | org.kernel.vger.linux-cxl,org.kernel.vger.linux-acpi |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Jul 17, 2026 at 09:16:47AM -0700, Dave Jiang wrote: > sashiko-bot flagged a missing bounds check on data_length that allows > an out-of-bounds read of elog_buf. > > extlog_print() copies a fixed ELOG_ENTRY_LEN (4096) bytes from the elog > record into elog_buf, then walks the sections using the > firmware-controlled data_length. Nothing checks that data_length stays > within the buffer, so a malformed record can walk the section pointer > past elog_buf and read adjacent memory. > > Unlike the GHES paths, extlog never calls cper_estatus_check(). Reject a > record whose length exceeds ELOG_ENTRY_LEN and run cper_estatus_check() > before walking the sections. > > A malformed record is now dropped with NOTIFY_DONE without setting > MCE_HANDLED_EXTLOG, reflecting that extlog did not consume it. > > Reported-by: [email protected] > Closes: https://sashiko.dev/#/patchset/[email protected]?part=6 > Fixes: f6ec01da40e4 ("ACPI: extlog: Handle multiple records") > Assisted-by: Claude:claude-opus-4-8 > Signed-off-by: Dave Jiang <[email protected]> Reviewed-by: Alison Schofield <[email protected]>