Skip to content

apei/ghes: don't OOPS with bad ARM error CPER records

Mauro Carvalho Chehab acpica-devel linux-acpi linux-edac linux-efi lkml 4 versions – Applied

Status from this message: Applied as 6.20 material, but I changed the spelling of EFI, APEI,

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest4 patches 4 repliesApplied
  2. v54 patches 2 repliesSuperseded
  3. v44 patches 2 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v32 patches3 repliesSuperseded

Changes in v6 from the cover letter

- No code changes, just a cosmetic change at patch 3 description
- Added Jonathan's review on all patches

Patches in v6 Applied

#Subject and filesSizeRepliesApplied
1/4apei/ghes: ARM processor Error: don't go past allocated memorydrivers/acpi/apei/ghes.c drivers/ras/ras.c+33 -51 reply
2/4efi/cper: don't go past the ARM processor CPER record bufferdrivers/firmware/efi/cper-arm.c drivers/firmware/efi/cper.c include/linux/cper.h+12 -60 replies
3/4apei/ghes: ensure that won't go past CPER allocated recorddrivers/acpi/apei/ghes.c include/acpi/ghes.h+6 -10 replies
4/4efi/cper: don't dump the entire memory regiondrivers/firmware/efi/cper.c+5 -00 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJonathan CameronArd BiesheuvelHanjun Guo
SeriesA-b R-b
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v6 thread

Cover letter [PATCH v6 0/4] apei/ghes: don't OOPS with bad ARM error CPER records

Rafael,

Current parsing logic at apei/ghes for ARM Processor Error assumes that the record sizes are correct. Yet, a bad BIOS might produce malformed GHES reports.

Worse than that, it may end exposing data from other memory addresses, as the logic may end dumping large portions of the memory.

Avoid that by checking the buffer sizes where needed.

---

v6:
- No code changes, just a cosmetic change at patch 3 description
- Added Jonathan's review on all patches

v5:
- Changed the name of a var as requested by Jonathan

v4:
- addressed Jonathan comments;
- added two extra patches to prevent other OOM issues.

v3:
- addressed Shuai feedback;
- moved all ghes code to one patch;
- fixed a typo and a bad indent;
- cleanup the size check logic at ghes.c.

Mauro Carvalho Chehab (4):
apei/ghes: ARM processor Error: don't go past allocated memory efi/cper: don't go past the ARM processor CPER record buffer apei/ghes: ensure that won't go past CPER allocated record efi/cper: don't dump the entire memory region

 drivers/acpi/apei/ghes.c        | 38 ++++++++++++++++++++++++++++-----
 drivers/firmware/efi/cper-arm.c | 12 +++++++----
 drivers/firmware/efi/cper.c     |  8 ++++++-
 drivers/ras/ras.c               |  6 +++++-
 include/acpi/ghes.h             |  1 +
 include/linux/cper.h            |  3 ++-
 6 files changed, 56 insertions(+), 12 deletions(-)
Signature · 1 line
2.52.0