[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1608880271-2294955-1-git-send-email-bodefang@126.com>
Date: Fri, 25 Dec 2020 15:11:11 +0800
From: Defang Bo <bodefang@....com>
To: mpe@...erman.id.au, benh@...nel.crashing.org, paulus@...ba.org
Cc: akpm@...ux-foundation.org, rppt@...nel.org,
christophe.leroy@...roup.eu, penberg@...nel.org,
linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
Defang Bo <bodefang@....com>
Subject: [PATCH] powerpc/mm: avoid null pointer dereference in flush_tlb_mm
Similar to commit<0dc294f7>, there should be a check for 'mm' to prevent Null pointer dereference in case of 'mm' argument was legitimately passed.
Signed-off-by: Defang Bo <bodefang@....com>
---
arch/powerpc/mm/nohash/tlb.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/powerpc/mm/nohash/tlb.c b/arch/powerpc/mm/nohash/tlb.c
index 5872f69..09796c9 100644
--- a/arch/powerpc/mm/nohash/tlb.c
+++ b/arch/powerpc/mm/nohash/tlb.c
@@ -268,6 +268,9 @@ void flush_tlb_mm(struct mm_struct *mm)
{
unsigned int pid;
+ if (unlikely(!mm))
+ return;
+
preempt_disable();
pid = mm->context.id;
if (unlikely(pid == MMU_NO_CONTEXT))
--
2.7.4
Powered by blists - more mailing lists