This is a note to let you know that I've just added the patch titled
audit: don't free_chunk() after fsnotify_add_mark()
to the 3.0-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
audit-don-t-free_chunk-after-fsnotify_add_mark.patch
and it can be found in the queue-3.0 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From 0fe33aae0e94b4097dd433c9399e16e17d638cd8 Mon Sep 17 00:00:00 2001
From: Miklos Szeredi <[email protected]>
Date: Wed, 15 Aug 2012 12:55:22 +0200
Subject: audit: don't free_chunk() after fsnotify_add_mark()
From: Miklos Szeredi <[email protected]>
commit 0fe33aae0e94b4097dd433c9399e16e17d638cd8 upstream.
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 <[email protected]>
Acked-by: Eric Paris <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
kernel/audit_tree.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/kernel/audit_tree.c
+++ b/kernel/audit_tree.c
@@ -265,7 +265,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;
}
@@ -328,7 +328,7 @@ static int create_chunk(struct inode *in
entry = &chunk->mark;
if (fsnotify_add_mark(entry, audit_tree_group, inode, NULL, 0)) {
- free_chunk(chunk);
+ fsnotify_put_mark(entry);
return -ENOSPC;
}
@@ -402,7 +402,7 @@ static int tag_chunk(struct inode *inode
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;
}
Patches currently in stable-queue which might be from [email protected] are
queue-3.0/audit-fix-refcounting-in-audit-tree.patch
queue-3.0/audit-don-t-free_chunk-after-fsnotify_add_mark.patch
queue-3.0/vfs-canonicalize-create-mode-in-build_open_flags.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html