lkml.org 
[lkml]   [2022]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4.14 3/3] x86/mm, mm/hwpoison: Fix the unmap kernel 1:1 pages check condition
Date
From: luofei <luofei@unicloud.com>

When fd0e786d9d09 ("x86/mm, mm/hwpoison: Don't unconditionally unmap
kernel 1:1 pages") was backported to 4.14.y, the logic was reversed when
calling memory_failure() to determine whether it needs to unmap the
kernel page. Only when memory_failure() returns successfully, the kernel
page can be unmapped.

Signed-off-by: luofei <luofei@unicloud.com>
Cc: stable@vger.kernel.org #v4.14.x
Cc: stable@vger.kernel.org #v4.15.x
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/kernel/cpu/mcheck/mce.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -589,7 +589,7 @@ static int srao_decode_notifier(struct n

if (mce_usable_address(mce) && (mce->severity == MCE_AO_SEVERITY)) {
pfn = mce->addr >> PAGE_SHIFT;
- if (memory_failure(pfn, MCE_VECTOR, 0))
+ if (!memory_failure(pfn, MCE_VECTOR, 0))
mce_unmap_kpfn(pfn);
}


\
 
 \ /
  Last update: 2022-02-09 20:40    [W:1.524 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site