• Vineet Gupta's avatar
    ARC: Incorrect mm reference used in vmalloc fault handler · 40a89402
    Vineet Gupta authored
    commit 9c41f4ee upstream.
    
    A vmalloc fault needs to sync up PGD/PTE entry from init_mm to current
    task's "active_mm".  ARC vmalloc fault handler however was using mm.
    
    A vmalloc fault for non user task context (actually pre-userland, from
    init thread's open for /dev/console) caused the handler to deref NULL mm
    (for mm->pgd)
    
    The reasons it worked so far is amazing:
    
    1. By default (!SMP), vmalloc fault handler uses a cached value of PGD.
       In SMP that MMU register is repurposed hence need for mm pointer deref.
    
    2. In pre-3.12 SMP kernel, the problem triggering vmalloc didn't exist in
       pre-userland code path - it was introduced with commit 20bafb3d
       "n_tty: Move buffers into n_tty_data"
    Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
    Cc: Gilad Ben-Yossef <gilad@benyossef.com>
    Cc: Noam Camus <noamc@ezchip.com>
    Cc: Peter Hurley <peter@hurleysoftware.com>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    40a89402
fault.c 5.22 KB