• Martin Schwidefsky's avatar
    s390/mm: fix vunmap vs finish_arch_post_lock_switch · a9809407
    Martin Schwidefsky authored
    The vunmap_pte_range() function calls ptep_get_and_clear() without any
    locking. ptep_get_and_clear() uses ptep_xchg_lazy()/ptep_flush_direct()
    for the page table update. ptep_flush_direct requires that preemption
    is disabled, but without any locking this is not the case. If the kernel
    preempts the task while the attach_counter is increased an endless loop
    in finish_arch_post_lock_switch() will occur the next time the task is
    scheduled.
    
    Add explicit preempt_disable()/preempt_enable() calls to the relevant
    functions in arch/s390/mm/pgtable.c.
    Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
    a9809407
pgtable.c 14.7 KB