]> git.baikalelectronics.ru Git - kernel.git/commit
lockd: fix race in nlm_release()
authorJ. Bruce Fields <bfields@citi.umich.edu>
Wed, 20 Feb 2008 19:02:47 +0000 (14:02 -0500)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Wed, 23 Apr 2008 20:13:39 +0000 (16:13 -0400)
commit3ddd5feb18006025a294530f2a843b823aa20d80
treebaa47455b18219eca8ff4a54a84954170597fa06
parentfdcabaf3ff74b7c481004c09c78b1c3cc37c5132
lockd: fix race in nlm_release()

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: J. Bruce Fields <bfields@citi.umich.edu>
fs/lockd/host.c