summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2012-08-15 12:55:22 +0200
committerMiklos Szeredi <mszeredi@suse.cz>2012-08-15 12:55:22 +0200
commit0fe33aae0e94b4097dd433c9399e16e17d638cd8 (patch)
tree799d8107cc7b000c1fba87f87b59cb6d467dc9a2 /kernel
parentddf343f635fe4440cad528e12f96f28bd50aa099 (diff)
downloadlinux-stable-0fe33aae0e94b4097dd433c9399e16e17d638cd8.tar.gz
linux-stable-0fe33aae0e94b4097dd433c9399e16e17d638cd8.tar.bz2
linux-stable-0fe33aae0e94b4097dd433c9399e16e17d638cd8.zip
audit: don't free_chunk() after fsnotify_add_mark()
Don't do free_chunk() after fsnotify_add_mark(). That one does a delayed unref via the destroy list and this results in use-after-free. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Acked-by: Eric Paris <eparis@redhat.com> CC: stable@vger.kernel.org
Diffstat (limited to 'kernel')
-rw-r--r--kernel/audit_tree.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/audit_tree.c b/kernel/audit_tree.c
index 3a5ca582ba1e..69a58515f43f 100644
--- a/kernel/audit_tree.c
+++ b/kernel/audit_tree.c
@@ -259,7 +259,7 @@ static void untag_chunk(struct node *p)
fsnotify_duplicate_mark(&new->mark, entry);
if (fsnotify_add_mark(&new->mark, new->mark.group, new->mark.i.inode, NULL, 1)) {
- free_chunk(new);
+ fsnotify_put_mark(&new->mark);
goto Fallback;
}
@@ -322,7 +322,7 @@ static int create_chunk(struct inode *inode, struct audit_tree *tree)
entry = &chunk->mark;
if (fsnotify_add_mark(entry, audit_tree_group, inode, NULL, 0)) {
- free_chunk(chunk);
+ fsnotify_put_mark(entry);
return -ENOSPC;
}
@@ -396,7 +396,7 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree)
fsnotify_duplicate_mark(chunk_entry, old_entry);
if (fsnotify_add_mark(chunk_entry, chunk_entry->group, chunk_entry->i.inode, NULL, 1)) {
spin_unlock(&old_entry->lock);
- free_chunk(chunk);
+ fsnotify_put_mark(chunk_entry);
fsnotify_put_mark(old_entry);
return -ENOSPC;
}