• Paolo 'Blaisorblade' Giarrusso's avatar
    [PATCH] uml: fix hang in TT mode on fault · 546fe1cb
    Paolo 'Blaisorblade' Giarrusso authored
    
    
    The current code doesn't handle well general protection faults on the host -
    it thinks that cr2 is always the address of a page fault.  While actually, on
    general protection faults, that address is not accessible, so we'd better
    assume we couldn't satisfy the fault.  Currently instead we think we've fixed
    it, so we go back, retry the instruction and fault again endlessly.
    
    This leads to the kernel hanging when doing copy_from_user(dest, -1, ...) in
    TT mode, since reading *(-1) causes a GFP, and we don't support kernel
    preemption.
    
    Thanks to Luo Xin for testing UML with LTP and reporting the failures he got.
    
    Cc: Luo Xin <luothing@sina.com>
    Signed-off-by: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
    Cc: Jeff Dike <jdike@addtoit.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    546fe1cb
trap_kern.c 4.99 KB