Skip to content

Commit 1e92af0

Browse files
qzhuo2aegl
authored andcommitted
EDAC/skx_common: Filter out the invalid address
Decoding an invalid address with certain firmware decoders could cause a #PF (Page Fault) in the EFI runtime context, which could subsequently hang the system. To make {i10nm,skx}_edac more robust against such bogus firmware decoders, filter out invalid addresses before allowing the firmware decoder to process them. Suggested-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com> Signed-off-by: Tony Luck <tony.luck@intel.com> Link: https://lore.kernel.org/r/20231207014512.78564-1-qiuxu.zhuo@intel.com
1 parent a69bada commit 1e92af0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/edac/skx_common.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,10 @@ int skx_mce_check_error(struct notifier_block *nb, unsigned long val,
648648
memset(&res, 0, sizeof(res));
649649
res.mce = mce;
650650
res.addr = mce->addr & MCI_ADDR_PHYSADDR;
651+
if (!pfn_to_online_page(res.addr >> PAGE_SHIFT)) {
652+
pr_err("Invalid address 0x%llx in IA32_MC%d_ADDR\n", mce->addr, mce->bank);
653+
return NOTIFY_DONE;
654+
}
651655

652656
/* Try driver decoder first */
653657
if (!(driver_decode && driver_decode(&res))) {

0 commit comments

Comments
 (0)