diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2007-08-22 14:01:37 -0700 | 
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-22 19:52:45 -0700 | 
| commit | 179394af7a2baa1d0a3cb1670075310d72247d38 (patch) | |
| tree | f15d4ad366b1bfa7787d6a6a809816f507c4a23a /kernel/rtmutex-tester.c | |
| parent | 928923c76b393e38e5ba1d47e843e208ceef6cf9 (diff) | |
posix-timers: fix deletion race
timer_delete does:
	lock_timer();
	timer->it_process = NULL;
	unlock_timer();
	release_posix_timer();
timer->it_process is checked in lock_timer() to prevent access to a
timer, which is on the way to be deleted, but the check happens after
idr_lock is dropped. This allows release_posix_timer() to delete the
timer before the lock code can check the timer:
  CPU 0				CPU 1
  lock_timer();
  timer->it_process = NULL;
  unlock_timer();
				lock_timer()
					spin_lock(idr_lock);
					timer = idr_find();
					spin_lock(timer->lock);
					spin_unlock(idr_lock);
  release_posix_timer();
	spin_lock(idr_lock);
	idr_remove(timer);
	spin_unlock(idr_lock);
	free_timer(timer);
					if (timer->......)
Change the locking to prevent this.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/rtmutex-tester.c')
0 files changed, 0 insertions, 0 deletions
