kernel_optimize_test/fs/notify/inotify
Eric Paris e08733446e inotify: race use after free/double free in inotify inode marks
There is a race in the inotify add/rm watch code.  A task can find and
remove a mark which doesn't have all of it's references.  This can
result in a use after free/double free situation.

Task A					Task B
------------				-----------
inotify_new_watch()
 allocate a mark (refcnt == 1)
 add it to the idr
					inotify_rm_watch()
					 inotify_remove_from_idr()
					  fsnotify_put_mark()
					      refcnt hits 0, free
 take reference because we are on idr
 [at this point it is a use after free]
 [time goes on]
 refcnt may hit 0 again, double free

The fix is to take the reference BEFORE the object can be found in the
idr.

Signed-off-by: Eric Paris <eparis@redhat.com>
Cc: <stable@kernel.org>
2010-05-14 11:52:57 -04:00
..
inotify_fsnotify.c inotify: only warn once for inotify problems 2010-01-15 14:49:23 -08:00
inotify_user.c inotify: race use after free/double free in inotify inode marks 2010-05-14 11:52:57 -04:00
inotify.c
inotify.h
Kconfig Inotify: undefined reference to `anon_inode_getfd' 2010-05-12 11:03:40 -04:00
Makefile