Skip to content

Commit 102331b

Browse files
btw616jmberg-intel
authored andcommitted
um: Fix potential race condition in TLB sync
During the TLB sync, we need to traverse and modify the page table, so we should hold the page table lock. Since full SMP support for threads within the same process is still missing, let's disable the split page table lock for simplicity. Fixes: 1e4ee51 ("um: Add initial SMP support") Signed-off-by: Tiwei Bie <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 1ccc861 commit 102331b

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

arch/um/kernel/tlb.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ int um_tlb_sync(struct mm_struct *mm)
165165
unsigned long addr, next;
166166
int ret = 0;
167167

168+
guard(spinlock_irqsave)(&mm->page_table_lock);
168169
guard(spinlock_irqsave)(&mm->context.sync_tlb_lock);
169170

170171
if (mm->context.sync_tlb_range_to == 0)

mm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,7 @@ config SPLIT_PTE_PTLOCKS
572572
depends on !ARM || CPU_CACHE_VIPT
573573
depends on !PARISC || PA20
574574
depends on !SPARC32
575+
depends on !UML
575576

576577
config ARCH_ENABLE_SPLIT_PMD_PTLOCK
577578
bool

0 commit comments

Comments
 (0)