• J. Bruce Fields's avatar
    lockd: fix race in nlm_release() · 164f98ad
    J. Bruce Fields authored
    The sm_count is decremented to zero but left on the nsm_handles list.
    So in the space between decrementing sm_count and acquiring nsm_mutex,
    it is possible for another task to find this nsm_handle, increment the
    use count and then enter nsm_release itself.
    
    Thus there's nothing to prevent the nsm being freed before we acquire
    nsm_mutex here.
    Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
    164f98ad
host.c 13.2 KB