Linux EDAC development
 help / color / mirror / Atom feed
* [PATCH 0/4] RAS/amd/fmpm: Fix OOB, uninitialized data, and error-handling bugs
@ 2026-08-21  9:47 Rui Qi
  2026-08-21  9:47 ` [PATCH 1/4] RAS/amd/fmpm: Fix out-of-bounds read in for_each_fru macro Rui Qi
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Rui Qi @ 2026-08-21  9:47 UTC (permalink / raw)
  To: Yazen.Ghannam; +Cc: tony.luck, bp, linux-edac, linux-kernel, Rui Qi

Hi Yazen, Borislav, Tony,

This series fixes several bugs in the AMD FRU Memory Poison Manager
driver.

Patch 1 fixes an out-of-bounds read in the for_each_fru macro caused by
the comma operator evaluating the array access before the bounds check.
This is technically undefined behavior and would be flagged by UBSan.

Patch 2 fixes an uninitialized stack bitmap in save_new_records() that
could cause the rollback path to clear ERST records that were not created
in the current initialization pass.

Patch 3 makes the max_nr_entries module parameter read-only (0444),
preventing runtime writes that could exceed the allocated flexible array
size.

Patch 4 fixes a spurious BUG when erst_get_record_id_begin() fails,
because the error path unconditionally calls erst_get_record_id_end()
which triggers BUG_ON.

All four bugs have been present since the original introduction of the
AMD FMPM driver.

Rui Qi (4):
  RAS/amd/fmpm: Fix out-of-bounds read in for_each_fru macro
  RAS/amd/fmpm: Clear new records bitmap before rollback
  RAS/amd/fmpm: Make max_nr_entries read-only
  RAS/amd/fmpm: Fix spurious BUG when ERST record enumeration fails

 drivers/ras/amd/fmpm.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

--
2.20.1

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2026-08-26  3:54 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-21  9:47 [PATCH 0/4] RAS/amd/fmpm: Fix OOB, uninitialized data, and error-handling bugs Rui Qi
2026-08-21  9:47 ` [PATCH 1/4] RAS/amd/fmpm: Fix out-of-bounds read in for_each_fru macro Rui Qi
2026-08-25 17:14   ` Yazen Ghannam
2026-08-21  9:47 ` [PATCH 2/4] RAS/amd/fmpm: Clear new records bitmap before rollback Rui Qi
2026-08-25 19:56   ` Yazen Ghannam
2026-08-21  9:47 ` [PATCH 3/4] RAS/amd/fmpm: Make max_nr_entries read-only Rui Qi
2026-08-25 20:06   ` Yazen Ghannam
2026-08-21  9:47 ` [PATCH 4/4] RAS/amd/fmpm: Fix spurious BUG when ERST record enumeration fails Rui Qi
2026-08-25 20:21   ` Yazen Ghannam
2026-08-26  3:53 ` [PATCH v2 0/4] RAS/AMD/FMPM: Fix OOB, uninitialized data, and error-handling bugs Rui Qi
2026-08-26  3:53   ` [PATCH v2 1/4] RAS/AMD/FMPM: Fix out-of-bounds read in for_each_fru macro Rui Qi
2026-08-26  3:53   ` [PATCH v2 2/4] RAS/AMD/FMPM: Clear new records bitmap before rollback Rui Qi
2026-08-26  3:53   ` [PATCH v2 3/4] RAS/AMD/FMPM: Make max_nr_entries read-only Rui Qi
2026-08-26  3:53   ` [PATCH v2 4/4] RAS/AMD/FMPM: Fix spurious BUG when ERST record enumeration fails Rui Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox