• Nick Piggin's avatar
    x86: some lock annotations for user copy paths · c10d38dd
    Nick Piggin authored
    copy_to/from_user and all its variants (except the atomic ones) can take a
    page fault and perform non-trivial work like taking mmap_sem and entering
    the filesyste/pagecache.
    
    Unfortunately, this often escapes lockdep because a common pattern is to
    use it to read in some arguments just set up from userspace, or write data
    back to a hot buffer. In those cases, it will be unlikely for page reclaim
    to get a window in to cause copy_*_user to fault.
    
    With the new might_lock primitives, add some annotations to x86. I don't
    know if I caught all possible faulting points (it's a bit of a maze, and I
    didn't really look at 32-bit). But this is a starting point.
    
    Boots and runs OK so far.
    Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
    Acked-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    c10d38dd
usercopy_64.c 4.11 KB