Trond Myklebust
993dfa8776
[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>
2006-03-31 12:18:56 -08:00
..
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-23 07:38:17 -08:00
2006-03-28 09:16:06 -08:00
2006-03-30 12:28:18 -08:00
2006-03-30 12:28:18 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-31 12:18:51 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-26 08:56:55 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-26 08:56:55 -08:00
2006-03-28 09:16:06 -08:00
2006-03-31 12:18:55 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-24 07:33:19 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-29 13:24:50 +11:00
2006-03-31 12:18:53 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-30 12:28:18 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:06 -08:00
2006-03-31 12:18:55 -08:00
2006-03-29 10:44:40 +10:00
2006-03-25 08:23:00 -08:00
2006-03-28 09:16:06 -08:00
2006-03-24 18:38:48 +01:00
2006-03-25 09:10:52 -08:00
2006-03-25 08:23:01 -08:00
2006-03-28 09:16:06 -08:00
2006-03-26 08:57:00 -08:00
2006-03-28 09:16:06 -08:00
2006-03-27 08:44:48 -08:00
2006-03-31 12:18:53 -08:00
2006-03-24 07:33:19 -08:00
2006-03-28 09:16:04 -08:00
2006-03-31 12:18:55 -08:00
2006-03-26 08:56:56 -08:00
2006-03-29 09:26:15 +10:00
2006-03-26 08:56:56 -08:00
2006-03-24 07:33:23 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 18:36:42 -08:00
2006-03-26 08:56:56 -08:00
2006-03-28 09:16:06 -08:00
2006-03-23 07:38:17 -08:00
2006-03-28 09:16:05 -08:00
2006-03-25 08:22:56 -08:00
2006-03-28 09:16:05 -08:00
2006-03-28 09:16:06 -08:00
2006-03-23 23:44:19 -05:00
2006-03-28 09:16:06 -08:00
2006-03-31 12:18:56 -08:00
2006-03-31 12:18:54 -08:00
2006-03-28 09:16:08 -08:00
2006-03-26 08:57:01 -08:00
2006-03-27 08:44:40 -08:00
2006-03-27 08:44:40 -08:00
2006-03-24 07:33:19 -08:00
2006-03-25 09:24:53 -08:00
2006-03-30 12:28:18 -08:00
2006-03-24 07:33:24 -08:00
2006-03-23 07:38:11 -08:00
2006-03-23 07:38:11 -08:00
2006-03-28 09:16:06 -08:00
2006-03-28 09:16:05 -08:00
2006-03-23 07:38:12 -08:00
2006-03-30 22:16:24 -08:00
2006-03-26 08:56:55 -08:00
2006-03-31 12:18:54 -08:00