diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2012-08-15 12:55:22 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-14 10:00:38 -0700 |
commit | 830cd761e4a2d5b31326e5669f59170d8b25e5ed (patch) | |
tree | 251c03228e12cf3aac073b37be6a28f31fb0c91b /net/sunrpc | |
parent | 56e4562bb32d8a47485a9b8b868cb28fda595170 (diff) | |
download | kernel_samsung_smdk4412-830cd761e4a2d5b31326e5669f59170d8b25e5ed.zip kernel_samsung_smdk4412-830cd761e4a2d5b31326e5669f59170d8b25e5ed.tar.gz kernel_samsung_smdk4412-830cd761e4a2d5b31326e5669f59170d8b25e5ed.tar.bz2 |
audit: fix refcounting in audit-tree
commit a2140fc0cb0325bb6384e788edd27b9a568714e2 upstream.
Refcounting of fsnotify_mark in audit tree is broken. E.g:
refcount
create_chunk
alloc_chunk 1
fsnotify_add_mark 2
untag_chunk
fsnotify_get_mark 3
fsnotify_destroy_mark
audit_tree_freeing_mark 2
fsnotify_put_mark 1
fsnotify_put_mark 0
via destroy_list
fsnotify_mark_destroy -1
This was reported by various people as triggering Oops when stopping auditd.
We could just remove the put_mark from audit_tree_freeing_mark() but that would
break freeing via inode destruction. So this patch simply omits a put_mark
after calling destroy_mark or adds a get_mark before.
The additional get_mark is necessary where there's no other put_mark after
fsnotify_destroy_mark() since it assumes that the caller is holding a reference
(or the inode is keeping the mark pinned, not the case here AFAICS).
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Reported-by: Valentin Avram <aval13@gmail.com>
Reported-by: Peter Moody <pmoody@google.com>
Acked-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/sunrpc')
0 files changed, 0 insertions, 0 deletions