diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-31 02:30:55 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-31 12:18:56 -0800 |
commit | 993dfa8776308dcfd311cf77a3bbed4aa11e9868 (patch) | |
tree | 2e90eabd31d3e8db1f2f3c95494109ff29a78237 /Documentation/laptop-mode.txt | |
parent | 7a2bd3f7efa86e8b56482a8f8948c8b222064a67 (diff) |
[PATCH] fs/locks.c: Fix sys_flock() race
sys_flock() currently has a race which can result in a double free in the
multi-thread case.
Thread 1 Thread 2
sys_flock(file, LOCK_EX)
sys_flock(file, LOCK_UN)
If Thread 2 removes the lock from inode->i_lock before Thread 1 tests for
list_empty(&lock->fl_link) at the end of sys_flock, then both threads will
end up calling locks_free_lock for the same lock.
Fix is to make flock_lock_file() do the same as posix_lock_file(), namely
to make a copy of the request, so that the caller can always free the lock.
This also has the side-effect of fixing up a reference problem in the
lockd handling of flock.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'Documentation/laptop-mode.txt')
0 files changed, 0 insertions, 0 deletions