x86/mm, mm/hwpoison: Fix the unmap kernel 1:1 pages check condition
Subsystems (3)
PATCH 1/1 x86/mm, mm/hwpoison: Fix the unmap kernel 1:1 pages check condition
[ Upstream commit fd0e786d9d09024f67bd71ec094b110237dc3840 ]
This commit solves the problem of unmap kernel 1:1 pages unconditionally, it appears in Linus's tree 4.16 and later versions, and is backported to 4.14.x and 4.15.x stable branches.
But the backported patch has its logic 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.
--- arch/x86/kernel/cpu/mcheck/mce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/mcheck/mce.c +1 -1
@@ -589,7 +589,7 @@ static int srao_decode_notifier(struct notifier_block *nb, unsigned long val,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); }
Signature · 1 line
2.27.0
Greg KH
maintainerQuoted 11 lines · luofei
[ Upstream commit
fd0e786d9d09024f67bd71ec094b110237dc3840]This commit solves the problem of unmap kernel 1:1 pages unconditionally, it appears in Linus's tree 4.16 and later versions, and is backported to 4.14.x and 4.15.x stable branches.
But the backported patch has its logic reversed when calling
memory_failure()to determine whether it needs to unmap the kernel page. Only whenmemory_failure()returns successfully, the kernel page can be unmapped.
Quoted 6 lines
--- arch/x86/kernel/cpu/mcheck/mce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks, now queued up.
greg k-h