summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/x86-ldt-Initialize-the-context-lock-for-init_mm.patch
blob: fa8cf903736ba3f34aae823d32fcf81d5d355b68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Mon, 1 Jul 2019 17:53:13 +0200
Subject: [PATCH] x86/ldt: Initialize the context lock for init_mm
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz

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>
---
 arch/x86/include/asm/mmu.h |    1 +
 1 file changed, 1 insertion(+)

--- a/arch/x86/include/asm/mmu.h
+++ b/arch/x86/include/asm/mmu.h
@@ -59,6 +59,7 @@ typedef struct {
 #define INIT_MM_CONTEXT(mm)						\
 	.context = {							\
 		.ctx_id = 1,						\
+		.lock = __MUTEX_INITIALIZER(mm.context.lock),		\
 	}
 
 void leave_mm(int cpu);