Re: [PATCH v3 02/10] efi/cper: Reject CPER records with an out-of-range error_data_length
Alison Schofield <[email protected]>
| Newsgroups | org.kernel.vger.linux-acpi,org.kernel.vger.linux-cxl |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Jul 17, 2026 at 09:16:39AM -0700, Dave Jiang wrote: > sashiko-bot flagged that the "len < sizeof(*rec)" guard added in this > series can be bypassed by an integer overflow in the shared length check. > > cper_estatus_check() bounds firmware CPER data before the section > handlers in ghes_do_proc() run. It sizes each section with > acpi_hest_get_record_size(), which adds the firmware-controlled u32 > error_data_length to the header size using signed int helpers in > <acpi/ghes.h>. A value like 0xffffffb9 sign-converts to a negative > number, wraps the record size small, and slips past the > "record_size > data_len" check. A section handler then copies a > fixed-size payload out of it and reads past the record. > > Reject a section whose error_data_length is negative once sign-converted > or larger than the remaining data, before the size arithmetic runs. > > Reported-by: [email protected] > Closes: https://sashiko.dev/#/patchset/[email protected]?part=1 > Fixes: 45b14a4ffcc1 ("efi: cper: Fix possible out-of-bounds access") > Assisted-by: Claude:claude-opus-4-8 > Signed-off-by: Dave Jiang <[email protected]> Reviewed-by: Alison Schofield <[email protected]>