Skip to content

Commit c2c896b

Browse files
Arseny Solokhampe
authored andcommitted
powerpc/mm: Warn on flushing tlb page in kernel context
Function __flush_tlb_page() must only be called for user contexts, so put in extra hardening to warn on calling it for kernel context. Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 7f43e71 commit c2c896b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎arch/powerpc/mm/tlb_nohash.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,11 @@ void __flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr,
284284
struct cpumask *cpu_mask;
285285
unsigned int pid;
286286

287-
if (unlikely(!mm))
287+
/*
288+
* This function as well as __local_flush_tlb_page() must only be called
289+
* for user contexts.
290+
*/
291+
if (unlikely(WARN_ON(!mm)))
288292
return;
289293

290294
preempt_disable();

0 commit comments

Comments
 (0)