]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/64s: Fix page table fragment refcount race vs speculative references
authorNicholas Piggin <npiggin@gmail.com>
Fri, 27 Jul 2018 11:48:17 +0000 (21:48 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 7 Aug 2018 14:32:32 +0000 (00:32 +1000)
commit30c7334332f6c33949382d0b532bf8dad75cdae5
treed504bc547bb05060595d02e96710a20795707518
parent573c28a799f97638486102641746f1869e8e29b5
powerpc/64s: Fix page table fragment refcount race vs speculative references

The page table fragment allocator uses the main page refcount racily
with respect to speculative references. A customer observed a BUG due
to page table page refcount underflow in the fragment allocator. This
can be caused by the fragment allocator set_page_count stomping on a
speculative reference, and then the speculative failure handler
decrements the new reference, and the underflow eventually pops when
the page tables are freed.

Fix this by using a dedicated field in the struct page for the page
table fragment allocator.

Fixes: 9cb62341ab75 ("powerpc: Reduce PTE table memory wastage")
Cc: stable@vger.kernel.org # v3.10+
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/mmu_context_book3s64.c
arch/powerpc/mm/pgtable-book3s64.c
include/linux/mm_types.h