Re: [PATCH] audit: fix mark refcounting

From: Miklos Szeredi
Date: Tue Nov 15 2011 - 09:12:22 EST


Ping?

On Mon, Nov 7, 2011 at 3:59 PM, Miklos Szeredi <miklos@xxxxxxxxxx> wrote:
> From: Miklos Szeredi <mszeredi@xxxxxxx>
>
> 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
>
> Signed-off-by: Miklos Szeredi <mszeredi@xxxxxxx>
> CC: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
> CC: Eric Paris <eparis@xxxxxxxxxx>
> CC: stable@xxxxxxxxxxxxxxx
> ---
> Âkernel/audit_watch.c | Â Â2 ++
> Â1 file changed, 2 insertions(+)
>
> Index: linux.git/kernel/audit_watch.c
> ===================================================================
> --- linux.git.orig/kernel/audit_watch.c 2011-09-13 16:08:20.000000000 +0200
> +++ linux.git/kernel/audit_watch.c   Â2011-11-07 15:19:07.000000000 +0100
> @@ -349,7 +349,9 @@ static void audit_remove_parent_watches(
> Â Â Â Â}
> Â Â Â Âmutex_unlock(&audit_filter_mutex);
>
> + Â Â Â audit_get_parent(parent);
> Â Â Â Âfsnotify_destroy_mark(&parent->mark);
> + Â Â Â audit_put_parent(parent);
> Â}
>
> Â/* Get path information necessary for adding watches. */
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/