Re: [PATCH] kernel: auditfilter: resource management, need processtree when audit_add_watch failed in audit_add_rule

From: Chen Gang
Date: Wed Apr 17 2013 - 00:26:48 EST



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@xxxxxxxxxxx>
> ---
> 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
--
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/