public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chen Gang <gang.chen@asianux.com>
To: Eric Paris <eparis@redhat.com>, Al Viro <viro@zeniv.linux.org.uk>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] kernel: auditfilter: resource management, need process tree when audit_add_watch failed in audit_add_rule
Date: Wed, 17 Apr 2013 12:26:02 +0800	[thread overview]
Message-ID: <516E245A.1050400@asianux.com> (raw)
In-Reply-To: <5167CC21.8090006@asianux.com>


  also please help checking this patch, when you have time.

  thanks.

On 2013年04月12日 16:56, Chen Gang wrote:
> 
>   need call audit_put_tree, if tree is valid.
>   just like another area have done in function audit_add_rule.
> 
> Signed-off-by: Chen Gang <gang.chen@asianux.com>
> ---
>  kernel/auditfilter.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
> index f9fc54b..81f63f9 100644
> --- a/kernel/auditfilter.c
> +++ b/kernel/auditfilter.c
> @@ -952,6 +952,12 @@ static inline int audit_add_rule(struct audit_entry *entry)
>  		err = audit_add_watch(&entry->rule, &list);
>  		if (err) {
>  			mutex_unlock(&audit_filter_mutex);
> +			/*
> +			 * normally audit_add_tree_rule() will free it
> +			 * on failure
> +			 */
> +			if (tree)
> +				audit_put_tree(tree);
>  			goto error;
>  		}
>  	}
> 


-- 
Chen Gang

Asianux Corporation

  reply	other threads:[~2013-04-17  4:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-12  4:43 [PATCH] kernel: audit_tree: resource management: need put_tree and goto Err when failure occures Chen Gang
2013-04-12  4:50 ` [PATCH] kernel: audit_watch: resource management: better reset to NULL Chen Gang
2013-04-12  8:18   ` Chen Gang
2013-04-12  8:56     ` [PATCH] kernel: auditfilter: resource management, need process tree when audit_add_watch failed in audit_add_rule Chen Gang
2013-04-17  4:26       ` Chen Gang [this message]
2013-04-16  7:35 ` [PATCH] kernel: audit_tree: resource management: need put_tree and goto Err when failure occures Chen Gang
2013-04-17  4:04   ` [PATCH v2] " Chen Gang
2013-04-17 20:07     ` Andrew Morton
2013-04-18  1:19       ` Chen Gang F T
2013-04-20  7:31         ` Chen Gang
2013-04-23  3:51           ` Chen Gang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=516E245A.1050400@asianux.com \
    --to=gang.chen@asianux.com \
    --cc=akpm@linux-foundation.org \
    --cc=eparis@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox