lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130410130721.12dd6755@tlielax.poochiereds.net>
Date:	Wed, 10 Apr 2013 13:07:21 -0400
From:	Jeff Layton <jlayton@...hat.com>
To:	Dmitry Monakhov <dmonakhov@...nvz.org>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] audit: destroy filename correctly

On Mon,  1 Apr 2013 11:00:00 +0400
Dmitry Monakhov <dmonakhov@...nvz.org> wrote:

> filename should be destroyed via final_putname() instead of __putname()
> Otherwise this result in following BUGON() in case of long names:
>   kernel BUG at mm/slab.c:3006!
>   Call Trace:
>   kmem_cache_free+0x1c1/0x850
>   audit_putname+0x88/0x90
>   putname+0x73/0x80
>   sys_symlinkat+0x120/0x150
>   sys_symlink+0x16/0x20
>   system_call_fastpath+0x16/0x1b
> 
> Signed-off-by: Dmitry Monakhov <dmonakhov@...nvz.org>
> ---
>  kernel/auditsc.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/auditsc.c b/kernel/auditsc.c
> index a371f85..bfe7ca6 100644
> --- a/kernel/auditsc.c
> +++ b/kernel/auditsc.c
> @@ -1010,7 +1010,7 @@ static inline void audit_free_names(struct audit_context *context)
>  	list_for_each_entry_safe(n, next, &context->names_list, list) {
>  		list_del(&n->list);
>  		if (n->name && n->name_put)
> -			__putname(n->name);
> +			final_putname(n->name);
>  		if (n->should_free)
>  			kfree(n);
>  	}
> @@ -2036,7 +2036,7 @@ void audit_putname(struct filename *name)
>  	BUG_ON(!context);
>  	if (!context->in_syscall) {
>  #if AUDIT_DEBUG == 2
> -		printk(KERN_ERR "%s:%d(:%d): __putname(%p)\n",
> +		printk(KERN_ERR "%s:%d(:%d): final_putname(%p)\n",
>  		       __FILE__, __LINE__, context->serial, name);
>  		if (context->name_count) {
>  			struct audit_names *n;
> @@ -2047,7 +2047,7 @@ void audit_putname(struct filename *name)
>  				       n->name, n->name->name ?: "(null)");
>  			}
>  #endif
> -		__putname(name);
> +		final_putname(name);
>  	}
>  #if AUDIT_DEBUG
>  	else {

Looks correct to me...

Reviewed-by: Jeff Layton <jlayton@...hat.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ