• Andrew Morton's avatar
    [PATCH] Fix race condition with current->group_info · 8e56790b
    Andrew Morton authored
    From: Olaf Kirch <okir@suse.de>
    
    I have been chasing a corruption of current->group_info on PPC during NFS
    stress tests.  The problem seems to be that nfsd is messing with its
    group_info quite a bit, while some monitoring processes look at
    /proc/<pid>/status and do a get_group_info/put_group_info without any locking.
    
    This problem can be reproduced on ppc platforms within a few seconds if you
    generate some NFS load and do a "cat /proc/XXX/status" of an nfsd thread in a
    tight loop.
    
    I therefore think changes to current->group_info, and querying it from a
    different process, needs to be protected using the task_lock.
    
    (akpm: task->group_info here is safe against exit() because the task holds a
    ref on group_info which is released in __put_task_struct, and the /proc file
    has a ref on the task_struct).
    8e56790b
sys.c 37.7 KB