]> git.baikalelectronics.ru Git - kernel.git/commit
fsnotify: don't BUG in fsnotify_destroy_mark()
authorMiklos Szeredi <mszeredi@suse.cz>
Thu, 12 Jan 2012 16:59:46 +0000 (17:59 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 15 Jan 2012 02:01:42 +0000 (18:01 -0800)
commit27256d85dd11b0e07c7a4cd7e57146dafa0e4030
tree8935acfe89c87fe63f72bb114fa17f97f7c26564
parent95413f7b98aaba80cc3c26696330cfe1c140c3de
fsnotify: don't BUG in fsnotify_destroy_mark()

Removing the parent of a watched file results in "kernel BUG at
fs/notify/mark.c:139".

To reproduce

  add "-w /tmp/audit/dir/watched_file" to audit.rules
  rm -rf /tmp/audit/dir

This is caused by fsnotify_destroy_mark() being called without an
extra reference taken by the caller.

Reported by Francesco Cosoleto here:

  https://bugzilla.novell.com/show_bug.cgi?id=689860

Fix by removing the BUG_ON and adding a comment about not accessing mark after
the iput.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
CC: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/notify/mark.c