All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, luofei <luofei@unicloud.com>
Subject: [PATCH 4.14 3/3] x86/mm, mm/hwpoison: Fix the unmap kernel 1:1 pages check condition
Date: Wed,  9 Feb 2022 20:13:40 +0100	[thread overview]
Message-ID: <20220209191248.771916077@linuxfoundation.org> (raw)
In-Reply-To: <20220209191248.659458918@linuxfoundation.org>

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);
 	}
 



  parent reply	other threads:[~2022-02-09 19:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09 19:13 [PATCH 4.14 0/3] 4.14.266-rc1 review Greg Kroah-Hartman
2022-02-09 19:13 ` [PATCH 4.14 1/3] cgroup-v1: Require capabilities to set release_agent Greg Kroah-Hartman
2022-02-09 19:13 ` [PATCH 4.14 2/3] moxart: fix potential use-after-free on remove path Greg Kroah-Hartman
2022-02-09 19:13 ` Greg Kroah-Hartman [this message]
2022-02-10  8:33 ` [PATCH 4.14 0/3] 4.14.266-rc1 review Jon Hunter
2022-02-10 17:20 ` Naresh Kamboju
2022-02-10 20:56 ` Slade Watkins
2022-02-10 21:00 ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220209191248.771916077@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luofei@unicloud.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.