Re: [PATCH v5 1/2] mm/hwpoison: Avoid the impact of hwpoison_filter() return value on mce handler

From: Borislav Petkov
Date: Wed Feb 23 2022 - 12:39:44 EST


On Wed, Feb 23, 2022 at 03:21:35AM -0500, luofei wrote:
> When the hwpoison page meets the filter conditions, it should
> not be regarded as successful memory_failure() processing for
> mce handler, but should return a distinct value, otherwise
> mce handler regards the error page has been identified and
> isolated, which may lead to calling set_mce_nospec() to change
> page attribute, etc.
>
> Here memory_failure() return -EOPNOTSUPP to indicate that the
> error event is filtered, mce handler should not take any action
> for this situation and hwpoison injector should treat as correct.
>
> Signed-off-by: luofei <luofei@xxxxxxxxxxxx>
> ---
> arch/x86/kernel/cpu/mce/core.c | 8 +++++---
> drivers/base/memory.c | 2 ++
> mm/hwpoison-inject.c | 3 ++-
> mm/madvise.c | 2 ++
> mm/memory-failure.c | 9 +++++++--
> 5 files changed, 18 insertions(+), 6 deletions(-)

Much better, thanks.

Acked-by: Borislav Petkov <bp@xxxxxxx>

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette