x86/mce: fixup exception only for the correct mces
fix #29415191 commit 1df73b2131e3b33d518609769636b41ce00212de upstream the severity grading code returns in_kernel_recov error context for errors which have happened in kernel space but from which the kernel can recover. whether the recovery can happen is determined by the exception table entry having as handler ex_handler_fault() and which has been declared at build time using _asm_extable_fault(). in_kernel_recov is used in mce_severity_intel() to lookup the corresponding error severity in the severities table. however, the mapping back from error severity to whether the error is in_kernel_recov is ambiguous and in the very paranoid case - which might not be possible right now - but be better safe than sorry later, an exception fixup could be attempted for another mce whose address is in the exception table and has the proper severity. which would be unfortunate, to say the least. therefore, mark such mces explicitly as mce_in_kernel_recov so that the recovery attempt is done only for them. document the whole handling, while at it, as it is not trivial. reported-by: Nthomas gleixner <tglx@linutronix.de> signed-off-by: Nborislav petkov <bp@suse.de> tested-by: Ntony luck <tony.luck@intel.com> link: https://lkml.kernel.org/r/20200407163414.18058-10-bp@alien8.deSigned-off-by: NYouquan Song <youquan.song@intel.com> Signed-off-by: NWetp Zhang <wetp.zy@linux.alibaba.com> Reviewed-by: NArtie Ding <artie.ding@linux.alibaba.com>
Showing
想要评论请 注册 或 登录