linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/mm, mm/hwpoison: Fix the unmap kernel 1:1 pages check condition
@ 2022-02-08  3:20 luofei
  2022-02-09 13:11 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: luofei @ 2022-02-08  3:20 UTC (permalink / raw)
  To: stable, tony.luck, bp, tglx, mingo, hpa, x86
  Cc: linux-edac, linux-kernel, 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 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
---
 arch/x86/kernel/cpu/mcheck/mce.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 95c09db1bba2..d8399a689165 100644
--- 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 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);
 	}
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86/mm, mm/hwpoison: Fix the unmap kernel 1:1 pages check condition
  2022-02-08  3:20 [PATCH] x86/mm, mm/hwpoison: Fix the unmap kernel 1:1 pages check condition luofei
@ 2022-02-09 13:11 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2022-02-09 13:11 UTC (permalink / raw)
  To: luofei
  Cc: stable, tony.luck, bp, tglx, mingo, hpa, x86, linux-edac,
	linux-kernel

On Mon, Feb 07, 2022 at 10:20:28PM -0500, luofei wrote:
> [ 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.
> 
> Signed-off-by: luofei <luofei@unicloud.com>
> Cc: stable@vger.kernel.org #v4.14.x
> Cc: stable@vger.kernel.org #v4.15.x
> ---
>  arch/x86/kernel/cpu/mcheck/mce.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, now queued up.

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-09 13:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-08  3:20 [PATCH] x86/mm, mm/hwpoison: Fix the unmap kernel 1:1 pages check condition luofei
2022-02-09 13:11 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).