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: <20090313092558.GD2571@elte.hu>
Date:	Fri, 13 Mar 2009 10:25:58 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Zhaolei <zhaolei@...fujitsu.com>
Cc:	"Steven Rostedt ;" <rostedt@...dmis.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ftrace: Avoid double-free of dyn_ftrace


* Zhaolei <zhaolei@...fujitsu.com> wrote:

> If dyn_ftrace is free before ftrace_release(), 
> ftrace_release() will free it again and make 
> ftrace_free_records wrong.
> 
> Signed-off-by: Zhao Lei <zhaolei@...fujitsu.com>
> ---
>  kernel/trace/ftrace.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index d33d306..26c45aa 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -356,7 +356,8 @@ void ftrace_release(void *start, unsigned long size)
>  
>  	mutex_lock(&ftrace_lock);
>  	do_for_each_ftrace_rec(pg, rec) {
> -		if ((rec->ip >= s) && (rec->ip < e))
> +		if ((rec->ip >= s) && (rec->ip < e) &&
> +		    !(rec->flags & FTRACE_FL_FREE))
>  			ftrace_free_rec(rec);

Applied to tip:tracing/ftrace, thanks!

I'm wondering, did you trigger this in practice (if yes, how?), 
or have you found it via code review?

	Ingo
--
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