Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92f72aed authored by luofei's avatar luofei Committed by Greg Kroah-Hartman
Browse files

x86/mm, mm/hwpoison: Fix the unmap kernel 1:1 pages check condition



When fd0e786d ("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: default avatarluofei <luofei@unicloud.com>
Cc: stable@vger.kernel.org #v4.14.x
Cc: stable@vger.kernel.org #v4.15.x
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e6f580d0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
	}