nfit, mce: validate the mce->addr before using it
Subsystems (3)
Borislav Petkov
maintainerPATCH v3 2/2 nfit, mce: validate the mce->addr before using it
Quoted 16 lines · Vishal Verma
The NFIT machine check handler uses the physical address from the 'mce' structure, and compares it against information in the ACPI NFIT table to determine whether that location lies on an NVDIMM. The
mce->addrfield however may not always be valid, and this is indicated by theMCI_STATUS_ADDRVbit in the status field.Export
mce_usable_address()which already performs validation for the address, and use it in the NFIT handler.Reported-by Robert Elliott <[email protected]>Fixes 6839a6d96f4e ("nfit: do an ARS scrub on hitting a latent media error")Cc Dan Williams <[email protected]>Cc Tony Luck <[email protected]>Cc Borislav Petkov <[email protected]>Signed-off-by Vishal Verma <[email protected]>
Quoted 5 lines
--- arch/x86/include/asm/mce.h | 1 + arch/x86/kernel/cpu/mcheck/mce.c | 3 ++- drivers/acpi/nfit/mce.c | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-)
Is there any particular reason why is this a separate patch and not part of the first one?
Also, do s/mce/MCE/g.
Thx.