Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/ldt: Initialize the context lock for init_mm

The mutex mm->context->lock for init_mm is not initialized for init_mm.
This wasn't a problem because it remained unused. This changed however
since commit
4fc19708b165c ("x86/alternatives: Initialize temporary mm for patching")

Initialize the mutex for init_mm.

Fixes: 4fc19708b165c ("x86/alternatives: Initialize temporary mm for patching")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Nadav Amit <namit@vmware.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Andy Lutomirski <luto@kernel.org>
Link: https://lkml.kernel.org/r/20190701173354.2pe62hhliok2afea@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Sebastian Andrzej Siewior and committed by
Ingo Molnar
39ca5fb4 222a21d2

+1
+1
arch/x86/include/asm/mmu.h
··· 59 59 #define INIT_MM_CONTEXT(mm) \ 60 60 .context = { \ 61 61 .ctx_id = 1, \ 62 + .lock = __MUTEX_INITIALIZER(mm.context.lock), \ 62 63 } 63 64 64 65 void leave_mm(int cpu);